OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
security.environment_variable_secret_manager.EnvironmentVariableSecretManager Class Reference

Read secrets from an environment file and process environment. More...

Inheritance diagram for security.environment_variable_secret_manager.EnvironmentVariableSecretManager:
security.secret_manager_if.SecretManagerIf

Public Member Functions

Path|None secrets_file (self)
 Return the backing environment file, when this manager owns one.
 
None set_secret (self, str name, str value)
 Persist one secret in the backing environment file.
 
str|None get_secret (self, str name)
 Return a secret value, or None when it is unavailable.
 
- Public Member Functions inherited from security.secret_manager_if.SecretManagerIf
str require_secret (self, str name)
 Return a required secret or raise a descriptive error.
 

Detailed Description

Read secrets from an environment file and process environment.

Args: environment: Optional environment mapping. Supplying one is useful for tests. When omitted, values are loaded from secrets_file and then overridden by os.environ.

prefix: Optional prefix added before each requested secret name.

secrets_file: Environment-style secrets file used when environment is omitted. When omitted, a platform-appropriate default is resolved at runtime.

Member Function Documentation

◆ get_secret()

str | None security.environment_variable_secret_manager.EnvironmentVariableSecretManager.get_secret (   self,
str  name 
)

Return a secret value, or None when it is unavailable.

Parameters
nameStable secret name.
Returns
Secret value, or None when it is unavailable.

Reimplemented from security.secret_manager_if.SecretManagerIf.

◆ set_secret()

None security.environment_variable_secret_manager.EnvironmentVariableSecretManager.set_secret (   self,
str  name,
str  value 
)

Persist one secret in the backing environment file.

Process-environment-only managers are intentionally read-only.


The documentation for this class was generated from the following file: