NewCredentialInfo creates a CredentialInfo from a raw credential. The credential is automatically masked before storage so that the original secret is never retained.
(kind CredentialKind, credential string)
| 23 | // The credential is automatically masked before storage so that the |
| 24 | // original secret is never retained. |
| 25 | func NewCredentialInfo(kind CredentialKind, credential string) CredentialInfo { |
| 26 | return CredentialInfo{ |
| 27 | Kind: kind, |
| 28 | Hint: utils.MaskSecret(credential), |
| 29 | Length: len(credential), |
| 30 | } |
| 31 | } |