( t *testing.T, key database.AIProviderKey, ciphers []Cipher, wantAPIKey string, )
| 1088 | } |
| 1089 | |
| 1090 | func 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 | |
| 1105 | func requireAIProviderKeyRawEncrypted( |
| 1106 | ctx context.Context, |
no test coverage detected