dex

package
v0.0.0-...-51508ad Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new DexConfiguration Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.

Types

type Certificate

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

Certificate struct

func NewCertificate

func NewCertificate(instance *kubicv1beta1.DexConfiguration, reconciler *ReconcileDexConfiguration) (*Certificate, error)

NewCertificate returns a new *dex.Certificate struct

func (Certificate) AsSecretReference

func (cert Certificate) AsSecretReference() corev1.SecretReference

AsSecretReference returns a SecretReference

func (*Certificate) CreateOrUpdate

func (cert *Certificate) CreateOrUpdate(deployment *Deployment) error

CreateOrUpdate creates the Service in the apiserver, or updates an existing instance

func (*Certificate) Delete

func (cert *Certificate) Delete() error

Delete delete the cert

func (*Certificate) GetFrom

func (cert *Certificate) GetFrom(instance *kubicv1beta1.DexConfiguration) error

GetFrom obtains the existing cert from the GeneratedCertificate specified in the instance.Status or instance.Spec

func (Certificate) GetHashRequested

func (cert Certificate) GetHashRequested() string

GetHashRequested get the requested hash

func (Certificate) GetName

func (cert Certificate) GetName() string

GetName returns the cert name takes the form of [DefaultPrefix]-auto-cert

func (Certificate) GetNamespace

func (cert Certificate) GetNamespace() string

GetNamespace returns the namespace as a string

func (*Certificate) GetObject

func (cert *Certificate) GetObject() metav1.Object

GetObject returns the metav1.Object of the generated cert

func (Certificate) String

func (cert Certificate) String() string

String returns the namespacedObj of the cert as a string

func (Certificate) WasGenerated

func (cert Certificate) WasGenerated() bool

WasGenerated checks if the cert was generated

type ConfigMap

type ConfigMap struct {
	FileName string
	// contains filtered or unexported fields
}

ConfigMap struct

func NewDexConfigMapFor

func NewDexConfigMapFor(instance *kubicv1beta1.DexConfiguration, reconciler *ReconcileDexConfiguration) (*ConfigMap, error)

NewDexConfigMapFor returns a new dex.ConfigMap

func (*ConfigMap) CreateLocal

func (config *ConfigMap) CreateLocal(connectors []kubicv1beta1.LDAPConnector,
	staticClientsPasswords StaticClientsPasswords) error

CreateLocal generates a local ConfigMap instance. Note well that this instance is not published to the apiserver: users must use `CreateOrUpdate()` for doing that.

func (*ConfigMap) CreateOrUpdate

func (config *ConfigMap) CreateOrUpdate() error

CreateOrUpdate creates the ConfigMap in the apiserver, or updates an existing instance

func (*ConfigMap) Delete

func (config *ConfigMap) Delete() error

Delete removes the current ConfigMap

func (*ConfigMap) GetFrom

func (config *ConfigMap) GetFrom(instance *kubicv1beta1.DexConfiguration) error

GetFrom obtains the current configmap fromm the ConfigMap specified in the instance.Status

func (ConfigMap) GetHashGenerated

func (config ConfigMap) GetHashGenerated() string

GetHashGenerated returns the hash of the generated config map

func (ConfigMap) GetName

func (config ConfigMap) GetName() string

GetName returns the config name

func (ConfigMap) GetNamespace

func (config ConfigMap) GetNamespace() string

GetNamespace returns the default namespace

func (*ConfigMap) GetObject

func (config *ConfigMap) GetObject() metav1.Object

GetObject returns the metav1.Object generated for the dex.ConfigMap

func (ConfigMap) NeedsCreateOrUpdate

func (config ConfigMap) NeedsCreateOrUpdate() bool

NeedsCreateOrUpdate returns true if the ConfigMap is not in the cluster or it needs to be updated CreateLocal() must have been previously

func (ConfigMap) String

func (config ConfigMap) String() string

String returns the namespaceObj as a string

type Deployment

type Deployment struct {
	DexCfg *kubicv1beta1.DexConfiguration
	// contains filtered or unexported fields
}

Deployment struct

func NewDeploymentFor

func NewDeploymentFor(instance *kubicv1beta1.DexConfiguration, reconciler *ReconcileDexConfiguration) (*Deployment, error)

