Fix errors with fetching Shibboleth metadata - #8733
Conversation
|
Thanks for the pull request, @bradenmacdonald! It looks like you're a member of a company that does contract work for edX. If you're doing this work as part of a paid contract with edX, you should talk to edX about who will review this pull request. If this work is not part of a paid contract with edX, then you should ensure that there is an OSPR issue to track this work in JIRA, so that we don't lose track of your pull request. To automatically create an OSPR issue for this pull request, just visit this link: http://openedx-webhooks.herokuapp.com/github/process_pr?repo=edx%2Fedx-platform&number=8733 |
|
@cpennington Do you have a minute to review this small bugfix PR for the Shibboleth fetch task? I'd like to ensure it gets into Cypress. Sorry for the short notice. |
|
+1
|
Fix errors with fetching Shibboleth metadata
|
Thanks for the pull request, @bradenmacdonald! I've created OSPR-1387 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here. If you like, you can add yourself to the AUTHORS file for this repo, though that isn't required. Please see the CONTRIBUTING file for more information. |
Description:
I found a couple of bugs with the Shibboleth metadata fetching (See #8155, #8140).
First, due to an indentation error, the fetch code was
returning prematurely and wouldn't fetch all the providers.Second, if a provider's metadata specifies an encoding, e.g.
<?xml version="1.0" encoding="UTF-8"?>, then the XML parser would reject it:The solution is to pass the XML data as a bytestring rather than a unicode string. I included an updated test for this.
Merge target: Should be included in Cypress as it is pretty key to the SAML functionality.
JIRA: None
Dependencies: None
Sandbox: http://sandbox5.opencraft.com
Test Instructions:
To test on the sandbox, SSH in and as
edxapprun the command./manage.py lms saml pull --settings=aws.To test on a devstack, configure at least two SAML providers and run the command
./manage.py lms saml pull --settings=devstack. For the metadata URL setting, one can be any a nonexistent URL and the other should behttp://calnet-tin.ist.berkeley.edu/shib/shib-test.b.e-metadata.xmlwhich is the metadata file that made me aware of the encoding issue.Reviewers: @e-kolpakov and Cale