tokenstore

package
v0.0.0-...-ba2b178 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyExpiresAt

func VerifyExpiresAt(claims jwt.RegisteredClaims, leeway time.Duration) (bool, error)

VerifyExpiresAt implements the same logic as can be found in jwt v4 but in the style of v5.

Main difference is that the exp nil check is hard coded to false.

v4 implementation boils down to comparing the value passed to the expiration time. v5 changed that: "now" is compared to the expiration time with leeway added.

Types

type TokenSet

type TokenSet struct {
	AccessToken string
	ExpiresAt   int64
}

type TokenStore

type TokenStore struct {
	// The git proxy config
	Config *config.GitProxyConfig
	// The git providers
	Providers map[string]config.GitProvider
	// Period used to refresh renku tokens
	RefreshTickerPeriod time.Duration
	// Safety margin for when to consider a token expired. For example if this is set to
	// 30 seconds then the token is considered expired if it expires in the next 30 seconds.
	ExpirationLeeway time.Duration
	// contains filtered or unexported fields
}

func New

func (*TokenStore) GetGitAccessToken

func (s *TokenStore) GetGitAccessToken(provider string, encode bool) (string, error)

Returns a valid access token for the corresponding git provider. If the token is expired, a new one will be retrieved using the renku access token.

Jump to

Keyboard shortcuts

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