Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyExpiresAt ¶
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 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 New(c *config.GitProxyConfig) *TokenStore
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.
Click to show internal directories.
Click to hide internal directories.