Lightning.Credentials.Resolver (Lightning v2.15.0-pre5)
View SourceProvides credential resolution abstraction for workflow execution.
Resolves credentials by matching the project's environment to the credential's environment body. For OAuth credentials, passes the environment body during token refresh.
Summary
Functions
Resolves a credential for a run by matching the project's environment, or resolves a credential directly for a specific environment.
Types
@type error_reason() :: :not_found | :environment_not_configured | :project_not_found | :environment_mismatch | Lightning.Credentials.oauth_refresh_error()
@type resolve_error() :: {error_reason(), Lightning.Credentials.Credential.t() | nil}
Functions
@spec resolve_credential(Lightning.Run.t(), credential_id :: String.t()) :: {:ok, Lightning.Credentials.ResolvedCredential.t() | nil} | {:error, :not_found | resolve_error()}
@spec resolve_credential( Lightning.Credentials.Credential.t(), environment :: String.t() ) :: {:ok, Lightning.Credentials.ResolvedCredential.t()} | {:error, resolve_error()}
Resolves a credential for a run by matching the project's environment, or resolves a credential directly for a specific environment.