Documentation
¶
Index ¶
- Variables
- func Builder(provider types.ProviderType, opts ...ProviderOption) providers.Builder
- type Provider
- func (p *Provider) BeginAuth(context.Context, types.AuthContext) (types.AuthSession, error)
- func (p *Provider) Capabilities() types.ProviderCapabilities
- func (p *Provider) Mint(_ context.Context, subject types.CredentialSubject) (types.CredentialPayload, error)
- func (p *Provider) Operations() []types.OperationDescriptor
- func (p *Provider) Type() types.ProviderType
- type ProviderOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrProviderMetadataRequired indicates provider metadata is required but not supplied ErrProviderMetadataRequired = errors.New("apikey: provider metadata required") // ErrTokenFieldRequired indicates the configured token field is missing from metadata ErrTokenFieldRequired = errors.New("apikey: token field required") // ErrAuthTypeMismatch indicates the provider spec specifies an incompatible auth type ErrAuthTypeMismatch = errors.New("apikey: auth type mismatch") // ErrBeginAuthNotSupported indicates BeginAuth is not supported for API key providers ErrBeginAuthNotSupported = errors.New("apikey: BeginAuth is not supported; configure credentials via metadata") // ErrProviderNotInitialized indicates the provider instance is nil ErrProviderNotInitialized = errors.New("apikey: provider not initialized") )
Functions ¶
func Builder ¶
func Builder(provider types.ProviderType, opts ...ProviderOption) providers.Builder
Builder returns a providers.Builder that constructs API key providers.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements API key based integrations.
func (*Provider) BeginAuth ¶
func (p *Provider) BeginAuth(context.Context, types.AuthContext) (types.AuthSession, error)
BeginAuth is not supported for API key providers.
func (*Provider) Capabilities ¶
func (p *Provider) Capabilities() types.ProviderCapabilities
Capabilities exposes optional provider behaviour flags.
func (*Provider) Mint ¶
func (p *Provider) Mint(_ context.Context, subject types.CredentialSubject) (types.CredentialPayload, error)
Mint materializes a stored API key configuration into a credential payload.
func (*Provider) Operations ¶
func (p *Provider) Operations() []types.OperationDescriptor
Operations returns provider-published operations when configured.
func (*Provider) Type ¶
func (p *Provider) Type() types.ProviderType
Type returns the provider identifier.
type ProviderOption ¶
type ProviderOption func(*providerConfig)
ProviderOption customizes API key providers.
func WithOperations ¶
func WithOperations(descriptors []types.OperationDescriptor) ProviderOption
WithOperations registers provider-published operations.
func WithTokenField ¶
func WithTokenField(field string) ProviderOption
WithTokenField overrides the metadata field used to extract the API token.
Click to show internal directories.
Click to hide internal directories.