Documentation ¶
Index ¶
- Constants
- func ReadFromSecret(secret *corev1.Secret) ([]string, error)
- type OIDCClientSecretStorage
- func (s *OIDCClientSecretStorage) Get(ctx context.Context, oidcClientUID types.UID) (string, []string, error)
- func (s *OIDCClientSecretStorage) GetName(oidcClientUID types.UID) string
- func (s *OIDCClientSecretStorage) GetStorageSecret(ctx context.Context, oidcClientUID types.UID) (*corev1.Secret, error)
- func (s *OIDCClientSecretStorage) Set(ctx context.Context, resourceVersion, oidcClientName string, ...) error
Constants ¶
const ( TypeLabelValue = "oidc-client-secret" ErrOIDCClientSecretStorageVersion = constable.Error("OIDC client secret storage data has wrong version") )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type OIDCClientSecretStorage ¶
type OIDCClientSecretStorage struct {
// contains filtered or unexported fields
}
func New ¶
func New(secrets corev1client.SecretInterface) *OIDCClientSecretStorage
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.