cache

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 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 CacheResponse

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

type ComposeRoleArn added in v0.5.0

type ComposeRoleArn struct {
	Enabled bool

	AccountID string
	Partition string
	Region    string
}

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) Get

func (f *FakeServiceAccountCache) Get(name, namespace string) (role, aud string, useRegionalSTS bool, tokenExpiration int64)

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 ServiceAccountCache

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

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