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:
20 files changed
+1213
-133
No files matched your search
@@ -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{}
|
||||
|
||||
|
||||
Reference in new issue
Block a user