secrets

package
v0.6.14 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var ErrInvalidSecretRef = errors.New("secret_ref is invalid")
View Source
var ErrSecretScopeMismatch = errors.New("secret owner scope mismatch")

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 MemoryStore

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

func NewMemoryStore

func NewMemoryStore(opts ...MemoryStoreOptions) *MemoryStore

func (*MemoryStore) BindSecretRef

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

func (*MemoryStore) DeletePlugin

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

func (*MemoryStore) DeleteSecretRef

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

func (*MemoryStore) List

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

func (*MemoryStore) TestSecretRef

func (s *MemoryStore) TestSecretRef(ctx 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 {
	OwnerEnvHash     string     `json:"-"`
	OwnerUserHash    string     `json:"-"`
	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) 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