oidcclientsecretstorage

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeLabelValue = "oidc-client-secret"

	ErrOIDCClientSecretStorageVersion = constable.Error("OIDC client secret storage data has wrong version")
)

Variables

This section is empty.

Functions

func ReadFromSecret

func ReadFromSecret(secret *corev1.Secret) ([]string, error)

ReadFromSecret reads the contents of a Secret as a storedClientSecret and returns the associated hashes.

Types

type OIDCClientSecretStorage

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

func (*OIDCClientSecretStorage) Get

func (s *OIDCClientSecretStorage) Get(ctx context.Context, oidcClientUID types.UID) (string, []string, error)

Get returns the resourceVersion of the storage secret, the hashes within the secret, and an error. When the storage secret is not found, it will simply return "", nil, nil to make it easy to pass the results of Get directly to Set.

func (*OIDCClientSecretStorage) GetName

func (s *OIDCClientSecretStorage) GetName(oidcClientUID types.UID) string

GetName returns the name of the Secret which would be used to store data for the given signature.

func (*OIDCClientSecretStorage) GetStorageSecret

func (s *OIDCClientSecretStorage) GetStorageSecret(ctx context.Context, oidcClientUID types.UID) (*corev1.Secret, error)

GetStorageSecret gets the corev1.Secret which is used to store the client secrets for the given client. Returns nil,nil when the corev1.Secret was not found, as this is not an error for a client to not have any secrets yet.

func (*OIDCClientSecretStorage) Set

func (s *OIDCClientSecretStorage) Set(ctx context.Context, resourceVersion, oidcClientName string, oidcClientUID types.UID, secretHashes []string) error

Set will create or update the values of the storage secret associated with an OIDCClient. Set takes the resourceVersion to know if we are doing a create or update and to ensure we do not edit an old version of the storage secret. Set takes the oidcClientName to set up the owner reference of the storage secret to that of the OIDCClient. Set takes the oidcClientUID to find the correct storage secret.

Jump to

Keyboard shortcuts

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