-
Notifications
You must be signed in to change notification settings - Fork 601
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
fix:InMemoryChannel ingress: Reject unauthorized requests #8123
Conversation
Hi @7h3-3mp7y-m4n. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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.
Hello @7h3-3mp7y-m4n,
thanks for working on this. I left a comment. If you have any questions do not hesitate to reach out
Thanks for helping me. I'll reach out to you if I get stuck in some trouble |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 7h3-3mp7y-m4n The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Hello @7h3-3mp7y-m4n,
thanks for the update on this. This looks better. Now you need to declare and set the getPoliciesFor
callback for the InMemoryChannel, so we have this set. Therefor I would do the following:
- Declare a new
EventReceiverOptions
function inevent_receiver.go
, which allows to set thegetPoliciesFor
callback on aEventReceiver
object. (this allows us to not touch the method signature ofNewEventReceiver()
) - Add an implementation for this for the InMemoryChannel and pass it via
NewFanoutEventHandler()
in dispatcher/inmemorychannel.go (here and here). This "implementation" would then get an InMemoryChannel by its namespace and name and simply return itsAppliedEventPoliciesStatus
.
I hope this helps. If you need an my information, please let us know.
//v1 "knative.dev/eventing/pkg/client/listers/messaging/v1" | ||
|
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.
can you remove this unneeded lines?
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.
okay.
@@ -251,19 +254,22 @@ func (r *EventReceiver) ServeHTTP(response nethttp.ResponseWriter, request *neth | |||
response.WriteHeader(nethttp.StatusBadRequest) | |||
return | |||
} | |||
|
|||
polices, err := r.getPoliciesFor(channel.Namespace, channel.Name) |
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.
we need to check, that getPoliciesFor
is not nil (as this is set by the outside). As said in #8123 (comment), we the could fail fast as the callback is not defined (log a error message and return with a 500 http code)
http://www.apache.org/licenses/LICENSE-2.0 | ||
http://www.apache.org/licenses/LICENSE-2.0 |
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.
can you run gofmt
on your PR?
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.
on it.
on it. Thanks for helping :) |
@7h3-3mp7y-m4n any updates on this? Do you need any more help to get this done? |
Duplicate with #8162 |
Fixes #7981
Proposed Changes
Pre-review Checklist
Release Note
Docs