Skip to content

Add store module#24

Merged
Benehiko merged 1 commit intomainfrom
secrets-store
Jun 23, 2025
Merged

Add store module#24
Benehiko merged 1 commit intomainfrom
secrets-store

Conversation

@Benehiko
Copy link
Member

The secrets engine is opinionated on the key format (id of the secret). Each secret stored should store or at a minimum map the key to the secrets.ID.

This patch adds two new interfaces to the secrets engine:

  • Store
  • Secret

A Store can be a physical file or a wrapper around an API.
A Secret can be anything as long as it can be Marshalled and Unmarshalled.

The implementer of a Secret is responsible for maintaining the format of a secret. The secrets engine does not enforce a particular encoder or marshaller. The implementer is free to decide.

@Benehiko Benehiko requested review from joe0BAB and wmluke June 20, 2025 15:09
@Benehiko Benehiko changed the title Add store and secret type Add store module Jun 21, 2025
store/store.go Outdated
// with the secrets engine
type Store interface {
// Erase removes credentials from the store for a given ID.
Erase(ctx context.Context, id ID) error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete? I'd stick to conventions which usually is Delete or Remove.

store/store.go Outdated
// GetAll retrieves all the credentials from the store.
GetAll(ctx context.Context) (map[ID]Secret, error)
// Store saves credentials in the store.
Store(ctx context.Context, id ID, secret Secret) error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set or Save? Same reasons as above.

Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
@Benehiko Benehiko merged commit cd38460 into main Jun 23, 2025
12 checks passed
@Benehiko Benehiko deleted the secrets-store branch June 24, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants