authncache

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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. Closes the authenticator after removing it 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. If overwriting a value in the cache, closes the overwritten value.

type Key

type Key struct {
	APIGroup string
	Kind     string
	Name     string
}

type Value

type Value interface {
	authenticator.Token
	Close()
}

Jump to

Keyboard shortcuts

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