Foundation: config, schema/migrations, auth, stable IDs, metadata probing

This commit is contained in:
2026-08-22 23:29:16 -05:00
commit d4ea7a4ca9
40 changed files with 3874 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
package auth
import (
"crypto/sha256"
"encoding/hex"
)
// HashAPIKey returns a stable, non-reversible fingerprint of a raw API
// key for storage and lookup (API keys are high-entropy random tokens,
// not user-chosen passwords, so a plain fast hash is sufficient here).
func HashAPIKey(raw string) string {
sum := sha256.Sum256([]byte(raw))
return hex.EncodeToString(sum[:])
}