Skip to main content

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

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
keystringThe identifier for the secret to retrieve.

Returns

TypeDescription
string, errorThe 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

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
secret*coreIdl.SecretA pointer to the secret object containing details about the secret to retrieve.

Returns

TypeDescription
string, errorThe secret value as a string, or an error if the secret cannot be retrieved.