forked from juju/juju
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackend.go
More file actions
45 lines (37 loc) · 1.29 KB
/
Copy pathbackend.go
File metadata and controls
45 lines (37 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2022 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package provider
import (
"context"
"github.com/juju/juju/core/secrets"
)
// SecretsBackend is an external secrets backend like vault.
type SecretsBackend interface {
Ping() error
SaveContent(_ context.Context, uri *secrets.URI, revision int, value secrets.SecretValue) (string, error)
GetContent(_ context.Context, revisionId string) (secrets.SecretValue, error)
// DeleteContent removes the specified content.
// It *must* return a NotFound error if the content does not exist.
// This is needed so that juju can handle the case where is secret
// has been drained and added to a new active backend.
DeleteContent(_ context.Context, revisionId string) error
}
// BackendConfig is used when constructing a secrets backend.
type BackendConfig struct {
BackendType string
Config ConfigAttrs
}
// ModelBackendConfig is used when constructing a secrets backend
// for a particular model.
type ModelBackendConfig struct {
ControllerUUID string
ModelUUID string
ModelName string
BackendConfig
}
// ModelBackendConfigInfo holds secret backends, one of which
// is the active backend for a model.
type ModelBackendConfigInfo struct {
ActiveID string
Configs map[string]ModelBackendConfig
}