Help us shape the future of Go! Take the 2026 Go Developer Survey

secrets

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeUser        = "user"
	ScopeEnvironment = "environment"
)

Variables

View Source
var ErrInvalidSecretRef = errors.New("secret_ref is invalid")

Functions

This section is empty.

Types

type BindRequest

type BindRequest struct {
	PluginInstanceID string `json:"plugin_instance_id"`
	SecretRef        string `json:"secret_ref"`
	Scope            string `json:"scope"`
}

type DeleteRequest

type DeleteRequest = BindRequest

type ListRequest

type ListRequest struct {
	PluginInstanceID string `json:"plugin_instance_id,omitempty"`
	Scope            string `json:"scope,omitempty"`
	BoundOnly        bool   `json:"bound_only,omitempty"`
}

type Lister

type Lister interface {
	List(ctx context.Context, req ListRequest) ([]Record, error)
}

type MemoryState

type MemoryState struct {
	Records map[string]Record `json:"records,omitempty"`
}

type MemoryStore

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

func NewMemoryStore

func NewMemoryStore(opts ...MemoryStoreOptions) *MemoryStore

func NewMemoryStoreFromState

func NewMemoryStoreFromState(state MemoryState, opts ...MemoryStoreOptions) *MemoryStore

func (*MemoryStore) BindSecretRef

func (s *MemoryStore) BindSecretRef(_ context.Context, req BindRequest) error

func (*MemoryStore) DeletePlugin

func (s *MemoryStore) DeletePlugin(_ context.Context, pluginInstanceID string) error

func (*MemoryStore) DeleteSecretRef

func (s *MemoryStore) DeleteSecretRef(_ context.Context, req DeleteRequest) error

func (*MemoryStore) List

func (s *MemoryStore) List(_ context.Context, req ListRequest) ([]Record, error)

func (*MemoryStore) State

func (s *MemoryStore) State() MemoryState

func (*MemoryStore) TestSecretRef

func (s *MemoryStore) TestSecretRef(_ context.Context, req TestRequest) error

type MemoryStoreOptions

type MemoryStoreOptions struct {
	Now func() time.Time
}

type PluginDeleter

type PluginDeleter interface {
	DeletePlugin(ctx context.Context, pluginInstanceID string) error
}

type Record

type Record struct {
	PluginInstanceID string     `json:"plugin_instance_id"`
	SecretRef        string     `json:"secret_ref"`
	Scope            string     `json:"scope"`
	Bound            bool       `json:"bound"`
	LastTestStatus   string     `json:"last_test_status,omitempty"`
	BoundAt          *time.Time `json:"bound_at,omitempty"`
	TestedAt         *time.Time `json:"tested_at,omitempty"`
	DeletedAt        *time.Time `json:"deleted_at,omitempty"`
	UpdatedAt        time.Time  `json:"updated_at"`
}

type SQLiteStore

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

func NewSQLiteStore

func NewSQLiteStore(ctx context.Context, path string, opts ...MemoryStoreOptions) (*SQLiteStore, error)

func (*SQLiteStore) BindSecretRef

func (s *SQLiteStore) BindSecretRef(ctx context.Context, req BindRequest) error

func (*SQLiteStore) Close

func (s *SQLiteStore) Close() error

func (*SQLiteStore) DeletePlugin

func (s *SQLiteStore) DeletePlugin(ctx context.Context, pluginInstanceID string) error

func (*SQLiteStore) DeleteSecretRef

func (s *SQLiteStore) DeleteSecretRef(ctx context.Context, req DeleteRequest) error

func (*SQLiteStore) List

func (s *SQLiteStore) List(ctx context.Context, req ListRequest) ([]Record, error)

func (*SQLiteStore) State

func (s *SQLiteStore) State(ctx context.Context) (MemoryState, error)

func (*SQLiteStore) TestSecretRef

func (s *SQLiteStore) TestSecretRef(ctx context.Context, req TestRequest) error

type Store

type Store interface {
	BindSecretRef(ctx context.Context, req BindRequest) error
	DeleteSecretRef(ctx context.Context, req DeleteRequest) error
	TestSecretRef(ctx context.Context, req TestRequest) error
}

type TestRequest

type TestRequest = BindRequest

Jump to

Keyboard shortcuts

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