webhook use bearer token first
@@ -3,6 +3,7 @@ package handler
import (
"context"
"fmt"
+ "github.com/kalmhq/kalm/api/auth"
"github.com/kalmhq/kalm/api/resources"
"github.com/kalmhq/kalm/controller/api/v1alpha1"
"github.com/kalmhq/kalm/controller/controllers"
@@ -30,6 +31,12 @@ func (h *ApiHandler) handleDeployWebhookCall(c echo.Context) error {
return err
}
+ bearerToken := auth.ExtractTokenFromHeader(c.Request().Header.Get(echo.HeaderAuthorization))
+
+ if bearerToken != "" {
+ callParams.DeployKey = bearerToken
+ }
+
if callParams.DeployKey == "" {
return fmt.Errorf("deployKey can't be blank")
}
