Documentation
¶
Index ¶
- func HasIdentity(kind string) bool
- func HasProvider(kind string) bool
- func NewIdentity(name string, config *schema.Identity) (types.Identity, error)
- func NewProvider(name string, config *schema.Provider) (types.Provider, error)
- func RegisterBatch(batch Registration) (func(), error)
- func RegisterEmulatorIdentities(f *Registry) error
- func RegisterGCPIdentities(f *Registry) error
- func RegisterGCPProviders(f *Registry) error
- func RegisterIdentity(kind string, constructor IdentityConfigConstructor) error
- func RegisterProvider(kind string, constructor ProviderConfigConstructor) error
- type ConfigSetter
- type IdentityConfigConstructor
- type IdentityConstructor
- type ProviderConfigConstructor
- type ProviderConstructor
- type Registration
- type Registry
- func (f *Registry) CreateIdentity(kind, name string, principal map[string]any) (types.Identity, error)
- func (f *Registry) CreateProvider(kind, name string, spec map[string]any) (types.Provider, error)
- func (f *Registry) HasIdentity(kind string) bool
- func (f *Registry) HasProvider(kind string) bool
- func (f *Registry) NewIdentity(name string, config *schema.Identity) (types.Identity, error)
- func (f *Registry) NewProvider(name string, config *schema.Provider) (types.Provider, error)
- func (f *Registry) RegisterBatch(batch Registration) (func(), error)
- func (f *Registry) RegisterIdentity(kind string, constructor IdentityConstructor) error
- func (f *Registry) RegisterIdentityConfig(kind string, constructor IdentityConfigConstructor) error
- func (f *Registry) RegisterProvider(kind string, constructor ProviderConstructor) error
- func (f *Registry) RegisterProviderConfig(kind string, constructor ProviderConfigConstructor) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasIdentity ¶
HasIdentity reports whether the process registry can construct this identity kind.
func HasProvider ¶
HasProvider reports whether the process registry can construct this provider kind.
func NewIdentity ¶
NewIdentity creates an identity through the process-wide registry.
func NewProvider ¶
NewProvider creates a provider through the process-wide registry.
func RegisterBatch ¶
func RegisterBatch(batch Registration) (func(), error)
RegisterBatch installs a package's constructors in the process-wide registry.
func RegisterEmulatorIdentities ¶
RegisterEmulatorIdentities registers all emulator-bound identity constructors with the registry. A single Identity type backs every emulator kind; the kind is carried on the config (set via the registry's ConfigSetter path after construction).
func RegisterGCPIdentities ¶
RegisterGCPIdentities registers all GCP identity constructors with the registry.
func RegisterGCPProviders ¶
RegisterGCPProviders registers all GCP provider constructors with the registry.
func RegisterIdentity ¶
func RegisterIdentity(kind string, constructor IdentityConfigConstructor) error
RegisterIdentity registers an identity in the process-wide auth registry.
func RegisterProvider ¶
func RegisterProvider(kind string, constructor ProviderConfigConstructor) error
RegisterProvider registers a provider in the process-wide auth registry.
Types ¶
type ConfigSetter ¶
ConfigSetter is an optional interface for identities that need access to the full config. Used by GCP identities to access Via.Provider for whoami reporting.
type IdentityConfigConstructor ¶
IdentityConfigConstructor receives the entire identity configuration.
type IdentityConstructor ¶
IdentityConstructor creates an identity from name and principal.
type ProviderConfigConstructor ¶
ProviderConfigConstructor receives the entire provider configuration.
type ProviderConstructor ¶
ProviderConstructor creates a provider from name and spec.
type Registration ¶
type Registration struct {
Providers map[string]ProviderConfigConstructor
Identities map[string]IdentityConfigConstructor
}
Registration groups constructors that must become visible atomically.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages provider and identity registration. Constructors run outside the lock.
func NewRegistry ¶
func NewRegistry() *Registry
NewRegistry creates a registry containing every built-in provider and identity.
func (*Registry) CreateIdentity ¶
func (f *Registry) CreateIdentity(kind, name string, principal map[string]any) (types.Identity, error)
CreateIdentity creates an identity using its principal.
func (*Registry) CreateProvider ¶
CreateProvider creates a provider using its spec.
func (*Registry) HasIdentity ¶
HasIdentity checks if an identity kind is registered.
func (*Registry) HasProvider ¶
HasProvider checks if a provider kind is registered.
func (*Registry) NewIdentity ¶
NewIdentity creates an identity without discarding its chain, session, or credentials.
func (*Registry) NewProvider ¶
NewProvider creates a provider without discarding legacy configuration fields.
func (*Registry) RegisterBatch ¶
func (f *Registry) RegisterBatch(batch Registration) (func(), error)
RegisterBatch validates every name before changing the registry. The returned cleanup removes only this batch and can safely be called more than once.
func (*Registry) RegisterIdentity ¶
func (f *Registry) RegisterIdentity(kind string, constructor IdentityConstructor) error
RegisterIdentity registers a principal-based constructor without replacing an existing kind.
func (*Registry) RegisterIdentityConfig ¶
func (f *Registry) RegisterIdentityConfig(kind string, constructor IdentityConfigConstructor) error
RegisterIdentityConfig registers a constructor with access to the entire configuration.
func (*Registry) RegisterProvider ¶
func (f *Registry) RegisterProvider(kind string, constructor ProviderConstructor) error
RegisterProvider registers a spec-based constructor without replacing an existing kind.
func (*Registry) RegisterProviderConfig ¶
func (f *Registry) RegisterProviderConfig(kind string, constructor ProviderConfigConstructor) error
RegisterProviderConfig registers a constructor with access to the entire configuration.