-
Notifications
You must be signed in to change notification settings - Fork 16
Add endpoint to get SAML providers for a user. #1047
Conversation
a6938b9
to
434dad4
Compare
Accidentally closed PR. |
ed4b177
to
09b26f7
Compare
255e9ba
to
291ba07
Compare
Had to fix JSLint issues. How did those get in there? |
f17ee35
to
c7bf542
Compare
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'm working on testing this manually but noticed a few issues that you could address. Further feedback once I've tested the code a bit.
circle.yml
Outdated
@@ -11,7 +11,11 @@ dependencies: | |||
pre: | |||
- bash ./scripts/install-system-req.sh | |||
override: |
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 checked, and each command in override runs in its own shell instance, so nvm use
will not work since it makes changes to the active shell and those aren't preserved for the next command.
""" | ||
Test that the provider endpoint returns the appropriate data | ||
""" | ||
def test_results(self): |
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.
Could you split up this into multiple tests for linked and unlinked users? Also, you can use the ddt
instead of a loop.
|
||
* provider_id: The unique identifier of this provider (string) | ||
* name: The name of this provider (string) | ||
* remote_id: The ID of the user according to the provider. This ID |
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.
This documentation does not seem to be up to date with the code.
Addressed feedback provided so far. |
Currently waiting on circle-ci and vagrant so I can confirm the fix does what it should. |
@jcdyer Thanks! I tested it manually and it seems to be working as expected, and throttling is working as well. I also ran the new tests (post ddt refactor) and they are passing. |
3ad91f1
to
fc08bfa
Compare
Trying a test run without the jslint fixes. |
@jcdyer Thanks! I think the main code looks good to merge now, but some unrelated tests seem to be failing. |
Yep. I tried rebasing. If that doesn't solve it, I'll bump the query numbers, but I'd rather understand why the query count increased. |
@jcdyer It seems those test and quality failures are to be expected and being worked on separately, so as long as those are the only failures this is good to go. |
I did another test with all the latest changes and the relevant tests are passing, so I think this is close to done. Please just update the code documentation and update the ticket description, and we can merge this. |
ea4337b
to
db14792
Compare
Docs were updated. Did I miss another place where they were out of date? (I just squashed commits. That may have been unhelpful. Sorry about that.) The ticket description looks accurate on OC- and I don't have access to MCKIN-, so I don't know if that should be updated or not. Perhaps @bradenmacdonald can assist. Once you update your review to Approval, we should be able to merge. |
@jcdyer Sorry I meant PR description. I currently contains the text: "Description goes here. e.g. This PR contains the LibraryContent XBlock, which allows to display library content in a course." As for docs I mean the
|
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 tested this:
- I ran the automated tests
- I manually tested the API response to ensure it matches what we need
- I manually tested that the throttling works (see note below)
- I read through the code
-
I checked for accessibility issues - Includes documentation (see note below)
Please update the get
method docstring, I think that is the only thing that's missing now.
While throttling is working for me, it is not working the way I expected it, or as described in the ticket. For me, only 5 requests per second are allowed, and the 50/day limit isn't working. I'm still looking into this since I think it's an issue on my side.
throttle_classes = [ProviderSustainedThrottle, ProviderBurstThrottle] | ||
|
||
def get(self, request, identifier): | ||
"""Create, read, or update enrollment information for a user. |
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.
Please update these docs as well.
db14792
to
6d46c61
Compare
Updated docs and PR description. Commits squashed & waiting for CI. |
@jcdyer Thanks! The CI tests will probably fail again though for the same reasons as before. |
6d46c61
to
880d796
Compare
Confirmed. The only failures are the quality issues now. (Query counts are back to normal after the latest rebase. |
This PR contains a new view that returns a list of authentication providers for a user. This includes SAML, OAuth, and any other configured 3rd party auth providers.
JIRA tickets: Implements OC-4285, MCKIN-7245
Dependencies: None
Screenshots: None
Sandbox URL: TBD - sandbox is being provisioned.
Merge deadline: None
Testing instructions:
paver test_system -s lms -t common/djangoapps/third_party_auth/api/tests/
Author notes and concerns:
Throttling seems to be happening, but not according to the configuration I provided. Tested via curl on the command line.Throttling works now.paver test_system -s lms -t common/djangoapps/api/tests
Reviewers: