authncache

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package authncache implements a cache of active authenticators.

Index

Constants

View Source
const ErrNoSuchAuthenticator = constable.Error("no such authenticator")

ErrNoSuchAuthenticator is returned by Cache.AuthenticateTokenCredentialRequest() when the requested authenticator is not configured.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache implements the authenticator.Token interface by multiplexing across a dynamic set of authenticators loaded from authenticator resources.

func New

func New() *Cache

New returns an empty cache.

func (*Cache) AuthenticateTokenCredentialRequest

func (c *Cache) AuthenticateTokenCredentialRequest(ctx context.Context, req *loginapi.TokenCredentialRequest) (user.Info, error)

func (*Cache) Delete

func (c *Cache) Delete(key Key)

Delete an authenticator from the cache.

func (*Cache) Get

func (c *Cache) Get(key Key) Value

Get an authenticator by key.

func (*Cache) Keys

func (c *Cache) Keys() []Key

Keys currently stored in the cache.

func (*Cache) Store

func (c *Cache) Store(key Key, value Value)

Store an authenticator into the cache.

type Key

type Key struct {
	APIGroup string
	Kind     string
	Name     string
}

type Value

type Value interface {
	authenticator.Token
}

Jump to

Keyboard shortcuts

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