-
Notifications
You must be signed in to change notification settings - Fork 425
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
Register common namespace prefixes #625
base: master
Are you sure you want to change the base?
Conversation
as @spaceone already proposed here: IdentityPython#326
Codecov Report
@@ Coverage Diff @@
## master #625 +/- ##
=========================================
Coverage ? 65.42%
=========================================
Files ? 103
Lines ? 25724
Branches ? 0
=========================================
Hits ? 16831
Misses ? 8893
Partials ? 0
Continue to review full report at Codecov.
|
e82ef71
to
8b1bb93
Compare
…l2.__init__ - code cleanup - SamlBase.register_prefix is now a staticmethod
I'd also like to discuss the opportunity to merge some constants. In metadata.pyAt line 35
XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance'./validate.py:10:XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance' NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:assertion'./saml.py:21:NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:assertion' (XS|XSI)_NAMESPACE = 'http://www.w3.org/2001/XMLSchema(-instance)'./validate.py:10:XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance' MD_NAMESPACE = "urn:oasis:names:tc:SAML:2.0:metadata"./metadata.py:39: "meta": "urn:oasis:names:tc:SAML:2.0:metadata", MDUI_NAMESPACE = "urn:oasis:names:tc:SAML:metadata:ui"./extension/ui.py:12:NAMESPACE = 'urn:oasis:names:tc:SAML:metadata:ui' DS_NAMESPACE = 'http://www.w3.org/2000/09/xmldsig#'./metadata.py:41: "ds": "http://www.w3.org/2000/09/xmldsig#", XENC_NAMESPACE = "http://www.w3.org/2001/04/xmlenc#"./init.py:58:XENC_NAMESPACE = "http://www.w3.org/2001/04/xmlenc#" [not duplicated] ALG_NAMESPACE = "urn:oasis:names:tc:SAML:metadata:algsupport"./init.py:59:ALG_NAMESPACE = "urn:oasis:names:tc:SAML:metadata:algsupport" MDATTR_NAMESPACE = "urn:oasis:names:tc:SAML:metadata:attribute"./extension/mdattr.py:12:NAMESPACE = 'urn:oasis:names:tc:SAML:metadata:attribute' |
Is this going to get merged? I've been using the code from this PR for a few years now and it's making my devops pipeline, um, difficult. |
rebased #326 |
Commenting so that it shows up to the maintainers. |
as @spaceone has already proposed here: #326
This PR makes pySAML2 to adopt OASIS conventions about namespace prefixes.
USAGE
A user can registers his own prefixes defining them into a dict and registering them as follow:
@c00kiemon5ter
Even if you do not want to merge this PR as-is I will be very thankfull to you and also to the community if we'll keep
OASIS_DEFAULT_NS_PREFIXES
as reference andSamlBase.register_prefix
as a staticmethod. This will give us the opportunity to let the users to register OASIS namespaces during configuration, or any other own tastes. They just would then type:Regarding unit test I'll follow @spaceone suggestions, dealing with a dynamic adaptation of xml templates. I know that this PR could represent a risk for legacy systems but I would also found in this an important belonging to OASIS conventions. Hope to meet your line.