NewDeploymentFor returns a new Deployment struct for the configuration

func (*Deployment) CreateLocal

func (deploy *Deployment) CreateLocal(configMap *ConfigMap, cert *Certificate) error

CreateLocal generates a local Deployment instance. Note well that this instance is not published to the apiserver: users must use `CreateOrUpdate()` for doing that.

func (*Deployment) CreateOrUpdate

func (deploy *Deployment) CreateOrUpdate() error

CreateOrUpdate creates or updates the deployment

func (*Deployment) Delete

func (deploy *Deployment) Delete() error

Delete removes the current deployment as well as all the other resources created It will ignore IsNotFound errors.

func (*Deployment) GetFrom

func (deploy *Deployment) GetFrom(instance *kubicv1beta1.DexConfiguration) error

GetFrom obtains the current deployment fromm the Deployment specified in the instance.Status

func (Deployment) GetName

func (deploy Deployment) GetName() string

GetName returns the name of the dex config

func (Deployment) GetNamespace

func (deploy Deployment) GetNamespace() string

GetNamespace returns the default dex Namespace

func (Deployment) GetObject

func (deploy Deployment) GetObject() metav1.Object

GetObject returns the generated metav1.Object

func (*Deployment) IsRunning

func (deploy *Deployment) IsRunning() bool

IsRunning returns true if the Deployment is not in the cluster or it needs to be updated

func (Deployment) NeedsCreateOrUpdate

func (deploy Deployment) NeedsCreateOrUpdate() bool

NeedsCreateOrUpdate returns true if the Deployment is not in the cluster or it needs to be updated CreateLocal() must have been previously

func (Deployment) String

func (deploy Deployment) String() string

String returns the Namespace object as a string

type ObjectVisitor

type ObjectVisitor interface {
	GetObject() metav1.Object
}

ObjectVisitor interface

type ReconcileDexConfiguration

type ReconcileDexConfiguration struct {
	client.Client
	Clientset clientset.Interface
	record.EventRecorder
	// contains filtered or unexported fields
}

ReconcileDexConfiguration reconciles a DexConfiguration object

func (*ReconcileDexConfiguration) Reconcile

Reconcile reads that state of the cluster for a DexConfiguration object and makes changes based on the state read and what is in the DexConfiguration.Spec

Automatically generate RBAC rules to allow the Controller to read and write Deployments +kubebuilder:rbac:groups=core,resources=configmaps;secrets;serviceaccounts;services,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=core,resources=events,verbs=create;update;patch +kubebuilder:rbac:groups=networking.k8s.io,resources=networkpolicies,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=roles;rolebindings,verbs=get;list;watch;create;update;patch;delete;deletecollection +kubebuilder:rbac:groups=certificates.k8s.io,resources=certificatesigningrequests,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=certificates.k8s.io,resources=certificatesigningrequests/approval;certificatesigningrequests/status,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=kubic.opensuse.org,resources=dexconfigurations;ldapconnectors,verbs=get;list;watch;create;update;patch;delete

type StaticClientsPasswords

type StaticClientsPasswords struct {
	Passwords map[string]crypto.SharedPassword
	Prefix    string
	Namespace string
}

StaticClientsPasswords is a groups of static, shared passwords that can be saved to k8s Secrets.

func NewStaticClientsPasswords

func NewStaticClientsPasswords(prefix string, namespace string) (StaticClientsPasswords, error)

NewStaticClientsPasswords creates all the shared passwords it tries to load those passwords from Secrets in the apiserver if they are not found, new random passwords are generated, but not persisted in the apiserver

func (StaticClientsPasswords) CreateOrUpdateToSecrets

func (scp StaticClientsPasswords) CreateOrUpdateToSecrets(cli clientset.Interface) error

CreateOrUpdateToSecrets publishes all the shared passwords as Secrets in the apiserver

func (*StaticClientsPasswords) GetOrRandomFromSecrets

func (scp *StaticClientsPasswords) GetOrRandomFromSecrets(cli clientset.Interface, names []string) error

GetOrRandomFromSecrets tries to get the passwords from Secrets or generate random values

Jump to

Keyboard shortcuts

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