Allow configuration of metadata caching/expiry via settings - #68
Merged
Merged
Conversation
6 tasks
14 tasks
Contributor
Author
|
@pitbulk Do you have an idea of when you'll be able to review this PR and the other two pending PRs we have opened? We're currently using a fork of this repo but we'd love to see these merged so we can just use the official release if possible. Thanks! |
pitbulk
added a commit
that referenced
this pull request
Jun 24, 2015
Allow configuration of metadata caching/expiry via settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Curently, python-saml does not allow users to set the time period for which metadata is valid using settings. I have added two new settings to allow the user to control the default expiry date and/or maximum cache time. In addition, you can opt to leave one, the other, or both unspecified. Although leaving both unspecified is against the spec, it is commonly done and is helpful for integration tests and development environments.
I also found and fixed a bug: the
cacheDurationattribute in the XML is supposed to be a duration value likePT86400S(Period of Time 86400 Seconds - i.e. one day), and IdP implementations are required to record the time at which they fetched the metadata in order to compute the cache expiry time. However, the code was instead putting an absolute timestamp in this field, which would get interpreted as an extremely long maximum cache time (45+ years).This is a contribution from edX, developed by OpenCraft as part of bringing integrated SAML support to the edX platform, via a new python-social-auth SAML backend.