tokens

package
v1.12.3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

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 CheckExpiry(claims map[string]interface{}, now time.Time) (float64, float64, error)

func Fetch

func Fetch(opts *config.TokenOptions) ([]string, []error)

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 NewTokenOptions(options *options.Options, ztsUrl string, userAgent string) (*config.TokenOptions, error)

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)

func TokenDirs

func TokenDirs(root string, tokens []config.AccessToken) []string

TokenDirs returns an array of token folders with domain in them

Types

This section is empty.

Jump to

Keyboard shortcuts

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