Skip to content

Migrate metadata generation to new SAML2-library - #1901

Draft
tvdijen wants to merge 30 commits into
masterfrom
saml2v5_metadata
Draft

tvdijen wants to merge 30 commits into
masterfrom
saml2v5_metadata

Conversation

@tvdijen

@tvdijen tvdijen commented Nov 20, 2023 •

Copy link
Copy Markdown
Member

This PR aims to partially migrate to the new SAML2 library. First run: metadata generation!

To do:

  • Raise coverage on the MetadataBuilder class.
  • Create a MetadataParser class as a replacement of the old SAMLParser class. This class should be able to parse XML metadata into SimpleSAMLphp's array-format. The Signer class should become obsolete.
  • Convert the ADFS module to use the new MetadataBuilder class. This also requires us to add a few missing classes to the ws-security library and . Missing classes are:
    • wst:RequestSecurityTokenResponse
    • wst:RequestSecurityToken
    • wsp:AppliesTo
  • Ensure that metadata we generate or consume complies with: https://docs.oasis-open.org/security/saml/Post2.0/sstc-metadata-iop-os.pdf

@codecov

codecov Bot commented Nov 20, 2023 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.74134% with 314 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.72%. Comparing base (f798343) to head (ab1a8a7).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1901      +/-   ##
============================================
+ Coverage     47.05%   47.72%   +0.67%     
- Complexity     4295     4430     +135     
============================================
  Files           184      184              
  Lines         13841    14296     +455     
============================================
+ Hits           6513     6823     +310     
- Misses         7328     7473     +145     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tvdijen
tvdijen force-pushed the saml2v5_metadata branch 4 times, most recently from 7cd3f83 to 74d478c Compare November 27, 2023 23:31
@tvdijen
tvdijen force-pushed the master branch 3 times, most recently from ccb9b02 to 120a100 Compare December 1, 2023 14:34
@tvdijen
tvdijen force-pushed the saml2v5_metadata branch from 74d478c to 80b1a9d Compare April 2, 2024 18:53
@tvdijen
tvdijen force-pushed the saml2v5_metadata branch 6 times, most recently from e0b429d to ab9195e Compare April 29, 2024 15:50
@tvdijen
tvdijen force-pushed the master branch 2 times, most recently from 6004a77 to 58bf8db Compare May 4, 2024 23:45
@tvdijen
tvdijen force-pushed the master branch 2 times, most recently from 5c9fb2c to 0970efc Compare May 27, 2024 12:27
@tvdijen
tvdijen force-pushed the master branch 2 times, most recently from c27831c to 71e49f4 Compare June 19, 2024 17:03
tvdijen and others added 24 commits October 27, 2026 09:02
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.
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.
The name of the self::flatten methods are just temporary still. They
are there to get the shape of the data into the format that the test
suite is expecting.

I will do a composer update next to make sure I have not changed
anything else locally that needs to be fed back.
@tvdijen

tvdijen commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

@monkeyiq I think we should properly test this PR and see if we can get a v2.6 out. Would be a nice step forward.

@tvdijen

tvdijen commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

@monkeyiq Besides the minor fixes, were you able to do some testing with the metadata-endpoints?

@monkeyiq

Copy link
Copy Markdown
Contributor

I think another round of testing would be good. Also maybe kicking it around a bit with an install rather than just phpunit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants