Skip to content
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

Rename UnauthenticatedException -> UnauthorizedException and UnauthorizedException -> ForbiddenException #3222

Open
jmphilli-cash opened this issue Apr 10, 2024 · 3 comments

Comments

@jmphilli-cash
Copy link

jmphilli-cash commented Apr 10, 2024

It looks like we rename these underlying http status codes when in gets packaged as a class. See here

This is very confusing.
HTTP 401 is canonically Unauthorized.
HTTP 403 is canonically Forbidden.
There is no "unauthenticated" status code.

This rename means users reaching for an Unauthorized http status (401) will inadvertently return a 403. Users looking for a Forbidden http status will be confused and have to dig.

We should be able to simply add a ForbiddenException to handle the 403 case. Then we can deprecate the older UnauthorizedException.
We can also introduce UnauthorizedExceptionV2 and deprecate the UnauthenticatedException.

@frojasg
Copy link
Collaborator

frojasg commented Apr 10, 2024

These names are higher-level concepts meant to describe action exceptions independently of the protocols used to be transmitted (e.g., HTTP and gRPC)

gRPC uses UNAUTHENTICATED instead of the HTTP Unauthorized which can leads even to further confusion.

Open to talk more about it if you feel strongly about this.

@jmphilli-cash
Copy link
Author

These exceptions include HTTP codes
code pointer

@frojasg
Copy link
Collaborator

frojasg commented Apr 14, 2024

The WebActionException includes the grpcStatus as well. These fields are used by the WebActionExceptionMapper to know how to translate to the relevant response depending on the protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants