-
Notifications
You must be signed in to change notification settings - Fork 59
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
abao should understand security schemes #184
Comments
This basically reused the same methodology @ferrylauda used for testing the same endpoint several times. Potential conflicts? Oh, wow. Now I remember where I had seen your name before... Does this actually work? No OAuth expert or anything, but seems like there's a lot more to faking that type authentication than the PR demonstrates. |
From my perspective, it's the test writers' job to do the job setting up the authentication. The purpose of this changeset is to allow the test writers' to write security scheme specific tests. At least in our case, we already have to do the security setup to test all of our routes anyway. What this lets us do is specifically test those response codes which are unique because of the security scheme in place. (In our case the response codes of 401 and 403.) I don't know about potential conflicts with other work that's not in the gate yet. I've been happily using these changes in my own gate for many months now. Since we were resyncing with the gate tip, I thought I'd offer up this commit. If it's not welcome, that's fine, I'll continue to carry it along in my fork. |
@bpytlik, I'm making code-review now. We should add examples to readme file, how set the auth credentials. |
Potential conflicts are due to reuse of same method that @ferrylauda used to implement calling the same endpoint multiple times (appending string to the test name); aware this is in general usage in several branches. So how to determine whether security or just use-provided tag? Assuming these issues can be addressed, would need target |
(In reply to @galk-in) As I mentioned previously, I think examples of how to set the auth credentials are out of scope for this work. That's for a couple of reasons:
|
@plroebuck I don't know. This is all a hack to shoehorn things in for which abao is not really designed for. The right answer, imo, is to implement mocha-like suites. That gets you out of all of this name mangling. In absence of that, you could choose:
You could imagine other crazy approaches like writing a grammar to express these and other additions to the language of test names. That said, I suspect these are the two simplest and easiest. |
As part of our API, we have a security scheme we use for some endpoints. Since abao doesn't know about those security schemes, it doesn't have a way of testing them.
I've got a solution I'll make a pull request for shortly which basically appends the name of the security scheme to the route to differentiate it.
The text was updated successfully, but these errors were encountered: