MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / verifyAPIKey

Function verifyAPIKey

database/api_key.go:32–35  ·  view source on GitHub ↗

verifyAPIKey compares a plaintext key with a bcrypt hash.

(hashedKey, plainKey string)

Source from the content-addressed store, hash-verified

30
31// verifyAPIKey compares a plaintext key with a bcrypt hash.
32func verifyAPIKey(hashedKey, plainKey string) bool {
33 err := bcrypt.CompareHashAndPassword([]byte(hashedKey), []byte(plainKey))
34 return err == nil
35}
36
37// getKeyPrefix extracts the first 16 characters of the key for efficient lookup.
38func getKeyPrefix(key string) string {

Callers 1

GetAPIKeyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected