| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | package secretstore |
| 4 | |
| 5 | import "context" |
| 6 | |
| 7 | type Service interface { |
| 8 | Capture() *Snapshot |
| 9 | Resolve(ctx context.Context, snapshot *Snapshot, ref, original string) (string, error) |
| 10 | |
| 11 | Kinds() []StoreKind |
| 12 | DisplayName(kind StoreKind) (string, bool) |
| 13 | Schema(kind StoreKind) (string, bool) |
| 14 | New(kind StoreKind) (Store, bool) |
| 15 | |
| 16 | GetStatus(key string) (StoreStatus, bool) |
| 17 | |
| 18 | Validate(ctx context.Context, cfg Config) error |
| 19 | ValidateStored(ctx context.Context, key string) error |
| 20 | Add(ctx context.Context, cfg Config) error |
| 21 | Update(ctx context.Context, key string, cfg Config) error |
| 22 | Remove(key string) error |
| 23 | } |
| 24 | |
| 25 | type Creator struct { |
| 26 | Kind StoreKind |
| 27 | DisplayName string |
| 28 | Schema string |
| 29 | Create func() Store |
| 30 | } |
| 31 | |
| 32 | type Store interface { |
| 33 | Configuration() any |
| 34 | Init(context.Context) error |
| 35 | Publish() PublishedStore |
| 36 | } |
| 37 | |
| 38 | type PublishedStore interface { |
| 39 | Resolve(ctx context.Context, req ResolveRequest) (string, error) |
| 40 | } |