apikey

package
v1.5.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL