Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/db/src/lib/provider-credential-fingerprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

import { getEncryptionKey } from '@roomote/env';

/**
* Returns a stable, non-secret identifier for grouping provider credentials.
* This is not a password hash and must remain deterministic for lookups.
*/
export function fingerprintProviderCredential(apiKey: string): string {
return createHmac('sha256', getEncryptionKey())
.update(apiKey)
.update(apiKey) // codeql[js/insufficient-password-hash] -- This keyed HMAC is an identifier, not a password verifier.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
.digest('hex')
.slice(0, 12);
}
Loading