Skip to content

Conversation

@woodseowl
Copy link
Contributor

Addresses the optional possibility of multiple certs from an IdP (for instance, supporting key rollover).

This happened on the Weill Apollo test site and this was the solution.

@woodseowl woodseowl requested a review from Copilot January 26, 2026 22:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for handling multiple X.509 certificates from an Identity Provider (IdP), which is necessary for scenarios like certificate key rollover. The implementation detects whether the IdP provides multiple certificates and stores them accordingly.

Changes:

  • Modified certificate retrieval to handle both single and multiple certificate formats
  • Added storage mechanism for multiple certificates using JSON format
  • Updated PHP testing matrix to include PHP 8.5

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Commands/GenerateKeys.php Implements logic to detect and store multiple certificates in JSON format, or single certificate in PEM format
config/php-saml-toolkit.php Dynamically loads multiple certificates from JSON file if it exists
.github/workflows/phpunit.yml Adds PHP 8.5 to the test matrix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +270 to +272
'x509certMulti' => (file_exists($cert_path.'/idp_cert_multi.json'))
? json_decode(file_get_contents($cert_path.'/idp_cert_multi.json'), true)
: null,
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The json_decode call lacks error handling. If the JSON file is corrupted or contains invalid JSON, this will silently fail and return null, which could be confused with the intentional null for missing files. Consider validating the JSON decode result or handling JSON_ERROR_NONE to distinguish between missing files and malformed JSON.

Copilot uses AI. Check for mistakes.
@woodseowl woodseowl merged commit d21450a into main Jan 26, 2026
9 checks passed
@woodseowl woodseowl deleted the x509-multi branch January 26, 2026 22:02
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.

2 participants