apikey

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const APIKeyLength = 32 // 256-bit key
View Source
const (
	DefaultExpirationSeconds = int64(12 * 60 * 60) // default is 12 hours
)

Variables

This section is empty.

Functions

func GenerateAPIKey

func GenerateAPIKey() (string, error)

GenerateAPIKey generates a cryptographically secure random API key.

func NewReconciler

func NewReconciler(client client.Client, options ...utils.ReconcilerOption[*v1alpha1.APIKey]) *utils.Reconciler[*v1alpha1.APIKey]

func WithDefaultReconcilers

func WithDefaultReconcilers() utils.ReconcilerOption[*v1alpha1.APIKey]

WithDefaultReconcilers returns a reconciler option which enables the default sub-reconcilers.

func WithDeleteReconciler

func WithDeleteReconciler() utils.ReconcilerOption[*v1alpha1.APIKey]

func WithStatusReconciler

func WithStatusReconciler() utils.ReconcilerOption[*v1alpha1.APIKey]

Types

type DeleteReconciler

type DeleteReconciler struct {
	utils.DefaultSubReconciler
}

DeleteReconciler is responsible for deleting the APIKey when it is expired.

func NewDeleteReconciler

func NewDeleteReconciler(client client.Client) *DeleteReconciler

NewDeleteReconciler creates a new sub-reconciler instance. The reconciler is initialized with the given client.

func (*DeleteReconciler) Reconcile

func (r *DeleteReconciler) Reconcile(ctx context.Context, apiKey *v1alpha1.APIKey) (ctrl.Result, error)

Reconcile is the main reconciler function.

type StatusReconciler

type StatusReconciler struct {
	utils.DefaultSubReconciler
}

StatusReconciler is responsible for reconciling the status of the APIKey resource.

func NewStatusReconciler

func NewStatusReconciler(client client.Client) *StatusReconciler

NewStatusReconciler creates a new sub-reconciler instance. The reconciler is initialized with the given client.

func (*StatusReconciler) Reconcile

func (r *StatusReconciler) Reconcile(ctx context.Context, apiKey *v1alpha1.APIKey) (ctrl.Result, error)

Reconcile is the main reconciler function.

Jump to

Keyboard shortcuts

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