hooks

package
v1.77.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 53 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// DexProviderCheckPhasePending is written the moment the hook picks a check
	// up, before the (potentially slow) connectivity probes run. It lets the
	// console distinguish "the operator created a check and the controller has
	// acknowledged it, work is in progress" from "nothing has touched it yet".
	DexProviderCheckPhasePending   = DexProviderCheckPhase("Pending")
	DexProviderCheckPhaseSucceeded = DexProviderCheckPhase("Succeeded")
	DexProviderCheckPhaseFailed    = DexProviderCheckPhase("Failed")
)
View Source
const (
	PasswordPolicyLockout = DexUserLockReason("PasswordPolicyLockout")
	LockedByAdministrator = DexUserLockReason("LockedByAdministrator")
)
View Source
const (
	UserOperationTypeResetPass = UserOperationSpecType("ResetPassword")
	UserOperationTypeReset2FA  = UserOperationSpecType("Reset2FA")
	UserOperationTypeLock      = UserOperationSpecType("Lock")
	UserOperationTypeUnlock    = UserOperationSpecType("Unlock")
)
View Source
const (
	UserOperationStatusPhaseSucceeded = UserOperationStatusPhase("Succeeded")
	UserOperationStatusPhaseFailed    = UserOperationStatusPhase("Failed")
)
View Source
const (
	PasswordAnnotationLockedByAdministrator = "deckhouse.io/locked-by-administrator"
)

Variables

This section is empty.

Functions

func SafeDNS1123Name added in v1.73.0

func SafeDNS1123Name(fullOriginalName string) (string, bool, string)

SafeDNS1123Name normalizes and truncates name to DNS-1123 and length <=63. If truncation happens, "-<hash5>" is appended, where hash5 is first 5 hex of sha256(original).

Types

type Credentials

type Credentials struct {
	CookieSecret string `json:"cookieSecret"`
	AppDexSecret string `json:"appDexSecret"`
}

type DexAuthenticator

type DexAuthenticator struct {
	ID          string                 `json:"uuid"`
	EncodedName string                 `json:"encodedName"`
	Name        string                 `json:"name"`
	Namespace   string                 `json:"namespace"`
	Spec        map[string]interface{} `json:"spec"`

	AllowAccessToKubernetes bool        `json:"allowAccessToKubernetes"`
	Credentials             Credentials `json:"credentials"`

	// AllowAccessToKubernetesAnnotation carries the raw annotation value from the filter,
	// which has no logger, to the hook body, which does. It is nil when the annotation is
	// absent, and json:"-" keeps it out of the internal values the templates read.
	AllowAccessToKubernetesAnnotation *string `json:"-"`
}

type DexAuthenticatorSecret

type DexAuthenticatorSecret struct {
	ID          string      `json:"uuid"`
	Name        string      `json:"name"`
	Namespace   string      `json:"namespace"`
	Credentials Credentials `json:"credentials"`
}

type DexCA

type DexCA struct {
	Name string `json:"name"`
	Data []byte `json:"data"`
}

type DexClient

