-
Notifications
You must be signed in to change notification settings - Fork 45
authz: make it easier to test authn/authz protection for new endpoints #652
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
Conversation
For future reference, here's some example log output (at "debug" level):
and here are the log messages from the test itself:
So it looks like it's doing roughly what I'd expect. |
This looks very nice, gets rid of a lot of boilerplate. So for a new endpoint, the workflow is to write explicit tests for the happy authed case (plus perhaps some endpoint-specific authz logic if there is some?), but for the base logged-out/logged-in tests you add an entry to the list in |
Yes, exactly! |
This change creates a new top-level integration test that has a hardcoded list of API endpoints to which we've added authn/authz protection. This way, when we add that protection for new endpoints, we can add them to this list without having to sprinkle all the other integration tests with a bunch of extra requests to check every case (and risk getting them wrong).
I tried to keep the per-endpoint metadata as minimal as possible.
Still to-do here: