refact(target): Change repository to take CredentialLibraries

This change removes the hard-coded credential purpose for the Credential
Libraries. It also moves the logic of creating CredentialLibraries from
CredentialSources out of the repository and into the targets.Service.
This refactor will allow for additional credential purposes to be
supported in both the service and the repository.
This commit is contained in:
Timothy Messier committed 2021-10-29 10:01:52 -04:00
1 parent 8ae6e9892f
commit 2cc58ff901
20 files changed
+1213 -133

No files matched your search

+11
View File
@@ -28,6 +28,10 @@ type Library interface {
// Purpose is the purpose of the credential.
type Purpose string
func (p Purpose) String() string {
return string(p)
}
// Credential purpose values.
const (
// ApplicationPurpose is a credential used for application specific
@@ -45,6 +49,13 @@ const (
EgressPurpose Purpose = "egress"
)
// ValidPurposes are the set of all credential Purposes.
var ValidPurposes = []Purpose{
ApplicationPurpose,
IngressPurpose,
EgressPurpose,
}
// SecretData represents secret data.
type SecretData interface{}