Package com.atlassian.bamboo.mock
Class MockSecretEncryptionService
- java.lang.Object
-
- com.atlassian.bamboo.mock.MockSecretEncryptionService
-
- All Implemented Interfaces:
SecretEncryptionService
public class MockSecretEncryptionService extends Object implements SecretEncryptionService
-
-
Constructor Summary
Constructors Constructor Description MockSecretEncryptionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Stringdecrypt(@NotNull String encryptedSecret)Decrypt give string.@NotNull StringdecryptIfDecryptable(@NotNull String encryptedSecret)Decrypts secret if possible or returns original string if not.@NotNull Stringencrypt(@NotNull String secretToEncrypt)Encrypts the supplied string.booleanisDecryptable(@NotNull String encryptedSecret)booleanisEncrypted(@NotNull String string)Whether the supplied string has been encrypted by this service.
-
-
-
Method Detail
-
isEncrypted
public boolean isEncrypted(@NotNull @NotNull String string)Description copied from interface:SecretEncryptionServiceWhether the supplied string has been encrypted by this service.- Specified by:
isEncryptedin interfaceSecretEncryptionService
-
isDecryptable
public boolean isDecryptable(@NotNull @NotNull String encryptedSecret)- Specified by:
isDecryptablein interfaceSecretEncryptionService- Returns:
- true if Bamboo can decrypt given value.
-
decrypt
@NotNull public @NotNull String decrypt(@NotNull @NotNull String encryptedSecret)
Decrypt give string. Has logic to fail on broken strings, which doesn't follow pattern fromencrypt(String)- Specified by:
decryptin interfaceSecretEncryptionService
-
decryptIfDecryptable
@NotNull public @NotNull String decryptIfDecryptable(@NotNull @NotNull String encryptedSecret)
Description copied from interface:SecretEncryptionServiceDecrypts secret if possible or returns original string if not.- Specified by:
decryptIfDecryptablein interfaceSecretEncryptionService
-
encrypt
@NotNull public @NotNull String encrypt(@NotNull @NotNull String secretToEncrypt)
Description copied from interface:SecretEncryptionServiceEncrypts the supplied string.- Specified by:
encryptin interfaceSecretEncryptionService- Returns:
- "BAMSCRTyoursecret#CHARACTERSCOUNT encrypted"
-
-