sct

package
v1.1.63-test Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 9 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

Index

Constants

This section is empty.

Variables

View Source
var NoRepositoryError = errors.New("no TokenRepository assigned. Call WithRepository to assign a TokenRepository")
View Source
var SecretChallengeFailure = errors.New("Invalid Secret")
View Source
var TokenNotFound = errors.New("Secret Not Found")

Functions

This section is empty.

Types

type DefaultTokenPayload

type DefaultTokenPayload map[string]string

type GcpTokenRepository

type GcpTokenRepository[T any] struct {
	// contains filtered or unexported fields
}

func (*GcpTokenRepository[T]) Close

func (g *GcpTokenRepository[T]) Close() error

func (*GcpTokenRepository[T]) Delete

func (g *GcpTokenRepository[T]) Delete(ctx context.Context, t *Token[T]) error

func (*GcpTokenRepository[T]) Exists

func (g *GcpTokenRepository[T]) Exists(ctx context.Context, t *Token[T]) (bool, error)

func (*GcpTokenRepository[T]) GetProjectPath

func (g *GcpTokenRepository[T]) GetProjectPath() string

func (*GcpTokenRepository[T]) GetSecretId

func (g *GcpTokenRepository[T]) GetSecretId(t *Token[T]) string

func (*GcpTokenRepository[T]) GetSecretLatestSecretVersionName

func (g *GcpTokenRepository[T]) GetSecretLatestSecretVersionName(t *Token[T]) string

func (*GcpTokenRepository[T]) GetSecretName

func (g *GcpTokenRepository[T]) GetSecretName(t *Token[T]) string

func (*GcpTokenRepository[T]) Read

func (g *GcpTokenRepository[T]) Read(ctx context.Context, t *Token[T], f TokenFormatter[T]) error

func (*GcpTokenRepository[T]) Write

func (g *GcpTokenRepository[T]) Write(ctx context.Context, t *Token[T], f TokenFormatter[T]) error

type JsonFormatter

type JsonFormatter[T any] struct {
}

func (JsonFormatter[T]) Marshal

func (j JsonFormatter[T]) Marshal(t *Token[T]) ([]byte, error)

func (JsonFormatter[T]) Unmarshal

func (j JsonFormatter[T]) Unmarshal(b []byte, t *Token[T]) error

type Token

type Token[T any] struct {
	Content T                 `json:"content"`
	Name    string            `json:"name"`
	Id      string            `json:"id"`
	Scopes  []string          `json:"scopes"`
	Secrets map[string]string `json:"secrets"`
	Labels  map[string]string `json:"labels"`
}

func (*Token[T]) GetSecret

func (t *Token[T]) GetSecret(secretName string) string

func (*Token[T]) Validate

func (t *Token[T]) Validate() error

type TokenFormatter

type TokenFormatter[T any] interface {
	Marshal(t *Token[T]) ([]byte, error)
	Unmarshal(b []byte, t *Token[T]) error
}

type TokenManager

type TokenManager[T any] struct {
	// contains filtered or unexported fields
}

func NewGcpTokenManager

func NewGcpTokenManager[T any](projectId string, client *secretmanager.Client, secretTemplate *secretmanagerpb.Secret) *TokenManager[T]

func NewTokenManager

func NewTokenManager[T any]() *TokenManager[T]

func (*TokenManager[T]) Bytes

func (tm *TokenManager[T]) Bytes(t *Token[T]) ([]byte, error)

func (*TokenManager[T]) Close

func (tm *TokenManager[T]) Close() error

func (*TokenManager[T]) Delete

func (tm *TokenManager[T]) Delete(ctx context.Context, t *Token[T]) error

func (*TokenManager[T]) Exists

func (tm *TokenManager[T]) Exists(ctx context.Context, t *Token[T]) (bool, error)

func (*TokenManager[T]) NewToken

func (tm *TokenManager[T]) NewToken(ref string, challengeSecretName string) (*Token[T], error)

func (*TokenManager[T]) Read

func (tm *TokenManager[T]) Read(ctx context.Context, t *Token[T]) error

Read reads the token data into this instance using the configured Tokenrepository

func (*TokenManager[T]) String

func (tm *TokenManager[T]) String(t *Token[T]) (string, error)

func (*TokenManager[T]) ValidateTokenRef

func (tm *TokenManager[T]) ValidateTokenRef(refSecret string, challengeSecretName string, t *Token[T]) error

func (*TokenManager[T]) WithFormatter

func (tm *TokenManager[T]) WithFormatter(formatter TokenFormatter[T]) *TokenManager[T]

func (*TokenManager[T]) WithRepository

func (tm *TokenManager[T]) WithRepository(writer TokenRepository[T]) *TokenManager[T]

func (*TokenManager[T]) Write

func (tm *TokenManager[T]) Write(ctx context.Context, t *Token[T]) error

Write writes the token data in this instance using the configured TokenRepository

type TokenQuery

type TokenQuery struct {
	Name               string
	ScopeFilters       []string
	SecretNameFilters  []string
	SecretValueFilters []string
}

type TokenRepository

type TokenRepository[T any] interface {
	Exists(ctx context.Context, t *Token[T]) (bool, error)
	Read(ctx context.Context, t *Token[T], f TokenFormatter[T]) error

	Write(ctx context.Context, t *Token[T], f TokenFormatter[T]) error
	Delete(ctx context.Context, t *Token[T]) error
	Close() error
}

Jump to

Keyboard shortcuts

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