MCPcopy Index your code
hub / github.com/coder/coder / requireEncryptedEquals

Function requireEncryptedEquals

enterprise/dbcrypt/dbcrypt_internal_test.go:835–842  ·  view source on GitHub ↗
(t *testing.T, c Cipher, value, expected string)

Source from the content-addressed store, hash-verified

833}
834
835func requireEncryptedEquals(t *testing.T, c Cipher, value, expected string) {
836 t.Helper()
837 data, err := base64.StdEncoding.DecodeString(value)
838 require.NoError(t, err, "invalid base64")
839 got, err := c.Decrypt(data)
840 require.NoError(t, err, "failed to decrypt data")
841 require.Equal(t, expected, string(got), "decrypted data does not match")
842}
843
844func initCipher(t *testing.T) *aes256 {
845 t.Helper()

Callers 11

TestUserLinksFunction · 0.70
TestExternalAuthLinksFunction · 0.70
TestCryptoKeysFunction · 0.70
TestNewFunction · 0.70
TestEncryptDecryptFieldFunction · 0.70
TestUserAIProviderKeysFunction · 0.70
TestMCPServerUserTokensFunction · 0.70
TestUserSecretsFunction · 0.70

Calls 4

DecodeStringMethod · 0.80
HelperMethod · 0.65
DecryptMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected