Skip to content

Migrate to xsd-types #374

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 8 additions & 2 deletions .github/workflows/interoperability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2']
php-versions: ['8.4']

steps:
- name: Setup PHP, with composer and extensions
Expand Down Expand Up @@ -80,8 +80,14 @@ jobs:
run: |
mkdir -p /tmp/metadata
wget https://mds.edugain.org/edugain-v2.xml -O /tmp/metadata/edugain.xml
wget https://technical.edugain.org/mds-v2.cer -O /tmp/metadataedugain-pub.crt
wget https://technical.edugain.org/mds-v2.cer -O /tmp/metadata/edugain-pub.crt

- name: Download eduID metadata & public key
if: steps.cache-metadata.outputs.cache-hit != 'true'
run: |
mkdir -p /tmp/metadata
wget https://metadata.eduid.cz/entities/eduid -O /tmp/metadata/eduid.xml
wget https://www.eduid.cz/docs/eduid/metadata/metadata.eduid.cz.crt.pem -O /tmp/metadata/eduid.crt

- name: Download GRNET metadata
if: steps.cache-metadata.outputs.cache-hit != 'true'
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"psr/http-message": "^2.0",
"psr/log": "^2.0 || ^3.0",
"simplesamlphp/assert": "~1.8.0",
"simplesamlphp/xml-common": "~1.24.0",
"simplesamlphp/xml-security": "~1.13.0",
"simplesamlphp/xml-soap": "~1.7.0"
"simplesamlphp/xml-common": "dev-feature/xsd-types",
"simplesamlphp/xml-security": "dev-feature/xsd-types",
"simplesamlphp/xml-soap": "dev-feature/xsd-types"
},
"require-dev": {
"ext-intl": "*",
Expand Down
2 changes: 2 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
<exclude-pattern>tests/SAML2/XML/saml/AuthnContextTest.php</exclude-pattern>
<exclude-pattern>tests/SAML2/XML/saml/EncryptedAssertionTest.php</exclude-pattern>
<exclude-pattern>tests/SAML2/XML/saml/EncryptedIDTest.php</exclude-pattern>
<exclude-pattern>tests/SAML2/XML/saml/SubjectConfirmationTest.php</exclude-pattern>
<exclude-pattern>tests/SAML2/XML/samlp/AuthnRequestTest.php</exclude-pattern>
<exclude-pattern>tests/SAML2/XML/samlp/RequestedAuthnContextTest.php</exclude-pattern>
<exclude-pattern>tests/SAML2/XML/samlp/StatusDetailTest.php</exclude-pattern>
<exclude-pattern>tests/SAML2/XML/shibmd/KeyAuthorityTest.php</exclude-pattern>
Expand Down
5 changes: 5 additions & 0 deletions phpstan-baseline-dev.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
parameters:
ignoreErrors:
-
message: "#^Dead catch \\- SimpleSAML\\\\Assert\\\\AssertionFailedException is never thrown in the try block\\.$#"
count: 1
path: tests/InterOperability/EntityDescriptorTest.php

-
message: "#^PHPDoc tag @var for property SimpleSAML\\\\Test\\\\SAML2\\\\Assertion\\\\Transformer\\\\NameIdDecryptionTransformerTest\\:\\:\\$validator with type SimpleSAML\\\\SAML2\\\\Response\\\\Validation\\\\Validator is incompatible with native type SimpleSAML\\\\SAML2\\\\Signature\\\\Validator\\.$#"
count: 1
Expand Down
187 changes: 131 additions & 56 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
parameters:
ignoreErrors:
-
message: "#^Call to an undefined method SimpleSAML\\\\SAML2\\\\XML\\\\samlp\\\\AbstractMessage\\:\\:addValidator\\(\\)\\.$#"
count: 1
path: src/Binding/HTTPArtifact.php

-
message: "#^Call to an undefined method SimpleSAML\\\\SAML2\\\\XML\\\\samlp\\\\ArtifactResponse\\:\\:validate\\(\\)\\.$#"
count: 1
path: src/Binding/HTTPArtifact.php

-
message: "#^Call to method addURLparameters\\(\\) on an unknown class SimpleSAML\\\\Utils\\\\HTTP\\.$#"
count: 1
path: src/Binding/HTTPArtifact.php

-
message: "#^Call to method getString\\(\\) on an unknown class SimpleSAML\\\\Configuration\\.$#"
count: 1
path: src/Binding/HTTPArtifact.php

-
message: "#^Call to static method addSign\\(\\) on an unknown class SimpleSAML\\\\Module\\\\saml\\\\Message\\.$#"
count: 1
Expand Down Expand Up @@ -27,168 +47,223 @@ parameters:

-
message: "#^Parameter \\$key of method SimpleSAML\\\\SAML2\\\\Binding\\\\HTTPArtifact\\:\\:validateSignature\\(\\) has invalid type SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
count: 1
count: 2
path: src/Binding/HTTPArtifact.php

-
message: "#^Parameter \\$sp of method SimpleSAML\\\\SAML2\\\\Binding\\\\HTTPArtifact\\:\\:setSPMetadata\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
count: 1
count: 2
path: src/Binding/HTTPArtifact.php

-
message: "#^Property SimpleSAML\\\\SAML2\\\\Binding\\\\HTTPArtifact\\:\\:\\$spMetadata has unknown class SimpleSAML\\\\Configuration as its type\\.$#"
count: 1
count: 2
path: src/Binding/HTTPArtifact.php

-
message: "#^Access to constant AES128_CBC on an unknown class SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
message: "#^Call to an undefined method SimpleSAML\\\\XMLSecurity\\\\XML\\\\ds\\\\SignatureValue\\:\\:getContent\\(\\)\\.$#"
count: 1
path: src/Certificate/PrivateKeyLoader.php
path: src/Binding/HTTPRedirect.php

-
message: "#^Access to constant RSA_1_5 on an unknown class SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
count: 1
path: src/Certificate/PrivateKeyLoader.php

-
message: "#^Access to property \\$passphrase on an unknown class SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
count: 2
path: src/Certificate/PrivateKeyLoader.php

-
message: "#^Call to method loadKey\\(\\) on an unknown class SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
count: 2
path: src/Certificate/PrivateKeyLoader.php

-
message: "#^Instantiated class SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey not found\\.$#"
count: 2
path: src/Certificate/PrivateKeyLoader.php

-
message: "#^Method SimpleSAML\\\\SAML2\\\\Certificate\\\\PrivateKeyLoader\\:\\:convertPrivateKeyToRsaKey\\(\\) has invalid return type SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
count: 1
count: 2
path: src/Certificate/PrivateKeyLoader.php

-
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:convertToIdentityProvider\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
message: "#^PHPDoc tag @param for parameter \\$qName with type SimpleSAML\\\\XML\\\\Type\\\\QNameValue\\|null is not subtype of native type SimpleSAML\\\\XML\\\\Type\\\\QNameValue\\.$#"
count: 1
path: src/Compat/AbstractContainer.php

-
message: "#^Call to method getArray\\(\\) on an unknown class SimpleSAML\\\\Configuration\\.$#"
count: 1
path: src/Configuration/SimpleSAMLConverter.php

-
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:convertToServiceProvider\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
message: "#^Call to method getBoolean\\(\\) on an unknown class SimpleSAML\\\\Configuration\\.$#"
count: 2
path: src/Configuration/SimpleSAMLConverter.php

-
message: "#^Call to method getString\\(\\) on an unknown class SimpleSAML\\\\Configuration\\.$#"
count: 10
path: src/Configuration/SimpleSAMLConverter.php

-
message: "#^Call to method getValue\\(\\) on an unknown class SimpleSAML\\\\Configuration\\.$#"
count: 1
path: src/Configuration/SimpleSAMLConverter.php

-
message: "#^Call to method hasValue\\(\\) on an unknown class SimpleSAML\\\\Configuration\\.$#"
count: 7
path: src/Configuration/SimpleSAMLConverter.php

-
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:convertToIdentityProvider\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
count: 2
path: src/Configuration/SimpleSAMLConverter.php

-
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:convertToServiceProvider\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
count: 2
path: src/Configuration/SimpleSAMLConverter.php

-
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:enrichForDecryptionProvider\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
count: 1
count: 2
path: src/Configuration/SimpleSAMLConverter.php

-
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:enrichForIdentityProvider\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
count: 1
count: 2
path: src/Configuration/SimpleSAMLConverter.php

-
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:enrichForServiceProvider\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
count: 1
count: 2
path: src/Configuration/SimpleSAMLConverter.php

-
message: "#^Parameter \\$configuration of method SimpleSAML\\\\SAML2\\\\Configuration\\\\SimpleSAMLConverter\\:\\:pluckConfiguration\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
count: 1
count: 2
path: src/Configuration/SimpleSAMLConverter.php

-
message: "#^Instantiated class SimpleSAML\\\\Utils\\\\Config not found\\.$#"
message: "#^Access to property \\$key on an unknown class SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
count: 1
path: src/SOAPClient.php

-
message: "#^Instantiated class SimpleSAML\\\\Utils\\\\Crypto not found\\.$#"
message: "#^Call to an undefined method SimpleSAML\\\\SAML2\\\\XML\\\\samlp\\\\AbstractMessage\\:\\:addValidator\\(\\)\\.$#"
count: 1
path: src/SOAPClient.php

-
message: "#^Parameter \\$dstMetadata of method SimpleSAML\\\\SAML2\\\\SOAPClient\\:\\:send\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
message: "#^Call to method getCertPath\\(\\) on an unknown class SimpleSAML\\\\Utils\\\\Config\\.$#"
count: 1
path: src/SOAPClient.php

-
message: "#^Parameter \\$key of method SimpleSAML\\\\SAML2\\\\SOAPClient\\:\\:validateSSL\\(\\) has invalid type SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
message: "#^Call to method getPublicKeys\\(\\) on an unknown class SimpleSAML\\\\Configuration\\.$#"
count: 1
path: src/SOAPClient.php

-
message: "#^Parameter \\$srcMetadata of method SimpleSAML\\\\SAML2\\\\SOAPClient\\:\\:send\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
count: 1
message: "#^Call to method getString\\(\\) on an unknown class SimpleSAML\\\\Configuration\\.$#"
count: 3
path: src/SOAPClient.php

-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 2
path: src/XML/md/AbstractEndpointType.php
message: "#^Call to method getValue\\(\\) on an unknown class SimpleSAML\\\\Configuration\\.$#"
count: 3
path: src/SOAPClient.php

-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 2
path: src/XML/md/AbstractIndexedEndpointType.php
message: "#^Call to method hasValue\\(\\) on an unknown class SimpleSAML\\\\Configuration\\.$#"
count: 5
path: src/SOAPClient.php

-
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\AbstractRoleDescriptor\\)\\:\\:XSI_TYPE_NAME\\.$#"
count: 2
path: src/XML/md/AbstractRoleDescriptor.php
message: "#^Call to method loadPrivateKey\\(\\) on an unknown class SimpleSAML\\\\Utils\\\\Crypto\\.$#"
count: 1
path: src/SOAPClient.php

