Add the runnable Gitea, PostgreSQL, and Hop control-plane foundation

Hop-State: A_06FN3QYA1N56NQYGZ81DWGR
Hop-Proposal: R_06FN3QXJRYPPEQZQA6S69QG
Hop-Task: T_06FN3MVGY3MT82ESQ89BND0
Hop-Attempt: AT_06FN3MVGY092BFA5MR9C7EG
This commit is contained in:
Hop
2026-07-11 08:50:48 -07:00
parent dd2c0abfd2
commit d9544b435b
22 changed files with 1114 additions and 0 deletions
@@ -0,0 +1,17 @@
package gitea
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
)
func VerifySignature(body []byte, signature, secret string) bool {
provided, err := hex.DecodeString(signature)
if err != nil {
return false
}
mac := hmac.New(sha256.New, []byte(secret))
_, _ = mac.Write(body)
return hmac.Equal(provided, mac.Sum(nil))
}