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

Function requireAIProviderKeyDecrypted

enterprise/dbcrypt/dbcrypt_internal_test.go:1090–1103  ·  view source on GitHub ↗
(
	t *testing.T,
	key database.AIProviderKey,
	ciphers []Cipher,
	wantAPIKey string,
)

Source from the content-addressed store, hash-verified

1088}
1089
1090func requireAIProviderKeyDecrypted(
1091 t *testing.T,
1092 key database.AIProviderKey,
1093 ciphers []Cipher,
1094 wantAPIKey string,
1095) {
1096 t.Helper()
1097 require.Equal(t, wantAPIKey, key.APIKey)
1098 if wantAPIKey != "" {
1099 require.Equal(t, ciphers[0].HexDigest(), key.ApiKeyKeyID.String)
1100 } else {
1101 require.False(t, key.ApiKeyKeyID.Valid)
1102 }
1103}
1104
1105func requireAIProviderKeyRawEncrypted(
1106 ctx context.Context,

Callers 1

TestAIProviderKeysFunction · 0.85

Calls 3

HelperMethod · 0.65
HexDigestMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected