Skip to content

Commit 4c5c176

Browse files
committed
Fix namespaces
1 parent 36a5120 commit 4c5c176

3 files changed

Lines changed: 15 additions & 13 deletions

File tree

modules/saml/src/Auth/Source/SP.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
use SimpleSAML\{Auth, Configuration, Error, IdP, Logger, Module, Session, Store, Utils};
99
use SimpleSAML\Assert\{Assert, AssertionFailedException};
1010
use SimpleSAML\Metadata\MetaDataStorageHandler;
11-
use SimpleSAML\SAML2\{AuthnRequest, Binding, LogoutRequest};
11+
use SimpleSAML\SAML2\Binding;
1212
use SimpleSAML\SAML2\Constants as C;
1313
use SimpleSAML\SAML2\Exception\ArrayValidationException;
1414
use SimpleSAML\SAML2\Exception\Protocol\{NoAvailableIDPException, NoPassiveException, NoSupportedIDPException};
1515
use SimpleSAML\SAML2\XML\md\ContactPerson;
1616
use SimpleSAML\SAML2\XML\saml\NameID;
1717
use SimpleSAML\SAML2\XML\saml\{AuthnContextClassRef};
1818
use SimpleSAML\SAML2\XML\samlp\{Extensions, IDPEntry, IDPList, RequestedAuthnContext, RequesterID, Scoping};
19+
use SimpleSAML\SAML2\XML\samlp\{AuthnRequest, LogoutRequest};
1920
use SimpleSAML\Store\StoreFactory;
2021
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
2122
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
@@ -658,7 +659,7 @@ private function startSSO2(Configuration $idpMetadata, array $state): Response
658659
* This function does not return.
659660
*
660661
* @param \SimpleSAML\SAML2\Binding $binding The binding.
661-
* @param \SimpleSAML\SAML2\AuthnRequest $ar The authentication request.
662+
* @param \SimpleSAML\SAML2\XML\samlp\AuthnRequest $ar The authentication request.
662663
*/
663664
public function sendSAML2AuthnRequest(Binding $binding, AuthnRequest $ar): Response
664665
{
@@ -673,7 +674,7 @@ public function sendSAML2AuthnRequest(Binding $binding, AuthnRequest $ar): Respo
673674
* This function does not return.
674675
*
675676
* @param \SimpleSAML\SAML2\Binding $binding The binding.
676-
* @param \SimpleSAML\SAML2\LogoutRequest $ar The logout request.
677+
* @param \SimpleSAML\SAML2\XML\samlp\LogoutRequest $ar The logout request.
677678
*/
678679
public function sendSAML2LogoutRequest(Binding $binding, LogoutRequest $lr): Response
679680
{

tests/Utils/SpTester.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
use ReflectionObject;
88
use SimpleSAML\Configuration;
99
use SimpleSAML\Module\saml\Auth\Source\SP;
10-
use SimpleSAML\SAML2\{AuthnRequest, Binding, LogoutRequest};
10+
use SimpleSAML\SAML2\Binding;
11+
use SimpleSAML\SAML2\XML\samlp\{AuthnRequest, LogoutRequest};
1112
use Symfony\Component\HttpFoundation\Response;
1213

1314
/**

tests/modules/saml/src/Auth/Source/SPTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
use SimpleSAML\Assert\AssertionFailedException;
1010
use SimpleSAML\Configuration;
1111
use SimpleSAML\Error\Exception;
12-
use SimpleSAML\SAML2\{AuthnRequest, LogoutRequest};
1312
use SimpleSAML\SAML2\Constants as C;
1413
use SimpleSAML\SAML2\Exception\Protocol\{NoAvailableIDPException, NoSupportedIDPException};
1514
use SimpleSAML\SAML2\Utils\XPath;
1615
use SimpleSAML\SAML2\XML\saml\AuthnContextClassRef;
1716
use SimpleSAML\SAML2\XML\saml\NameID;
17+
use SimpleSAML\SAML2\XML\samlp\{AuthnRequest, LogoutRequest};
1818
use SimpleSAML\SAML2\XML\samlp\{IDPEntry, IDPList};
1919
use SimpleSAML\Test\Metadata\MetaDataStorageSourceTest;
2020
use SimpleSAML\TestUtils\ClearStateTestCase;
@@ -120,15 +120,15 @@ protected function setUp(): void
120120
* @param array $state The state array to use in the test. This is an array of the parameters described in section
121121
* 2 of https://simplesamlphp.org/docs/development/saml:sp
122122
*
123-
* @return \SimpleSAML\SAML2\AuthnRequest The AuthnRequest generated.
123+
* @return \SimpleSAML\SAML2\XML\samlp\AuthnRequest The AuthnRequest generated.
124124
*/
125125
private function createAuthnRequest(array $state = []): AuthnRequest
126126
{
127127
$info = ['AuthId' => 'default-sp'];
128128
$config = ['entityID' => 'urn:x-simplesamlphp:example-sp'];
129129
$as = new SpTester($info, $config);
130130

131-
/** @var \SimpleSAML\SAML2\AuthnRequest $ar */
131+
/** @var \SimpleSAML\SAML2\XML\samlp\AuthnRequest $ar */
132132
$ar = null;
133133
try {
134134
$as->startSSO2Test($this->getIdpMetadata(), $state);
@@ -147,15 +147,15 @@ private function createAuthnRequest(array $state = []): AuthnRequest
147147
* @param array $state The state array to use in the test. This is an array of the parameters described in section
148148
* 2 of https://simplesamlphp.org/docs/development/saml:sp
149149
*
150-
* @return \SimpleSAML\SAML2\LogoutRequest The LogoutRequest generated.
150+
* @return \SimpleSAML\SAML2\XML\samlp\LogoutRequest The LogoutRequest generated.
151151
*/
152152
private function createLogoutRequest(array $state = []): LogoutRequest
153153
{
154154
$info = ['AuthId' => 'default-sp'];
155155
$config = ['entityID' => 'urn:x-simplesamlphp:example-sp'];
156156
$as = new SpTester($info, $config);
157157

158-
/** @var \SimpleSAML\SAML2\LogoutRequest $lr */
158+
/** @var \SimpleSAML\SAML2\XML\samlp\LogoutRequest $lr */
159159
$lr = null;
160160
try {
161161
$as->startSLO2($this->config, $state);
@@ -371,7 +371,7 @@ public function testIdpListWithExplicitIdpMatch(): void
371371
$this->fail('Expected ExitTestException');
372372
} catch (ExitTestException $e) {
373373
$r = $e->getTestResult();
374-
/** @var AuthnRequest $ar */
374+
/** @var \SimpleSAML\SAML2\XML\samlp\AuthnRequest $ar */
375375
$ar = $r['ar'];
376376
$xml = $ar->toSignedXML();
377377

@@ -412,7 +412,7 @@ public function testIdpListWithSingleMatch(): void
412412
$this->fail('Expected ExitTestException');
413413
} catch (ExitTestException $e) {
414414
$r = $e->getTestResult();
415-
/** @var AuthnRequest $ar */
415+
/** @var \SimpleSAML\SAML2\XML\samlp\AuthnRequest $ar */
416416
$ar = $r['ar'];
417417
$xml = $ar->toSignedXML();
418418

@@ -535,7 +535,7 @@ public function testRemoteMetadataScoping(): void
535535
];
536536
$as = new SpTester($info, $config);
537537

538-
/** @var \SimpleSAML\SAML2\AuthnRequest $ar */
538+
/** @var \SimpleSAML\SAML2\XML\samlp\AuthnRequest $ar */
539539
try {
540540
$as->startSSO2Test($this->getIdpMetadata(), []);
541541
$this->assertTrue(false, 'Expected ExitTestException');
@@ -576,7 +576,7 @@ public function testSPIdpListScopingOrder(
576576

577577
$as = new SpTester($info, $config);
578578

579-
/** @var \SimpleSAML\SAML2\AuthnRequest $ar */
579+
/** @var \SimpleSAML\SAML2\XML\samlp\AuthnRequest $ar */
580580
try {
581581
$as->startSSO2Test($this->getIdpMetadata(), $state);
582582
$this->assertTrue(false, 'Expected ExitTestException');

0 commit comments

Comments
 (0)