Documentation ¶
Index ¶
- Variables
- func NewParser(options ...Option) (*parser, error)
- func Parse(v any, options ...Option) error
- type Option
- func WithAppConfiguration(appConfiguration string) Option
- func WithClientCertificateCredential(tenantID, clientID string, certificates []*x509.Certificate, ...) Option
- func WithClientSecretCredential(tenantID, clientID, clientSecret string) Option
- func WithConcurrency(c int) Option
- func WithCredential(cred auth.Credential) Option
- func WithKeyVault(keyVault string) Option
- func WithLabel(label string) Option
- func WithManagedIdentity(clientID ...string) Option
- func WithSecretClient(c secretClient) Option
- func WithSettingClient(c settingClient) Option
- func WithTimeout(d time.Duration) Option
- type Options
- type RequiredFieldsError
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidCredential is returned when a credential is not valid. ErrInvalidCredential = errors.New("invalid credential") // ErrMissingClientID is returned when a client ID is required but not provided. ErrMissingClientID = errors.New("client ID is required for client credentials") )
Functions ¶
Types ¶
type Option ¶ added in v0.7.0
type Option func(o *Options)
Option is a function that sets Options.
func WithAppConfiguration ¶ added in v0.10.0
WithAppConfiguration sets the App Configuration for the parser.
func WithClientCertificateCredential ¶ added in v0.11.0
func WithClientCertificateCredential(tenantID, clientID string, certificates []*x509.Certificate, key *rsa.PrivateKey) Option
WithClientCertificateCredential sets the parser to use client credential with a certificate (client certificate credential) for the Key Vault.
func WithClientSecretCredential ¶ added in v0.7.0
WithClientSecretCredential sets the parser to use client credential with a secret (client secret credential) for the Key Vault.
func WithConcurrency ¶ added in v0.7.0
WithConcurrency sets the concurrency of the parser.
func WithCredential ¶ added in v0.7.0
func WithCredential(cred auth.Credential) Option
WithCredential sets the provided credential to the parser.
func WithKeyVault ¶ added in v0.10.0
WithKeyVault sets the Key Vault for the parser.
func WithManagedIdentity ¶ added in v0.7.0
WithManagedIdentity sets the parser to use a managed identity for credentials for the Key Vault.
func WithSecretClient ¶ added in v0.8.0
func WithSecretClient(c secretClient) Option
WithSecretClient sets the client for secret retrieval.
func WithSettingClient ¶ added in v0.10.0
func WithSettingClient(c settingClient) Option
WithSettingClient sets the client for setting retreival.
func WithTimeout ¶ added in v0.7.0
WithTimeout sets the timeout of the parser.
type Options ¶ added in v0.4.0
type Options struct { // Credential is the credential to be used with the Client. Used to override // the default method of aquiring credentials. Credential auth.Credential // SecretClient is a client used to retrieve secrets. SecretClient secretClient // SettingClient is a client used to retrieve settings. SettingClient settingClient // KeyVault is the name of the Key Vault containing secrets. Used to override the // default method of aquiring target Key Vault. KeyVault string // AppConfiguration is the name of the App Configuration containing settibgs. Used to override the // default method of aquiring target App Configuration. AppConfiguration string // Label for setting in an Azure App Configuration. Label string // TenantID of the Service Principal with access to target Key Vault. TenantID string // ClientID of the Service Principal or user assigned managed identity with access to target Key Vault. ClientID string // ClientSecret of the Service Principal with access to target Key Vault. ClientSecret string // Certificates for the Service Principal with access to target Key Vault. Certificates []*x509.Certificate // PrivateKey to be used with the certificates for the Service Principal with access to target Key Vault. PrivateKey *rsa.PrivateKey // Concurrency is the amount of secrets that will be retrieved concurrently. // Defaults to 10. Concurrency int // Timeout is the total timeout for retrieval of secrets. Defaults to 10 seconds. Timeout time.Duration // UseManagedIdentity set to use a managed identity. To use a user assigned managed identity, use // together with ClientID. UseManagedIdentity bool }
Options contains options for the Parser.
type RequiredFieldsError ¶ added in v0.10.0
type RequiredFieldsError struct {
// contains filtered or unexported fields
}
RequiredFieldsError represents an error when either secrets or settings are required but not set.
func (*RequiredFieldsError) Error ¶ added in v0.10.0
func (e *RequiredFieldsError) Error() string
Error returns the combined error messages from the errors contained in RequiredFieldsError.