factory

package
v1.206.3-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 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

func RegisterGCPIdentities(f *Factory)

RegisterGCPIdentities registers all GCP identity constructors with the factory.

func RegisterGCPProviders

func RegisterGCPProviders(f *Factory)

RegisterGCPProviders registers all GCP provider constructors with the factory.

Types

type ConfigSetter

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

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

Factory manages provider and identity registration.

func NewFactory

func NewFactory() *Factory

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

func (*Factory) CreateIdentity

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

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

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

HasIdentity checks if an identity kind is registered.

func (*Factory) HasProvider

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

HasProvider checks if a provider kind is registered.

func (*Factory) RegisterIdentity

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

RegisterIdentity registers an identity constructor for a kind.

func (*Factory) RegisterProvider

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

RegisterProvider registers a provider constructor for a kind.

type IdentityConstructor

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

IdentityConstructor creates an identity from name and principal.

type ProviderConstructor

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