Skip to content

Allow guzzlehttp/psr7 3 - #102

Open
sinemacula-ben wants to merge 1 commit into
simplesamlphp:release-2.8from
sinemacula-ben:allow-psr7-3
Open

sinemacula-ben wants to merge 1 commit into
simplesamlphp:release-2.8from
sinemacula-ben:allow-psr7-3

Conversation

@sinemacula-ben

Copy link
Copy Markdown

Guzzle 8 requires guzzlehttp/psr7 3. The 2.x line pins psr7 to ~2.8, so any application on saml2 v6 is held on Guzzle 7, and an application already on Guzzle 8 is downgraded when it installs saml2:

- simplesamlphp/saml2[v6.2.5, ..., v6.3.3] require simplesamlphp/xml-common ~2.8
- simplesamlphp/xml-common[v2.7.5, ..., v2.8.2] require guzzlehttp/psr7 ~2.8
- guzzlehttp/guzzle[8.0.1, ..., 8.5.5] require guzzlehttp/psr7 ^3.0 (8.5.3 and later ^3.5.1)

This widens the constraint to ~2.8 || ^3.0. The only user is AnyURIValue, which calls new Uri() and UriNormalizer::isEquivalent(), and both are unchanged in psr7 3. simplesamlphp/assert 2.x pins psr7 the same way, so psr7 3 installs only once both are widened. The assert change is simplesamlphp/assert#44.

Tested

Tested with this change plus the assert change, installed from a local path repository:

Branch PHP psr7 2.13.6 psr7 3.6.0
release-2.8 8.3.37 1442 tests, 4 errors same 4 errors
release-2.8 8.5.8 1442 tests, 4 errors same 4 errors
release-2.7 (the same change) 8.5.8 1425 tests, 4 errors same 4 errors

PHPStan reports no errors with either major.

The 4 errors fail the same way on psr7 2 and on unmodified release-2.8. They are the testExternalEntityCannotReadLocalFile* tests in DOMDocumentFactoryTest: Class "SimpleSAML\Test\XML\DOMDocument" not found. The test file uses DOMDocument inside a namespace without a use or a leading backslash.

saml2's own suite gives the same results on both majors with both changes installed:

  • release-6.3: 1166 tests OK, 2 skipped.
  • release-6.2: the same 3 errors and 2 failures as on psr7 2.

saml2 and xml-security do not use psr7 directly.

Behaviour with psr7 3

psr7 3 parses URIs more strictly, so AnyURIValue rejects a few values that 2.x accepted. Each of them is already invalid under RFC 3986:

  • a scheme that does not start with a letter;
  • a malformed IP literal;
  • an invalid percent-encoding in the host.

isEquivalent() also canonicalises IPv6 hosts, so [0:0:0:0:0:0:0:1] and [::1] compare equal.

Other lines

  • release-2.7 pins ~2.8 too, and saml2 6.1.x uses it (~2.7.0). The same change passes there, as the table shows. I can open it against that branch as well.
  • release-1.x does not require psr7 directly. It reaches psr7 through assert 1.x, which the assert PR covers.
  • release-3.x and master do not require psr7.

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.

1 participant