feat(platform): add secret service interface for managing use secrets

pull/10616/head
Michael Desa 2018-11-13 15:20:37 -05:00
parent 0fc981133f
commit d1aecb7755
1 changed files with 15 additions and 0 deletions

15
secret.go Normal file
View File

@ -0,0 +1,15 @@
package platform
import "context"
// SecretService a service for storing and retrieving secrets.
type SecretService interface {
// LoadSecret retrieves the secret value v found at key k for organization orgID.
LoadSecret(ctx context.Context, orgID ID, k string) (string, error)
// GetSecretKeys retrieves all secret keys that are stored for the organization orgID.
GetSecretKeys(ctx context.Context, orgID ID) ([]string, error)
// PutSecret stores the secret pair (k,v) for the organization orgID.
PutSecret(ctx context.Context, orgID ID, k string, v string) error
}