credsyncer

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CredentialConfigAnnotation is annotation key for credential configs
	CredentialConfigAnnotation = "refunc.io/is-credential-config"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FlatCreds

type FlatCreds struct {
	// ns/name if it comes from a funcinst
	FuncinstID string `json:"funcinst,omitempty"`

	// meta
	ID        string `json:"id,omitempty"`
	AccessKey string `json:"accessKey,omitempty"`
	SecretKey string `json:"secretKey,omitempty"`

	// storage
	Scope string `json:"scope,omitempty"`

	// network
	Permissions struct {
		Publish   []string `json:"publish,omitempty"`
		Subscribe []string `json:"subscribe,omitempty"`
	} `json:"permissions"`
}

FlatCreds is flat verison of creds and permission

func NewCreds

func NewCreds(fni *rfv1beta3.Funcinst, prefix string) *FlatCreds

NewCreds creates new flat creds from a valid funcinst

type Provider

type Provider interface {
	IssueKeyPair(fni *rfv1beta3.Funcinst) (accessKey, secretKey string, err error)
	IssueAccessToken(fni *rfv1beta3.Funcinst) (accessToken string, err error)
}

Provider is interface for a vault to issue credentials

func NewGeneratedProvider

func NewGeneratedProvider(lifetime time.Duration) Provider

NewGeneratedProvider creates a creds provider generate random keys, issues token using private key in current env

func NewSimpleProvider

func NewSimpleProvider() Provider

NewSimpleProvider creates a creds provider simply forwarding keys and token in current env

type Store

type Store interface {
	AddCreds(creds *FlatCreds) error
	DeleteCreds(accessKey string) error
}

Store is storage interface to manage creds

type Syncer

type Syncer interface {
	Run(stopC <-chan struct{})
}

Syncer sync credentials from refunc and provide for storage layer

func NewCredSyncer

func NewCredSyncer(
	namespace,
	prefix string,
	store Store,
	refuncInformers rfinformers.SharedInformerFactory,
	kubeInformers k8sinformers.SharedInformerFactory,
) (Syncer, error)

NewCredSyncer creates a credential provider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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