Documentation
¶
Overview ¶
Package common provides shared adapter utilities for goAuthly.
Concurrency: All exported types and functions are safe for concurrent use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdapterOptions ¶
type AdapterOptions struct {
RequiredMeta RequiredMetadata
AttachMetaToResult bool
}
AdapterOptions holds common adapter configuration.
type MetadataExtractor ¶
type MetadataExtractor interface {
// Get returns the value for the given key and whether it was found.
Get(key string) (string, bool)
// All returns all metadata key-value pairs.
All() map[string]string
}
MetadataExtractor abstracts reading metadata from different transports.
type RequiredMetadata ¶
type RequiredMetadata struct {
// Keys lists required metadata/header names.
// For HTTP headers, comparison is case-insensitive.
// For gRPC metadata, keys are treated as lower-case per gRPC conventions.
Keys []string
// Enabled controls whether metadata validation is active.
// If false, Validate always returns nil.
Enabled bool
}
RequiredMetadata defines mandatory metadata keys that must be present in a request before authentication proceeds.
func (RequiredMetadata) ExtractMetadataMap ¶
func (r RequiredMetadata) ExtractMetadataMap(ex MetadataExtractor) map[string]string
ExtractMetadataMap extracts the values of the required keys into a map. Only non-empty values are included. Keys are normalized to lower-case.
func (RequiredMetadata) Validate ¶
func (r RequiredMetadata) Validate(ex MetadataExtractor) error
Validate checks that all required keys are present and non-empty. Returns ErrMissingRequiredMetadata wrapping the missing key name on failure.