FileEnvSecretManager
This class allows retrieving secrets mounted to this process through environment variables or files.
Methods
Get()
@classmethod
def Get(
ctx: context.Context,
key: string
) - > string, error
Retrieves a secret value associated with the given key. Callers use this to fetch a secret by its identifier.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, used for cancellation and deadlines. |
| key | string | The identifier for the secret to retrieve. |
Returns
| Type | Description |
|---|---|
string, error | The secret value as a string, or an error if the secret cannot be retrieved. |
GetForSecret()
@classmethod
def GetForSecret(
ctx: context.Context,
secret: *coreIdl.Secret
) - > string, error
Retrieves the value for a specified secret object. Callers use this to obtain the actual secret content from a structured secret definition.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, used for cancellation and deadlines. |
| secret | *coreIdl.Secret | A pointer to the secret object containing details about the secret to retrieve. |
Returns
| Type | Description |
|---|---|
string, error | The secret value as a string, or an error if the secret cannot be retrieved. |