Documentation ¶
Index ¶
- Constants
- func CheckExpiry(claims map[string]interface{}, now time.Time) (float64, float64, error)
- func Fetch(opts *config.TokenOptions) ([]string, []error)
- func GetClaimsFromAccessTokenUnverified(accessTokenResponse zts.AccessTokenResponse) (map[string]interface{}, error)
- func NewTokenOptions(options *options.Options, ztsUrl string, userAgent string) (*config.TokenOptions, error)
- func ToBeRefreshed(opts *config.TokenOptions) ([]config.AccessToken, []error)
- func ToBeRefreshedBasedOnTime(opts *config.TokenOptions, currentTime time.Time) ([]config.AccessToken, []error)
- func TokenDirs(root string, tokens []config.AccessToken) []string
Constants ¶
View Source
const ( UserAgent = "User-Agent" TokenRefreshPeriodProp = "TOKEN_REFRESH_PERIOD" DefaultRefreshDuration = "1.5h" )
Variables ¶
This section is empty.
Functions ¶
func CheckExpiry ¶ added in v1.11.6
func GetClaimsFromAccessTokenUnverified ¶ added in v1.11.6
func GetClaimsFromAccessTokenUnverified(accessTokenResponse zts.AccessTokenResponse) (map[string]interface{}, error)
GetClaimsFromAccessTokenUnverified extract the token claims. The claims will not be verified (as the public key isn't provided)
func NewTokenOptions ¶ added in v1.11.3
func ToBeRefreshed ¶
func ToBeRefreshed(opts *config.TokenOptions) ([]config.AccessToken, []error)
ToBeRefreshed looks into /var/lib/sia/tokens folder and returns the list of tokens whose age is half of their validity
func ToBeRefreshedBasedOnTime ¶ added in v1.11.6
func ToBeRefreshedBasedOnTime(opts *config.TokenOptions, currentTime time.Time) ([]config.AccessToken, []error)
ToBeRefreshedBasedOnTime looks into /var/lib/sia/tokens folder and returns the list of tokens whose age is half of their validity (given the current time)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.