factory

package
v1.207.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIdentity

func NewIdentity(name string, config *schema.Identity) (types.Identity, error)

NewIdentity creates a new identity instance based on the identity configuration.

func NewProvider

func NewProvider(name string, config *schema.Provider) (types.Provider, error)

NewProvider creates a new provider instance based on the provider configuration.

func RegisterGCPIdentities added in v1.207.0

func RegisterGCPIdentities(f *Factory)

RegisterGCPIdentities registers all GCP identity constructors with the factory.

func RegisterGCPProviders added in v1.207.0

func RegisterGCPProviders(f *Factory)

RegisterGCPProviders registers all GCP provider constructors with the factory.

Types

type ConfigSetter added in v1.207.0

type ConfigSetter interface {
	SetConfig(config *schema.Identity)
}

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 Factory added in v1.207.0

type Factory struct {
	// contains filtered or unexported fields
}

Factory manages provider and identity registration.

func NewFactory added in v1.207.0

func NewFactory() *Factory

NewFactory creates a new auth factory with all providers and identities registered.

func (*Factory) CreateIdentity added in v1.207.0

func (f *Factory) CreateIdentity(kind, name string, principal map[string]any) (types.Identity, error)

CreateIdentity creates an identity instance from kind, name, and principal.

func (*Factory) CreateProvider added in v1.207.0

func (f *Factory) CreateProvider(kind, name string, spec map[string]any) (types.Provider, error)

CreateProvider creates a provider instance from kind, name, and spec.

func (*Factory) HasIdentity added in v1.207.0

func (f *Factory) HasIdentity(kind string) bool

HasIdentity checks if an identity kind is registered.

func (*Factory) HasProvider added in v1.207.0

func (f *Factory) HasProvider(kind string) bool

HasProvider checks if a provider kind is registered.

func (*Factory) RegisterIdentity added in v1.207.0

func (f *Factory) RegisterIdentity(kind string, constructor IdentityConstructor)

RegisterIdentity registers an identity constructor for a kind.

func (*Factory) RegisterProvider added in v1.207.0

func (f *Factory) RegisterProvider(kind string, constructor ProviderConstructor)

RegisterProvider registers a provider constructor for a kind.

type IdentityConstructor added in v1.207.0

type IdentityConstructor func(name string, principal map[string]any) (types.Identity, error)

IdentityConstructor creates an identity from name and principal.

type ProviderConstructor added in v1.207.0

type ProviderConstructor func(name string, spec map[string]any) (types.Provider, error)

ProviderConstructor creates a provider from name and spec.

Jump to

Keyboard shortcuts

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