feat: implemented handling webhooks
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user