-
Notifications
You must be signed in to change notification settings - Fork 447
Specify policy configurations based on the registration authority #729
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
Specify policy configurations based on the registration authority #729
Conversation
9b76d55
to
6b3236f
Compare
else: | ||
self._restrictions = None | ||
def __init__(self, restrictions=None, mds=None): | ||
self.metadata_store = mds |
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.
Policy needs a metadata store to look up attributes (entity-categories, registration-authority, etc).
Previously filter
, restrict
, and get_entity_categories
requested the metadata store (aka mds
, mdstore
) as a param. Now, the one that has been supplied during initialization is used.
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.
There are many changes, but this is the core of it.
To make this possible, the config module changed to build a Policy object with the metadata store. The metadata store must have been loaded beforehand.
Once the Policy object got a metadata-store object, the interfaces were refactored to remove the explicit param. The tests where then adjusted.
if ra_restrictions is not None | ||
else default_restrictions | ||
if default_restrictions is not None | ||
else {} |
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.
Use the sp_restrictions
, else the ra_restrictions
, else the default_restrictions
- there is no more a default for the registration authorities; SPs and RAs are mixed on the same list.
return self.get("entity_categories", sp_entity_id, default={}, | ||
post_func=post_entity_categories, **kwargs) | ||
result1 = self.get("entity_categories", sp_entity_id, default={}) | ||
result2 = post_entity_categories( |
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 should be further refactored
6b3236f
to
8ce1a08
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 think this is fine now and we should go ahead and merge 👍
@johanlundberg do have a look, and if you can test it, and let me know.
8ce1a08
to
60600a2
Compare
There are some breaking changes in this PR
|
4efb0ed
to
618a67b
Compare
@c00kiemon5ter I approve :) If I am able I will try it in our staging environment but don't let that stop you from merging this to master if I am slow. |
This feature is now running in our staging environment and fixes the attribute release problem we had when trying to be compliant with https://release-check.swamid.se/. |
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
… options Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
618a67b
to
e9aed0f
Compare
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
e9aed0f
to
2641019
Compare
Instead of breaking the interfaces, warnings are generated. These will stay there for some time, until we remove them entirely. This changeset is now backwards compatible, but to get the new features (restrictions based on the registration authority) one needs to properly upgrade, by initializing the Policy object with a metadata store. Usage that involves loading the configuration through the |
Allow the use of registration authorities in policy configuration.
This should work in the same way as for the policies written for specific SPs.
Example configuration
References
https://docs.oasis-open.org/security/saml/Post2.0/saml-metadata-rpi/v1.0/cs01/saml-metadata-rpi-v1.0-cs01.html
All Submissions: