Closed jaimeperez closed 4 years ago
I was able to merge quite a good portion of this PR to master without breaking anything.. That way we at least have some of the individual commits + commit messages instead of one huge squashed commit.
Merging #208 into master will increase coverage by
9.58%
. The diff coverage is98.09%
.
@@ Coverage Diff @@
## master #208 +/- ##
============================================
+ Coverage 74.99% 84.57% +9.58%
+ Complexity 2294 2122 -172
============================================
Files 142 143 +1
Lines 5358 5393 +35
============================================
+ Hits 4018 4561 +543
+ Misses 1340 832 -508
Thanks, I had to run into a meeting :P
No prob! 😄
This is quite a big piece of work. Some details:
XML/md/
to be immutable.EndpointType
extensions.LocalizedNameType
extensions.Some notes on the approach followed:
Some classes are not abstract, but we want them to be extensible as well. Since we need
fromXML()
methods for both, the classes extending from the base cannot reusefromXML()
since that one checks the actual element name and namespace URI. An alternative is to create static methods for each property, that return any valid value for it, from a given XML. These methods include all checks needed (e.g. aanyURI
type cannot contain an empty string).I've used traits to achieve composition of functionality common between different classes. When appropriate, I've added meaningful abstract classes that aggregate functionality coming from those traits (e.g. an
AbstractMetadataDocument
class that adds properties –and methods– related to any SAML metadata document, likecacheDuration
orvalidUntil
).