-
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\AbstractRoleDescriptor\\)\\:\\:XSI_TYPE_NAMESPACE\\.$#"
count: 2
path: src/XML/md/AbstractRoleDescriptor.php
message: "#^Call to method loadPublicKey\\(\\) on an unknown class SimpleSAML\\\\Utils\\\\Crypto\\.$#"
count: 1
path: src/SOAPClient.php

-
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\AbstractRoleDescriptor\\)\\:\\:XSI_TYPE_PREFIX\\.$#"
count: 2
path: src/XML/md/AbstractRoleDescriptor.php
message: "#^Instantiated class SimpleSAML\\\\Utils\\\\Config not found\\.$#"
count: 1
path: src/SOAPClient.php

-
message: "#^Call to an undefined static method SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\AbstractSignedMdElement\\:\\:getXsiTypeNamespaceURI\\(\\)\\.$#"
message: "#^Instantiated class SimpleSAML\\\\Utils\\\\Crypto not found\\.$#"
count: 1
path: src/XML/md/AbstractSignedMdElement.php
path: src/SOAPClient.php

-
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractBaseID\\)\\:\\:XSI_TYPE_NAME\\.$#"
message: "#^Parameter \\$dstMetadata of method SimpleSAML\\\\SAML2\\\\SOAPClient\\:\\:send\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
count: 2
path: src/XML/saml/AbstractBaseID.php
path: src/SOAPClient.php

