gcpauth

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 8 Imported by: 19

Documentation

Overview

gcpauth holds the typed objects that define the schemas for default GCP auth of sources and channels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigMapName

func ConfigMapName() string

ConfigMapName returns the name of the configmap to read for default GCP auth settings.

func ToContext

func ToContext(ctx context.Context, c *Config) context.Context

ToContext attaches the provided Config to the provided context, returning the new context with the Config attached.

Types

type Config

type Config struct {
	GCPAuthDefaults *Defaults
}

Config holds the collection of configurations that we attach to contexts. +k8s:deepcopy-gen=false

func FromContext

func FromContext(ctx context.Context) *Config

FromContext extracts a Config from the provided context.

func FromContextOrDefaults

func FromContextOrDefaults(ctx context.Context) *Config

FromContextOrDefaults is like FromContext, but when no Config is attached it returns a Config populated with the defaults for each of the Config fields.

type Defaults

type Defaults struct {
	// NamespaceDefaults are the GCP auth defaults to use in specific namespaces. The namespace is
	// the key, the value is the defaults.
	NamespaceDefaults map[string]ScopedDefaults `json:"namespaceDefaults,omitempty"`
	// ClusterDefaults are the GCP auth defaults to use for all namepaces that are not in
	// NamespaceDefaults.
	ClusterDefaults ScopedDefaults `json:"clusterDefaults,omitempty"`
}

Defaults includes the default values to be populated by the Webhook.

func NewDefaultsConfigFromConfigMap

func NewDefaultsConfigFromConfigMap(config *corev1.ConfigMap) (*Defaults, error)

NewDefaultsConfigFromConfigMap creates a Defaults from the supplied configMap.

func NewDefaultsConfigFromMap

func NewDefaultsConfigFromMap(data map[string]string) (*Defaults, error)

NewDefaultsConfigFromMap creates a Defaults from the supplied Map.

func (*Defaults) DeepCopy

func (in *Defaults) DeepCopy() *Defaults

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Defaults.

func (*Defaults) DeepCopyInto

func (in *Defaults) DeepCopyInto(out *Defaults)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Defaults) KSA

func (d *Defaults) KSA(ns string) string

func (*Defaults) Secret

func (d *Defaults) Secret(ns string) *corev1.SecretKeySelector

func (*Defaults) WorkloadIdentityGSA

func (d *Defaults) WorkloadIdentityGSA(ns, ksa string) string

type ScopedDefaults

type ScopedDefaults struct {
	// ServiceAccountName is the Kubernetes Service Account to user for all data plane pieces. This
	// is expected to be used for Workload Identity workloads.
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// Secret is the secret to default to, if one is not already in the CO's spec.
	Secret *corev1.SecretKeySelector `json:"secret,omitempty"`

	// WorkloadIdentityMapping is a mapping from Kubernetes Service Account to Google IAM Service
	// Account. If a GCP authable's spec.ServiceAccountName is in this map, then the controller will
	// attempt to setup Workload Identity between the two accounts. If it is unable to do so, then
	// the CO will not become ready.
	WorkloadIdentityMapping map[string]string `json:"workloadIdentityMapping,omitEmpty"`
}

ScopedDefaults are the GCP auth defaults.

func (*ScopedDefaults) DeepCopy

func (in *ScopedDefaults) DeepCopy() *ScopedDefaults

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScopedDefaults.

func (*ScopedDefaults) DeepCopyInto

func (in *ScopedDefaults) DeepCopyInto(out *ScopedDefaults)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Store

type Store struct {
	*configmap.UntypedStore
}

Store is a typed wrapper around configmap.Untyped store to handle our ConfigMaps. +k8s:deepcopy-gen=false

func NewStore

func NewStore(logger configmap.Logger, onAfterStore ...func(name string, value interface{})) *Store

NewStore creates a new store of Configs and optionally calls functions when ConfigMaps are updated.

func (*Store) Load

func (s *Store) Load() *Config

Load creates a Config from the current config state of the Store.

func (*Store) ToContext

func (s *Store) ToContext(ctx context.Context) context.Context

ToContext attaches the current Config state to the provided context.

type StoreSingleton

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

+k8s:deepcopy-gen=false

func (*StoreSingleton) Store

func (s *StoreSingleton) Store(ctx context.Context, cmw configmap.Watcher) *Store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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