credential

package
v1.2.10-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxBatchSize  = 64
	MaxValueBytes = 64 << 10
)

Variables

View Source
var ErrNotFound = errors.New("credential not found")

Functions

func NormalizeName

func NormalizeName(value string) (string, error)

func NormalizeScope

func NormalizeScope(value string) (string, error)

func Resolve

func Resolve(ctx context.Context, name string) (string, error)

func WithResolver

func WithResolver(ctx context.Context, resolver Resolver, scope string) (context.Context, error)

Types

type EnvironmentResolver

type EnvironmentResolver struct{}

func (EnvironmentResolver) ResolveCredential

func (EnvironmentResolver) ResolveCredential(_ context.Context, _ string, name string) (string, error)

type FileStore

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

func OpenFileStore

func OpenFileStore(directory string) (*FileStore, error)

func (*FileStore) DeleteCredential

func (s *FileStore) DeleteCredential(_ context.Context, scope, name string) error

func (*FileStore) ListCredentials

func (s *FileStore) ListCredentials(_ context.Context, scope string) ([]Metadata, error)

func (*FileStore) PutCredential

func (s *FileStore) PutCredential(ctx context.Context, scope, name, value string) (Metadata, error)

func (*FileStore) PutCredentials

func (s *FileStore) PutCredentials(_ context.Context, scope string, values map[string]string) ([]Metadata, error)

func (*FileStore) ResolveCredential

func (s *FileStore) ResolveCredential(_ context.Context, scope, name string) (string, error)

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore() *MemoryStore

func (*MemoryStore) DeleteCredential

func (s *MemoryStore) DeleteCredential(_ context.Context, scope, name string) error

func (*MemoryStore) ListCredentials

func (s *MemoryStore) ListCredentials(_ context.Context, scope string) ([]Metadata, error)

func (*MemoryStore) PutCredential

func (s *MemoryStore) PutCredential(ctx context.Context, scope, name, value string) (Metadata, error)

func (*MemoryStore) PutCredentials

func (s *MemoryStore) PutCredentials(_ context.Context, scope string, values map[string]string) ([]Metadata, error)

func (*MemoryStore) ResolveCredential

func (s *MemoryStore) ResolveCredential(_ context.Context, scope, name string) (string, error)

type Metadata

type Metadata struct {
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Resolver

type Resolver interface {
	ResolveCredential(ctx context.Context, scope, name string) (string, error)
}

type Store

type Store interface {
	Resolver
	PutCredential(ctx context.Context, scope, name, value string) (Metadata, error)
	PutCredentials(ctx context.Context, scope string, values map[string]string) ([]Metadata, error)
	DeleteCredential(ctx context.Context, scope, name string) error
	ListCredentials(ctx context.Context, scope string) ([]Metadata, error)
}

Jump to

Keyboard shortcuts

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