-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add external secret store api and interface
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package secrets | ||
|
||
// SecretStoreSpec contains configuration to describe target secret store. | ||
type SecretStoreSpec struct { | ||
Provider *ProviderSpec `yaml:"provider" json:"provider"` | ||
} | ||
|
||
// ProviderSpec contains provider-specific configuration. | ||
type ProviderSpec struct { | ||
AWS *AWSProvider `yaml:"aws,omitempty" json:"aws,omitempty"` | ||
} | ||
|
||
// AWSProvider configures a store to retrieve secrets from AWS. | ||
type AWSProvider struct { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package secrets | ||
|
||
import ( | ||
"context" | ||
|
||
secretsapi "kusionstack.io/kusion/pkg/apis/secrets" | ||
) | ||
|
||
// SecretStore provides the interface to interact with various cloud secret manager. | ||
type SecretStore interface { | ||
// GetSecret retrieves ref secret from backend secret manager. | ||
GetSecret(ctx context.Context, ref string) ([]byte, error) | ||
} | ||
|
||
// SecretStoreProvider is a factory type for secret store. | ||
type SecretStoreProvider interface { | ||
// Type returns a string that reflects the type of this provider. | ||
Type() string | ||
// NewSecretStore constructs a usable secret store with specific provider spec. | ||
NewSecretStore(spec *secretsapi.SecretStoreSpec) (SecretStore, error) | ||
} |