disk

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCachePath = "$HOME/.oidc_keys"

DefaultCachePath is default path for OIDC tokens.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is a oidc caching structure that stores all tokens on disk. Tokens cache files are named after clientID and arg[0]. NOTE: There is no logic for cleaning cache in case of change in clientID. NOTE: There is no logic for caching configuration as well.

func NewCache

func NewCache(path string, cfg login.OIDCConfig) *Cache

NewCache constructs disk cache, that will store tokens to ${path}/token_${os.Args[0]}_${ClientID}

func NewCacheEnt added in v0.6.0

func NewCacheEnt(path string, localEnt string, cfg login.OIDCConfig) *Cache

NewCacheEnt constructs disk cache, that will store tokens to ${path}/token_${localEnt}_${ClientID}. localEnt is local entity name, for example tool name (see NewCache). If you need to request two tokens with different scopes using the same ClientID in the same tool, you have to use two different entities.

func (*Cache) Config

func (c *Cache) Config() login.OIDCConfig

Config returns OIDC configuration.

func (*Cache) SaveToken

func (c *Cache) SaveToken(token *oidc.Token) error

SaveToken saves token in file.

func (*Cache) Token

func (c *Cache) Token() (*oidc.Token, error)

Token retrieves token from file.

Jump to

Keyboard shortcuts

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