type DexClient struct {
	ID        string `json:"id"`
	EncodedID string `json:"encodedID"`

	Name      string                 `json:"name"`
	Namespace string                 `json:"namespace"`
	Spec      map[string]interface{} `json:"spec"`

	Secret string `json:"clientSecret"`

	// LegacyID and LegacyEncodedID is formatted with a colons delimiter which is impossible to use as a
	//   basic auth credentials part
	LegacyID        string `json:"legacyID"`
	LegacyEncodedID string `json:"legacyEncodedID"`

	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`

	AllowAccessToKubernetes bool `json:"allowAccessToKubernetes"`

	// AllowAccessToKubernetesAnnotation carries the raw annotation value from the filter,
	// which has no logger, to the hook body, which does. It is nil when the annotation is
	// absent, and json:"-" keeps it out of the internal values the templates read.
	AllowAccessToKubernetesAnnotation *string `json:"-"`
}

type DexClientSecret

type DexClientSecret struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Secret    []byte `json:"spec"`
}

type DexGroup added in v1.48.0

type DexGroup struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              DexGroupSpec   `json:"spec"`
	Status            DexGroupStatus `json:"status,omitempty"`
}

type DexGroupMember added in v1.48.0

type DexGroupMember struct {
	Kind string `json:"kind" yaml:"kind"`
	Name string `json:"name" yaml:"name"`
}

type DexGroupSpec added in v1.48.0

type DexGroupSpec struct {
	Name    string           `json:"name"`
	Members []DexGroupMember `json:"members" yaml:"members"`
}

type DexGroupStatus added in v1.48.0

type DexGroupStatus struct {
	Errors []struct {
		Message   string `json:"message"`
		ObjectRef struct {
			Kind string `json:"kind"`
			Name string `json:"name"`
		} `json:"objectRef"`
	} `json:"errors,omitempty"`
}

type DexProvider

type DexProvider map[string]interface{}

type DexProviderBitbucketForCheck added in v1.77.0

type DexProviderBitbucketForCheck struct {
	ClientID     string `json:"clientID"`
	ClientSecret string `json:"clientSecret,omitempty"`
}

type DexProviderCheck added in v1.77.0

type DexProviderCheck struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              DexProviderCheckSpec   `json:"spec"`
	Status            DexProviderCheckStatus `json:"status"`
}

type DexProviderCheckPhase added in v1.77.0

type DexProviderCheckPhase string

type DexProviderCheckSpec added in v1.77.0

type DexProviderCheckSpec struct {
	ProviderName  string `json:"providerName"`
	InitiatorType string `json:"initiatorType,omitempty"`
}

type DexProviderCheckStatus added in v1.77.0

type DexProviderCheckStatus struct {
	Phase                         DexProviderCheckPhase        `json:"phase"`
	Message                       string                       `json:"message,omitempty"`
	ObservedDexProviderGeneration int64                        `json:"observedDexProviderGeneration,omitempty"`
	Checks                        []DexProviderCheckStepStatus `json:"checks,omitempty"`
	CompletedAt                   *metav1.Time                 `json:"completedAt,omitempty"`
}

type DexProviderCheckStepStatus added in v1.77.0

type DexProviderCheckStepStatus struct {
	Name    string `json:"name"`
	Status  string `json:"status"`
	Message string `json:"message,omitempty"`
}

type DexProviderCrowdForCheck added in v1.77.0

type DexProviderCrowdForCheck struct {
	BaseURL      string `json:"baseURL"`
	ClientID     string `json:"clientID"`
	ClientSecret string `json:"clientSecret"`
}

type DexProviderForCheck added in v1.77.0

type DexProviderForCheck struct {
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              DexProviderForCheckSpec `json:"spec"`
}

type DexProviderForCheckSpec added in v1.77.0

type DexProviderForCheckSpec struct {
	Enabled        *bool                         `json:"enabled,omitempty"`
	Type           string                        `json:"type"`
	Github         *DexProviderGithubForCheck    `json:"github,omitempty"`
	Gitlab         *DexProviderGitlabForCheck    `json:"gitlab,omitempty"`
	BitbucketCloud *DexProviderBitbucketForCheck `json:"bitbucketCloud,omitempty"`
	Crowd          *DexProviderCrowdForCheck     `json:"crowd,omitempty"`
	OIDC           *DexProviderOIDCForCheck      `json:"oidc,omitempty"`
	LDAP           *DexProviderLDAPForCheck      `json:"ldap,omitempty"`
	SAML           *DexProviderSAMLForCheck      `json:"saml,omitempty"`
}

type DexProviderGithubForCheck added in v1.77.0

type DexProviderGithubForCheck struct {
	ClientID     string `json:"clientID"`
	ClientSecret string `json:"clientSecret,omitempty"`
}

type DexProviderGitlabForCheck added in v1.77.0

type DexProviderGitlabForCheck struct {
	ClientID     string `json:"clientID,omitempty"`
	ClientSecret string `json:"clientSecret,omitempty"`
	BaseURL      string `json:"baseURL,omitempty"`
	RootCAData   string `json:"rootCAData,omitempty"`
}

type DexProviderLDAPForCheck added in v1.77.0

type DexProviderLDAPForCheck struct {
	Host               string                           `json:"host"`
	InsecureNoSSL      bool                             `json:"insecureNoSSL,omitempty"`
	StartTLS           bool                             `json:"startTLS,omitempty"`
	RootCAData         string                           `json:"rootCAData,omitempty"`
	InsecureSkipVerify bool                             `json:"insecureSkipVerify,omitempty"`
	BindDN             string                           `json:"bindDN,omitempty"`
	BindPW             string                           `json:"bindPW,omitempty"`
	Kerberos           *DexProviderLDAPKerberosForCheck `json:"kerberos,omitempty"`
}

type DexProviderLDAPKerberosForCheck added in v1.77.0

type DexProviderLDAPKerberosForCheck struct {
	Enabled          bool   `json:"enabled,omitempty"`
	KeytabSecretName string `json:"keytabSecretName,omitempty"`
}

type DexProviderOIDCForCheck added in v1.77.0

type DexProviderOIDCForCheck struct {
	ClientID           string `json:"clientID,omitempty"`
	ClientSecret       string `json:"clientSecret,omitempty"`
	Issuer             string `json:"issuer"`
	RootCAData         string `json:"rootCAData,omitempty"`
	InsecureSkipVerify bool   `json:"insecureSkipVerify,omitempty"`
}

type DexProviderSAMLForCheck added in v1.77.0

type DexProviderSAMLForCheck struct {
	SSOURL     string `json:"ssoURL"`
	RootCAData string `json:"rootCAData,omitempty"`
}

type DexUser

type DexUser struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              DexUserSpec   `json:"spec"`
	Status            DexUserStatus `json:"status,omitempty"`
}

type DexUserExpire

type DexUserExpire struct {
	Name     string    `json:"name"`
	ExpireAt time.Time `json:"expireAt"`

	CheckExpire bool `json:"-"`
}

type DexUserInternalValues added in v1.48.0

type DexUserInternalValues struct {
	Name        string `json:"name"`
	EncodedName string `json:"encodedName"`

	Spec   DexUserSpec   `json:"spec"`
	Status DexUserStatus `json:"status,omitempty"`

	ExpireAt string `json:"-"`
}

type DexUserLock added in v1.72.1

type DexUserLock struct {
	State   bool               `json:"state"`
	Reason  *DexUserLockReason `json:"reason,omitempty"`
	Message *string            `json:"message,omitempty"`
	Until   *string            `json:"until,omitempty"`
}

type DexUserLockReason added in v1.72.1

type DexUserLockReason string

type DexUserSpec added in v1.48.0

type DexUserSpec struct {
	Email    string   `json:"email"`
	Password string   `json:"password"`
	UserID   string   `json:"userID,omitempty"`
	Groups   []string `json:"groups,omitempty"`
	TTL      string   `json:"ttl,omitempty"`
}

type DexUserStatus added in v1.48.0

type DexUserStatus struct {
	ExpireAt string      `json:"expireAt,omitempty"`
	Lock     DexUserLock `json:"lock"`
}

type KubernetesSecret

type KubernetesSecret []byte

type KubernetesServicePort

type KubernetesServicePort intstr.IntOrString

type OfflineSessionSnapshot added in v1.75.0

type OfflineSessionSnapshot struct {
	Name            string       `json:"name"`
	Namespace       string       `json:"namespace"`
	UserID          string       `json:"userID"`
	ConnID          string       `json:"connID,omitempty"`
	Email           string       `json:"email,omitempty"`
	LockedUntil     *metav1.Time `json:"lockedUntil,omitempty"`
	RefreshTokenIDs []string     `json:"refreshTokenIDs,omitempty"`
}

OfflineSessionSnapshot is a minimal representation of Dex OfflineSessions object used by this hook. We intentionally keep it flexible: different Dex versions/storages may store user identity differently, and OfflineSessions may not have userID at all but contain refresh token references.

type Password added in v1.72.1

type Password struct {
	metav1.TypeMeta                 `json:",inline"`
	metav1.ObjectMeta               `json:"metadata,omitempty"`
	Username                        string     `json:"username"`
	Email                           string     `json:"email"`
	UserID                          string     `json:"userID"`
	Hash                            string     `json:"hash"`
	HashUpdatedAt                   string     `json:"hashUpdatedAt,omitempty"`
	PreviousHashes                  []string   `json:"previousHashes,omitempty"`
	IncorrectPasswordLoginAttempts  int        `json:"incorrectPasswordLoginAttempts,omitempty"`
	Groups                          []string   `json:"groups,omitempty"`
	RequireResetHashOnNextSuccLogin bool       `json:"requireResetHashOnNextSuccLogin"`
	LockedUntil                     *time.Time `json:"lockedUntil"`
}

type PublishAPICert

type PublishAPICert struct {
	Name string `json:"name"`
	Data []byte `json:"data"`
}

type PublishAPIConfig added in v1.77.0

type PublishAPIConfig struct {
	Name                        string `json:"name"`
	AddKubeconfigGeneratorEntry []byte `json:"addKubeconfigGeneratorEntry"`
	WhitelistSourceRanges       []byte `json:"whitelistSourceRanges"`
	HTTPSMode                   []byte `json:"httpsMode"`
	IngressClass                []byte `json:"ingressClass"`
}

type RefreshTokenSnapshot added in v1.75.0

type RefreshTokenSnapshot struct {
	Name            string `json:"name"`
	Namespace       string `json:"namespace"`
	ClaimsUserID    string `json:"claimsUserID,omitempty"`
	ClaimsUsername  string `json:"claimsUsername,omitempty"`
	ClaimsPreferred string `json:"claimsPreferredUsername,omitempty"`
}

RefreshTokenSnapshot is a minimal representation of Dex RefreshToken object used by this hook.

type UserOperation added in v1.75.0

type UserOperation struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              UserOperationSpec   `json:"spec"`
	Status            UserOperationStatus `json:"status"`

	// FilterError carries the error produced by applyUserOperationFilter when
	// the raw object could not be decoded into this struct. It is NOT part of
	// the CRD: it travels only inside the hook snapshot (hence a plain json tag
	// so it survives the snapshot round-trip) so getUserOperations can mark this
	// specific object Failed with the exact reason instead of silently dropping
	// it — all without the FilterFunc ever returning an error and locking the
	// queue. It never reaches the API: status patches send only the status field.
	FilterError string `json:"filterError,omitempty"`
}

type UserOperationLockSpec added in v1.75.0

type UserOperationLockSpec struct {
	// For is either a Go-style duration string accepted by time.ParseDuration
	// (e.g. "30m", "1h", "2h30m"), or the sentinel userOperationLockForever
	// ("permanent") for an indefinite lock. We use a plain string rather than
	// metav1.Duration so the sentinel can travel through (un)marshalling
	// without colliding with time.ParseDuration's grammar.
	For string `json:"for"`
}

type UserOperationResetPasswordSpec added in v1.75.0

type UserOperationResetPasswordSpec struct {
	NewPasswordHash string `json:"newPasswordHash"`
}

type UserOperationSpec added in v1.75.0

type UserOperationSpec struct {
	User          string                `json:"user,omitempty"`
	Target        *UserOperationTarget  `json:"target,omitempty"`
	Type          UserOperationSpecType `json:"type"`
	InitiatorType string                `json:"initiatorType"`

	ResetPassword *UserOperationResetPasswordSpec `json:"resetPassword,omitempty"`
	Lock          *UserOperationLockSpec          `json:"lock,omitempty"`
}

type UserOperationSpecType added in v1.75.0

type UserOperationSpecType string

type UserOperationStatus added in v1.75.0

type UserOperationStatus struct {
	Phase       UserOperationStatusPhase `json:"phase"`
	Message     string                   `json:"message,omitempty"`
	CompletedAt *metav1.Time             `json:"completedAt"`
}

type UserOperationStatusPhase added in v1.75.0

type UserOperationStatusPhase string

type UserOperationTarget added in v1.77.0

type UserOperationTarget struct {
	ConnectorID string `json:"connectorID"`
	Email       string `json:"email"`
}

UserOperationTarget identifies an external (non-local) user managed by an authentication provider such as LDAP or Atlassian Crowd. It is mutually exclusive with UserOperationSpec.User and is used by the Lock / Unlock operations against the OfflineSessions object that holds the failed-attempt counter and the lock state for the corresponding (connectorID, email) pair.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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