cache

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComposeRoleArn added in v0.5.0

type ComposeRoleArn struct {
	Enabled bool

	AccountID string
	Partition string
	Region    string
}

type Entry added in v0.5.8

type Entry struct {
	RoleARN         string
	Audience        string
	UseRegionalSTS  bool
	TokenExpiration int64
}

type FakeServiceAccountCache

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

FakeServiceAccountCache is a goroutine safe cache for testing

func NewFakeServiceAccountCache

func NewFakeServiceAccountCache(accounts ...*v1.ServiceAccount) *FakeServiceAccountCache

func (*FakeServiceAccountCache) Add

func (f *FakeServiceAccountCache) Add(name, namespace, role, aud string, regionalSTS bool, tokenExpiration int64)

Add adds a cache entry

func (*FakeServiceAccountCache) Clear added in v0.5.9

func (f *FakeServiceAccountCache) Clear()

func (*FakeServiceAccountCache) Get

Get gets a service account from the cache

func (*FakeServiceAccountCache) GetCommonConfigurations added in v0.5.0

func (f *FakeServiceAccountCache) GetCommonConfigurations(name, namespace string) (useRegionalSTS bool, tokenExpiration int64)

func (*FakeServiceAccountCache) Pop

func (f *FakeServiceAccountCache) Pop(name, namespace string)

Pop deletes a cache entry

func (*FakeServiceAccountCache) Start

func (f *FakeServiceAccountCache) Start(chan struct{})

Start does nothing

func (*FakeServiceAccountCache) ToJSON added in v0.3.0

func (f *FakeServiceAccountCache) ToJSON() string

type Request added in v0.5.8

type Request struct {
	Name                string
	Namespace           string
	RequestNotification bool
}

func (Request) CacheKey added in v0.5.8

func (r Request) CacheKey() string

type Response added in v0.5.8

type Response struct {
	RoleARN         string
	Audience        string
	UseRegionalSTS  bool
	TokenExpiration int64
	FoundInCache    bool
	Notifier        <-chan struct{}
}

type ServiceAccountCache

type ServiceAccountCache interface {
	Start(stop chan struct{})
	Get(request Request) Response
	GetCommonConfigurations(name, namespace string) (useRegionalSTS bool, tokenExpiration int64)
	// ToJSON returns cache contents as JSON string
	ToJSON() string
	Clear()
}

func New

func New(defaultAudience, prefix string, defaultRegionalSTS bool, defaultTokenExpiration int64, saInformer coreinformers.ServiceAccountInformer, cmInformer coreinformers.ConfigMapInformer, composeRoleArn ComposeRoleArn) ServiceAccountCache

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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