Migrate metadata generation to new SAML2-library#1901
Migrate metadata generation to new SAML2-library#1901
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1901 +/- ##
============================================
- Coverage 44.59% 44.10% -0.49%
+ Complexity 3743 3720 -23
============================================
Files 166 165 -1
Lines 12728 12728
============================================
- Hits 5676 5614 -62
- Misses 7052 7114 +62 |
f49e643 to
31fc0f2
Compare
31fc0f2 to
98228fb
Compare
7cd3f83 to
74d478c
Compare
ccb9b02 to
120a100
Compare
74d478c to
80b1a9d
Compare
e0b429d to
ab9195e
Compare
6004a77 to
58bf8db
Compare
5c9fb2c to
0970efc
Compare
c27831c to
71e49f4
Compare
0de18b2 to
77c4844
Compare
35e78c0 to
5f06278
Compare
|
I noticed a few things on the first reading. One which is probably a matter of style is the old If the document is not used for other purposes than builder to XML string then maybe having a |
|
Yes, I believe these lines are replicated one or two times, so it makes sense to refactor this into a new method! |
|
I have been working on a |
|
I am trying to get |
|
Make sure to leverage the toArray-method on some of the saml2-elements. We can add more if needed |
The MetadataParser is based on SAMLParser with the API being updated to the newer saml library. This is part of the update effort to move code that was using saml2-legacy to use saml2 instead. Note that this is very much a WIP with only the first test testDiscoveryResponse updated to using the new MetadataParser class. That one test does now complete so it is a good first move toward that whole file using the new API. This is also rough at this stage and will need more polish once all the tests are passing.
|
I should have the other 9 tests working today or very soon. The code is still extremely ugly, my first goal was getting the existing tests to all work on MetadataParser and then move on from there. I pushed the starting changes up here as it was a new class and an update to the one test file. As I have point on this update I thought that wasn't going to get in the way of anything being partial. |
|
My starting plan was to create MetadataParser as a copy of SAMLParser and update it to the new The code in MetadataParser is very rough and not "merge ready" but does what is needed for that test suite file to run and be happy. From there working out how to merge the changes in |
The unit test was also expecting an epoch integer here so that got updated to expecting a Z time string.
There is a choice to either use an array of SAMLAnyURIValue for a $SAML20Protocols function replacement and then intersect on that or we can flatten the objects to strings an the normal array_intersect will work ok on the same data types here. I have code that does both things depending on which we are after.
This PR aims to partially migrate to the new SAML2 library. First run: metadata generation!
To do:
MetadataBuilderclass.MetadataParserclass as a replacement of the oldSAMLParserclass. This class should be able to parse XML metadata into SimpleSAMLphp's array-format. TheSignerclass should become obsolete.MetadataBuilderclass. This also requires us to add a few missing classes to the ws-security library and . Missing classes are: