oc_connect
Loading...
Searching...
No Matches
oc_connect.credentials Namespace Reference

Classes

class  CredentialPathError
class  CredentialFileError
class  CredentialNotFoundError
class  CredentialBackend
class  SidecarCredentialBackend
class  CredentialBroker

Functions

Path _existing_ancestor (Path path)
bool is_gitignored (str|Path path)
None _chmod_private (Path path)

Variables

int SECRET_FILE_MODE = 0o600
 _NAME_RE = re.compile(r"^[a-z][a-z0-9_.-]*$")
float _GIT_TIMEOUT_SECONDS = 5.0

Detailed Description

Sidecar-backed credential broker with a runtime gitignore canary.

The implementation follows the plan-216 provider sidecar pattern. Raw values are
accepted by the backend and returned only to the caller that asks for a named
credential. Diagnostics, printed output, logging, and exception messages carry
names and paths only.

Dependencies
------------
- oc_connect.workspace (credential_path - the default workspace-anchored sidecar path)
- oc_diagnostics (_dbg structured logger)
- git (not imported; run as git check-ignore, the canary that proves the sidecar is gitignored)

Function Documentation

◆ _chmod_private()

None oc_connect.credentials._chmod_private ( Path path)
protected

Definition at line 104 of file credentials.py.

Here is the caller graph for this function:

◆ _existing_ancestor()

Path oc_connect.credentials._existing_ancestor ( Path path)
protected

Definition at line 62 of file credentials.py.

Here is the caller graph for this function:

◆ is_gitignored()

bool oc_connect.credentials.is_gitignored ( str | Path path)
Ask git whether *path* is ignored; every probe error fails closed.

Definition at line 69 of file credentials.py.

Here is the call graph for this function:

Variable Documentation

◆ _GIT_TIMEOUT_SECONDS

float oc_connect.credentials._GIT_TIMEOUT_SECONDS = 5.0
protected

Definition at line 33 of file credentials.py.

◆ _NAME_RE

oc_connect.credentials._NAME_RE = re.compile(r"^[a-z][a-z0-9_.-]*$")
protected

Definition at line 32 of file credentials.py.

◆ SECRET_FILE_MODE

int oc_connect.credentials.SECRET_FILE_MODE = 0o600

Definition at line 31 of file credentials.py.