-
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractBaseID\\)\\:\\:XSI_TYPE_NAMESPACE\\.$#"
message: "#^Parameter \\$key of method SimpleSAML\\\\SAML2\\\\SOAPClient\\:\\:validateSSL\\(\\) has invalid type SimpleSAML\\\\XMLSecurity\\\\XMLSecurityKey\\.$#"
count: 2
path: src/XML/saml/AbstractBaseID.php
path: src/SOAPClient.php

-
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractBaseID\\)\\:\\:XSI_TYPE_PREFIX\\.$#"
message: "#^Parameter \\$srcMetadata of method SimpleSAML\\\\SAML2\\\\SOAPClient\\:\\:send\\(\\) has invalid type SimpleSAML\\\\Configuration\\.$#"
count: 2
path: src/XML/saml/AbstractBaseID.php
path: src/SOAPClient.php

-
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractCondition\\)\\:\\:XSI_TYPE_NAME\\.$#"
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 2
path: src/XML/saml/AbstractCondition.php
path: src/XML/md/AbstractEndpointType.php

-
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractCondition\\)\\:\\:XSI_TYPE_NAMESPACE\\.$#"
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 2
path: src/XML/saml/AbstractCondition.php
path: src/XML/md/AbstractIndexedEndpointType.php

