-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InMemoryChannel ingress: added getOIDC #8104
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -256,12 +256,13 @@ func (r *EventReceiver) ServeHTTP(response nethttp.ResponseWriter, request *neth | |
features := feature.FromContext(ctx) | ||
if features.IsOIDCAuthentication() { | ||
r.logger.Debug("OIDC authentication is enabled") | ||
err = r.tokenVerifier.VerifyJWTFromRequest(ctx, request, &r.audience, response) | ||
oidcToken, err := r.tokenVerifier.GetOIDCIdentity(ctx, request, r.audience) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The goal here is to verify the the request, I'd not change the existing code instead use a seperate function to get the OIDC Token! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay , I'll add a separate function to do that and leave it as it was .. |
||
if err != nil { | ||
r.logger.Warn("Error when validating the JWT token in the request", zap.Error(err)) | ||
response.WriteHeader(nethttp.StatusUnauthorized) | ||
return | ||
} | ||
r.logger.Debug("Request contained a valid JWT. Continuing...") | ||
r.logger.Debug("Request contained a valid JWT. Continuing...", zap.String("subject", oidcToken.Subject)) | ||
} | ||
|
||
err = r.receiverFunc(request.Context(), channel, *event, utils.PassThroughHeaders(request.Header)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in the other comment, the goal if your function is to get OIDC Identity and not verify the request as you are doing on line 191.