-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[SecurityBundle] Fix semantic configuration for singulars/plurals in XML #61714
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
Conversation
nicolas-grekas
commented
Sep 10, 2025
| Q | A |
|---|---|
| Branch? | 7.3 |
| Bug fix? | yes |
| New feature? | no |
| Deprecations? | no |
| Issues | - |
| License | MIT |
nicolas-grekas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please approve #60568 @symfony/mergers
| ->arrayNode($this->getKey()) | ||
| ->fixXmlConfig($this->getKey()) | ||
| ->fixXmlConfig('issuer') | ||
| ->fixXmlConfig('algorithm') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done in 7.3: while both keys algorithm and algorithms exist, they are coalesced in the end.
| <xsd:complexType name="config"> | ||
| <xsd:choice maxOccurs="unbounded"> | ||
| <xsd:element name="access-decision-manager" type="access_decision_manager" minOccurs="0" maxOccurs="1" /> | ||
| <xsd:element name="password_hashers" type="password_hashers" minOccurs="0" maxOccurs="1" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This XSD doesn't follow any existing practice (the same issue is fixed for a few other keys below).
Note that the resulting config tree is going to be exactly the same.
It's just validation that might fail if anyone uses XML to define these semantic trees.
This will happen at compile time, so really easy to spot and fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed more standard this way.
These are breaking changes if the old version worked and was valid for the XSD.
Perhaps it would be better to apply these changes in 7.4 only? Or is this a way to trigger potential users of the XML configuration to express themselves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is :) + an invitation to fix their config!
|
Wow thanks for digging into that mess. Can we somehow ensure this for the future via automatic checks? |
That's something to be careful during reviews. |
src/Symfony/Bundle/SecurityBundle/Resources/config/schema/security-1.0.xsd
Outdated
Show resolved
Hide resolved
I'll try to think about how this could be done. |
143a075 to
61e1879
Compare
61e1879 to
a94730f
Compare
|
I figured more XSD mismatches, see https://github.com/symfony/symfony/compare/61e187964ffe16ac4d328f10e9a3fcfbac4765ee..a94730f3b8a3bd7df7b57d7296e58a92c356881c |