manager

package
v0.2.25 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	pg.PoolConn
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, pool pg.PoolConn, opts ...Opt) (_ *Credentials, err error)

New creates a new manager object

func (*Credentials) CreateCredential

func (m *Credentials) CreateCredential(ctx context.Context, req schema.CredentialCreate) (_ *schema.Credential, err error)

CreateCredential persists an encrypted credential row and returns the public credential shape, excluding passphrase version and encrypted payload.

func (*Credentials) DeleteCredential

func (m *Credentials) DeleteCredential(ctx context.Context, key schema.CredentialKey) (_ *schema.Credential, err error)

DeleteCredential deletes a credential row by key.

func (*Credentials) GetCredential

func (m *Credentials) GetCredential(ctx context.Context, key schema.CredentialKey, passphrase string) (_ json.RawMessage, err error)

GetCredential retrieves a credential by key and decrypts the credential payload with the given passphrase

func (*Credentials) GetCredentialWithoutPassphrase

func (m *Credentials) GetCredentialWithoutPassphrase(ctx context.Context, key schema.CredentialKey) (_ json.RawMessage, err error)

GetCredentialWithoutPassphrase retrieves and decrypts a credential using the stored passphrase version. It is intended for internal server-side use only and must not be exposed via any public API or HTTP handler.

func (*Credentials) ListCredentials

func (manager *Credentials) ListCredentials(ctx context.Context, req schema.CredentialListRequest) (_ *schema.CredentialList, err error)

ListCredentials returns a paginated list of credentials, excluding the encrypted credential payload.

func (*Credentials) RotateCredential

func (m *Credentials) RotateCredential(ctx context.Context, key schema.CredentialKey) (_ *schema.Credential, err error)

RotateCredential re-encrypts a credential with the latest passphrase version. Returns gofiler.ErrNotModified if the credential is already at the latest version.

func (Credentials) Run

func (Credentials) Run(ctx context.Context, log *slog.Logger) error

type Opt

type Opt func(*opt) error

Opt is a functional option for filer manager configuration.

func WithPassphrase

func WithPassphrase(version uint64, passphrase string) Opt

WithPassphrase registers an in-memory storage passphrase for a certificate passphrase version. Versions are uint64 and passphrases must be non-empty.

func WithSchema

func WithSchema(schema string) Opt

WithSchema sets the database schema used for storing filer objects.

func WithTracer

func WithTracer(tracer trace.Tracer) Opt

WithTracer sets the tracer used for tracing operations.

Jump to

Keyboard shortcuts

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