Documentation
¶
Index ¶
- type Credentials
- func (m *Credentials) CreateCredential(ctx context.Context, req schema.CredentialCreate) (_ *schema.Credential, err error)
- func (m *Credentials) DeleteCredential(ctx context.Context, key schema.CredentialKey) (_ *schema.Credential, err error)
- func (m *Credentials) GetCredential(ctx context.Context, key schema.CredentialKey, passphrase string) (_ json.RawMessage, err error)
- func (m *Credentials) GetCredentialWithoutPassphrase(ctx context.Context, key schema.CredentialKey) (_ json.RawMessage, err error)
- func (manager *Credentials) ListCredentials(ctx context.Context, req schema.CredentialListRequest) (_ *schema.CredentialList, err error)
- func (m *Credentials) RotateCredential(ctx context.Context, key schema.CredentialKey) (_ *schema.Credential, err error)
- func (Credentials) Run(ctx context.Context, log *slog.Logger) error
- type Opt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
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.
type Opt ¶
type Opt func(*opt) error
Opt is a functional option for filer manager configuration.
func WithPassphrase ¶
WithPassphrase registers an in-memory storage passphrase for a certificate passphrase version. Versions are uint64 and passphrases must be non-empty.
func WithSchema ¶
WithSchema sets the database schema used for storing filer objects.
func WithTracer ¶
WithTracer sets the tracer used for tracing operations.