vitalik / django-ninja

💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
https://django-ninja.dev
MIT License
7.28k stars 432 forks source link

Distinguish between AuthenticationError and AuthorizationError #1257

Open c4ffein opened 3 months ago

c4ffein commented 3 months ago

Implements #1218

lordi commented 3 months ago

As far as I'm concerned, this looks good, thx

BlaiseMuhirwa commented 19 hours ago

Can we merge this soon? I also think it looks good and I need this distinction as well since I currently use django-ninja.

vitalik commented 1 hour ago

I think this might be done better...

AuthenticationError, AuthorizationError should be both inherited from HttpError (with corresponding codes and messages)

that way only one default http-error handler is needed (and users should be able to overwrite custom handlers for each class individualy)