Package com.atlassian.bamboo.mock
Class MockSecretEncryptionService
java.lang.Object
com.atlassian.bamboo.mock.MockSecretEncryptionService
- All Implemented Interfaces:
SecretEncryptionService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull String
Decrypt give string.@NotNull String
decryptIfDecryptable
(@NotNull String encryptedSecret) Decrypts secret if possible or returns original string if not.@NotNull String
Encrypts the supplied string.boolean
isDecryptable
(@NotNull String encryptedSecret) boolean
isEncrypted
(@NotNull String string) Whether the supplied string has been encrypted by this service.
-
Constructor Details
-
MockSecretEncryptionService
public MockSecretEncryptionService()
-
-
Method Details
-
isEncrypted
Description copied from interface:SecretEncryptionService
Whether the supplied string has been encrypted by this service.- Specified by:
isEncrypted
in interfaceSecretEncryptionService
-
isDecryptable
- Specified by:
isDecryptable
in interfaceSecretEncryptionService
- Returns:
- true if Bamboo can decrypt given value.
-
decrypt
Decrypt give string. Has logic to fail on broken strings, which doesn't follow pattern fromencrypt(String)
- Specified by:
decrypt
in interfaceSecretEncryptionService
-
decryptIfDecryptable
Description copied from interface:SecretEncryptionService
Decrypts secret if possible or returns original string if not.- Specified by:
decryptIfDecryptable
in interfaceSecretEncryptionService
-
encrypt
Description copied from interface:SecretEncryptionService
Encrypts the supplied string.- Specified by:
encrypt
in interfaceSecretEncryptionService
- Returns:
- "BAMSCRTyoursecret#CHARACTERSCOUNT encrypted"
-