token

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 9 Imported by: 1 module, 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RefreshJob

type RefreshJob struct {
	SecretNamespace string
	SecretName      string
	RepositoryURL   string
	NextRefresh     time.Time
	Timer           *time.Timer
	Cancel          context.CancelFunc
}

RefreshJob represents a scheduled token refresh

type RefreshManager

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

RefreshManager manages token refresh operations

func NewRefreshManager

func NewRefreshManager(
	client client.Client,
	githubClient github.GitHubClient,
	secretManager *kubernetes.SecretManager,
	refreshInterval time.Duration,
	logger logr.Logger,
) *RefreshManager

NewRefreshManager creates a new token refresh manager

func (*RefreshManager) CancelRefresh

func (rm *RefreshManager) CancelRefresh(namespace, name string)

CancelRefresh cancels a scheduled token refresh

func (*RefreshManager) CheckAndRefreshExpiredTokens

func (rm *RefreshManager) CheckAndRefreshExpiredTokens(ctx context.Context) error

CheckAndRefreshExpiredTokens checks all managed secrets and refreshes expired tokens

func (*RefreshManager) ScheduleRefresh

func (rm *RefreshManager) ScheduleRefresh(ctx context.Context, namespace, name, repositoryURL string) error

ScheduleRefresh schedules a token refresh for the given secret

func (*RefreshManager) Start

func (rm *RefreshManager) Start(ctx context.Context) error

Start starts the refresh manager background processes

func (*RefreshManager) Stop

func (rm *RefreshManager) Stop()

Stop stops the refresh manager and cancels all scheduled refreshes

type RefreshManagerInterface

type RefreshManagerInterface interface {
	ScheduleRefresh(ctx context.Context, namespace, name, repositoryURL string) error
	CancelRefresh(namespace, name string)
	Start(ctx context.Context) error
	Stop()
}

RefreshManager interface defines the methods needed for token refresh operations

Jump to

Keyboard shortcuts

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