tokenmanager

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretTypeToken     = corev1.SecretType("github.as-code.io/token")
	SecretTypeBasicAuth = corev1.SecretType("github.as-code.io/basic-auth")
	BasicAuthUsername   = "x-access-token"
)

Variables

This section is empty.

Functions

func NewTokenSecret

func NewTokenSecret(key types.NamespacedName, owner TokenManager, controllerName string, options ...Option) *tokenSecret

Types

type Option

type Option func(*tokenSecret)

func WithAPIReader added in v1.6.0

func WithAPIReader(r client.Reader) Option

WithAPIReader supplies an uncached reader used to resolve extraData ConfigMap/Secret sources live on every reconcile, rather than starting a cluster-wide watch/cache for objects the operator otherwise never touches.

func WithClient added in v1.5.0

func WithClient(c client.Client) Option

func WithEventRecorder added in v1.6.0

func WithEventRecorder(r record.EventRecorder) Option

WithEventRecorder supplies the recorder used to surface non-fatal extraData issues (reserved/shadowed keys) as Warning events on the owner.

func WithGHApp

func WithGHApp(g ghait.GHAIT) Option

func WithLogger

func WithLogger(logger logr.Logger) Option

func WithMetrics added in v1.3.0

func WithMetrics(m *metrics.Recorder) Option

type TokenManager added in v1.5.0

type TokenManager interface {
	client.Object

	GetType() string
	GetAppRef() *githubv1.AppReference
	GetSecretBasicAuth() bool
	GetSecretDataSources() []githubv1.SecretDataSource
	GetInstallationID() int64
	GetRefreshInterval() time.Duration
	GetRetryInterval() time.Duration
	GetSecretNamespace() string
	GetSecretName() string
	GetSecretLabels() map[string]string
	GetSecretAnnotations() map[string]string
	GetInstallationTokenOptions() *github.InstallationTokenOptions
	GetManagedSecret() githubv1.ManagedSecret
	UpdateManagedSecret() (changed bool)
	GetStatusTimestamps() (createdAt, expiresAt time.Time)
	SetStatusTimestamps(expiresAt time.Time)
	GetStatusConditions() []metav1.Condition
	SetStatusCondition(condition metav1.Condition) (changed bool)
	RemoveStatusCondition(conditionType string) (changed bool)
}

TokenManager provides a common interface for both namespaced Tokens and ClusterTokens.

Jump to

Keyboard shortcuts

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