-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SSM source validation Add credentials list validations
- Loading branch information
1 parent
204c564
commit e5b117e
Showing
6 changed files
with
98 additions
and
19 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
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
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
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,31 @@ | ||
package credentials | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
type SecretTextCredentials struct { | ||
Base `mapstructure:",squash"` | ||
Secret string | ||
} | ||
|
||
func NewSecretText() *SecretTextCredentials { | ||
cred := &SecretTextCredentials{} | ||
cred.CredType = "Secret text" | ||
return cred | ||
} | ||
|
||
func (cred *SecretTextCredentials) ToString(showSensitive bool) string { | ||
secretText := "*******" | ||
if showSensitive { | ||
secretText = cred.Secret | ||
} | ||
if cred.Secret == "" { | ||
secretText = "<empty>" | ||
} | ||
return fmt.Sprintf("%s - %s", cred.BaseToString(), secretText) | ||
} | ||
|
||
func (cred *SecretTextCredentials) Validate() bool { | ||
return true | ||
} |
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
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