-
Notifications
You must be signed in to change notification settings - Fork 42
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
stub endpoints should still have working authz + coverage #885
Conversation
Depends on #873. |
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.
so good!
/// HTTP "GET" method that is not yet implemented | ||
/// | ||
/// This should be a transient state, used only for stub APIs | ||
GetUnimplemented, |
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.
do we anticipate needing this for other methods? e.g. PostUnimplemented
?
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.
I don't think so. For everything other than GET
, we only make requests that we expect to fail for authn/authz reasons. For GET
, do that, but we also make a request with a privileged user that we expect to succeed. GetUnimplemented
changes our expectation about this privileged request -- that it will fail with a 500.
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.
I added a comment to this effect on this variant and the previous variant in c4d8e1f.
// behavior for unauthenticated and unauthorized users. DO NOT SKIP THIS. | ||
// Even if you're just adding a stub, see [`Nexus::unimplemented_todo()`]. | ||
// If you _added_ a test that covered an endpoint from the allowlist -- | ||
// hooray! Just delete the corresponding line from this file. |
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.
yes! You might even say:
Why is this not expectorate:::assert_contents
? Because this file should only shrink a line at a time; if you find yourself adding something you're probably doing something wrong and you deserve to suffer. Muahahahaha.
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.
Added a comment about this in c4d8e1f. Thanks!
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.
Less colorful than I would have preferred... but ok.
Supersedes #809.
This change:
This was more complicated than discussed in chat, mainly because the coverage tests checks more cases than can be handled by a simple
Nexus::unimplemented()
function.