feat: implemented handling webhooks

This commit is contained in:
Stevan Freeborn
2026-08-15 20:18:21 -05:00
parent c3fded4492
commit d34c7b5822
6 changed files with 198 additions and 29 deletions
+12
View File
@@ -70,6 +70,18 @@ func GetBearerToken(headers http.Header) (string, error) {
return token, nil
}
func GetAPIKey(headers http.Header) (string, error) {
authorizationHeader := headers.Get("Authorization")
if strings.TrimSpace(authorizationHeader) == "" {
return "", errors.New("Missing Authorization header")
}
apiKey := strings.TrimPrefix(authorizationHeader, "ApiKey ")
return apiKey, nil
}
func MakeRefreshToken() string {
bytes := make([]byte, 32)
rand.Read(bytes)