-
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractCondition\\)\\:\\:XSI_TYPE_PREFIX\\.$#"
message: "#^Unsafe usage of new static\\(\\)\\.$#"
count: 2
path: src/XML/saml/AbstractCondition.php
path: src/XML/md/AbstractLocalizedName.php

-
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractStatement\\)\\:\\:XSI_TYPE_NAME\\.$#"
count: 2
path: src/XML/saml/AbstractStatement.php
message: "#^Call to an undefined static method SimpleSAML\\\\SAML2\\\\XML\\\\md\\\\AbstractSignedMdElement\\:\\:getXsiTypeNamespaceURI\\(\\)\\.$#"
count: 1
path: src/XML/md/AbstractSignedMdElement.php

-
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractStatement\\)\\:\\:XSI_TYPE_NAMESPACE\\.$#"
count: 2
path: src/XML/saml/AbstractStatement.php
message: "#^Call to an undefined method SimpleSAML\\\\XML\\\\AbstractElement\\:\\:getList\\(\\)\\.$#"
count: 1
path: src/XML/md/ContactPerson.php

-
message: "#^Access to undefined constant static\\(SimpleSAML\\\\SAML2\\\\XML\\\\saml\\\\AbstractStatement\\)\\:\\:XSI_TYPE_PREFIX\\.$#"
count: 2
path: src/XML/saml/AbstractStatement.php
message: "#^Call to an undefined method SimpleSAML\\\\XML\\\\AbstractElement\\:\\:getList\\(\\)\\.$#"
count: 1
path: src/XML/md/EntitiesDescriptor.php

-
message: "#^Call to an undefined method SimpleSAML\\\\XML\\\\AbstractElement\\:\\:getList\\(\\)\\.$#"
count: 1
path: src/XML/md/Organization.php

-
message: "#^Call to an undefined method DOMDocument\\:\\:setAttribute\\(\\)\\.$#"
count: 1
path: src/XML/mdui/Keywords.php

-
message: "#^Call to an undefined method SimpleSAML\\\\XML\\\\Type\\\\ValueTypeInterface\\:\\:toArray\\(\\)\\.$#"
count: 1
path: src/XML/mdui/Keywords.php

-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
level: 1
level: 2
paths:
- src
includes:
Expand Down
Loading
Loading