-
Notifications
You must be signed in to change notification settings - Fork 33
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
Some custom response return codes in AuthPolicy do not work #1022
Comments
What is your expected behavior? Should the user be allowed to send custom status codes that out of spec as a response? Or is the issue we allow a user to define status codes that are out of spec? |
I expect it to return 333 and 444 instead of the error. I'm not sure what range should be there. I'd limit the values you can put there so it won't provoke unexpected behavior if you leave it as it is implemented now. But I like the option to define any code for the response better (from 100 to 600) I know it worked before, and now it is an unexpected change. So I guess it became a bug |
I was re-reading the spec and 2 things come to mind:
|
I'll take a look at the wasm-shim side |
From what I see, Kuadrant is working as expected. You told it to return So the right question here is: Should kuadrant allow configuration that specifies non standard return codes? |
From the wasm-shim side - when a request is denied we try to create the response using the status/headers/body from authorino. If authorino is configured to use status codes that are not from the valid list from envoy we end up getting back a I'd say we either restrict the set of status codes to those valid ones.. or alternatively we could "silently" override the code to a different one if we receive an empty status code, but I prefer the first option. |
When I set custom response return codes in AuthPolicy, I'm not sure why, but it can't send the response back now. Curl shows
Unsupported HTTP/1 subversion in response
as there is a wrong HTTP protocol version used.httpcore.RemoteProtocolError: illegal status line: bytearray(b'HTTP/1.1 0 Unknown')
this is from the python library.Seems like the issue remains only when specifying code that doesn't have any purpose by the standard (e.g. code 431 works, but 430 does not)
AuthPolicy:
Gateway
HTTPRoute
The text was updated successfully, but these errors were encountered: