Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
MKodde committed Feb 5, 2018
2 parents e723684 + c00ffdf commit 9d0fb14
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 54 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ information via EngineBlock's internal API.

## Requirements
- PHP 5.6
- EngineBlock >= 5.2.0
- EngineBlock >= 5.5.0

## Development
To setup your development environment, run `vagrant up` in the project directory.
Expand Down
Binary file removed app/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"sensio/framework-extra-bundle": "^3.0.2",
"doctrine/instantiator": "1.0.*",
"incenteev/composer-parameter-handler": "~2.0",
"surfnet/stepup-saml-bundle": "^2.6.1",
"surfnet/stepup-saml-bundle": "^3.0",
"jms/translation-bundle": "^1.1",
"jms/di-extra-bundle": "^1.1",
"twig/twig": "^1.34.4",
Expand Down
69 changes: 38 additions & 31 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/OpenConext/Profile/Entity/AuthenticatedUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static function createFrom(AssertionAdapter $assertionAdapter, array $aut
}

$eptiValues = $attribute->getValue();
$attributes[] = new Attribute($definition, [$eptiValues[0]['Value']]);
$attributes[] = new Attribute($definition, [$eptiValues[0]->value]);
}

return new self($assertionAdapter->getNameId(), AttributeSet::create($attributes), $authenticatingAuthorities);
Expand Down
20 changes: 10 additions & 10 deletions src/OpenConext/Profile/Tests/Entity/AuthenticatedUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
use OpenConext\Profile\Entity\AuthenticatedUser;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
use SAML2_Assertion;
use SAML2_Compat_ContainerSingleton;
use SAML2_DOMDocumentFactory;
use SAML2_Exception_RuntimeException;
use SAML2\Assertion;
use SAML2\Compat\ContainerSingleton;
use SAML2\DOMDocumentFactory;
use SAML2\Exception\RuntimeException;
use Surfnet\SamlBundle\SAML2\Attribute\Attribute;
use Surfnet\SamlBundle\SAML2\Attribute\AttributeDefinition;
use Surfnet\SamlBundle\SAML2\Attribute\AttributeDictionary;
Expand All @@ -40,7 +40,7 @@ class AuthenticatedUserTest extends TestCase
*/
public function setUp()
{
SAML2_Compat_ContainerSingleton::setContainer(new BridgeContainer(new NullLogger()));
ContainerSingleton::setContainer(new BridgeContainer(new NullLogger()));
}

/**
Expand Down Expand Up @@ -140,7 +140,7 @@ public function attributes_are_filtered_when_creating_an_authenticated_user()
*/
public function epti_attribute_cannot_be_set_if_its_value_has_multiple_name_ids_when_creating_an_authenticated_user()
{
$this->expectException(SAML2_Exception_RuntimeException::class, 'must be a NameID');
$this->expectException(RuntimeException::class, 'must be a NameID');

$assertionWithEpti = $this->getAssertionWithEptiWithTooManyValues();
$attributeDictionary = $this->getAttributeDictionary();
Expand All @@ -161,7 +161,7 @@ public function epti_attribute_cannot_be_set_if_its_value_has_multiple_name_ids_
*/
public function epti_attribute_cannot_be_set_if_its_value_has_no_name_id_when_creating_an_authenticated_user()
{
$this->expectException(SAML2_Exception_RuntimeException::class, 'must be a NameID');
$this->expectException(RuntimeException::class, 'must be a NameID');

$assertionWithEpti = $this->getAssertionWithEptiWithoutValues();
$attributeDictionary = $this->getAttributeDictionary();
Expand Down Expand Up @@ -257,7 +257,7 @@ private function getAssertionWithEpti()
</saml:Assertion>
XML;

return new SAML2_Assertion(SAML2_DOMDocumentFactory::fromString($xml)->firstChild);
return new Assertion(DOMDocumentFactory::fromString($xml)->firstChild);
}

private function getAssertionWithEptiWithoutValues()
Expand All @@ -284,7 +284,7 @@ private function getAssertionWithEptiWithoutValues()
</saml:Assertion>
XML;

return new SAML2_Assertion(SAML2_DOMDocumentFactory::fromString($xml)->firstChild);
return new Assertion(DOMDocumentFactory::fromString($xml)->firstChild);
}

private function getAssertionWithEptiWithTooManyValues()
Expand Down Expand Up @@ -314,6 +314,6 @@ private function getAssertionWithEptiWithTooManyValues()
</saml:Assertion>
XML;

return new SAML2_Assertion(SAML2_DOMDocumentFactory::fromString($xml)->firstChild);
return new Assertion(DOMDocumentFactory::fromString($xml)->firstChild);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace OpenConext\ProfileBundle\Attribute;

use SAML2_Assertion;
use SAML2\Assertion;
use Surfnet\SamlBundle\Exception\UnknownUrnException;
use Surfnet\SamlBundle\SAML2\Attribute\Attribute;
use Surfnet\SamlBundle\SAML2\Attribute\AttributeDefinition;
Expand All @@ -29,7 +29,7 @@

final class AttributeSetWithFallbacks extends AttributeSet implements AttributeSetFactory, AttributeSetInterface
{
public static function createFrom(SAML2_Assertion $assertion, AttributeDictionary $attributeDictionary)
public static function createFrom(Assertion $assertion, AttributeDictionary $attributeDictionary)
{
$attributeSet = new AttributeSetWithFallbacks();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ public function initiateSamlRequest()

/**
* @param Request $request
* @return \SAML2_Assertion
* @return \SAML2\Assertion
*/
public function processSamlResponse(Request $request)
{
/** @var \SAML2_Assertion $assertion */
/** @var \SAML2\Assertion $assertion */
$assertion = $this->postBinding->processResponse(
$request,
$this->identityProvider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
class SamlToken extends AbstractToken
{
/**
* @var \SAML2_Assertion
* @var \SAML2\Assertion
*/
public $assertion;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use OpenConext\ProfileBundle\Saml\StateHandler;
use OpenConext\ProfileBundle\Security\Authentication\SamlInteractionProvider;
use OpenConext\ProfileBundle\Security\Authentication\Token\SamlToken;
use SAML2_Response_Exception_PreconditionNotMetException as PreconditionNotMetException;
use SAML2\Response\Exception\PreconditionNotMetException;
use Surfnet\SamlBundle\Http\Exception\AuthnFailedSamlResponseException;
use Surfnet\SamlBundle\SAML2\Response\Assertion\InResponseTo;
use Symfony\Component\HttpFoundation\RedirectResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Mockery;
use OpenConext\ProfileBundle\Attribute\AttributeSetWithFallbacks;
use PHPUnit\Framework\TestCase;
use SAML2_Assertion;
use SAML2\Assertion;
use Surfnet\SamlBundle\SAML2\Attribute\Attribute;
use Surfnet\SamlBundle\SAML2\Attribute\AttributeDefinition;
use Surfnet\SamlBundle\SAML2\Attribute\AttributeDictionary;
Expand All @@ -39,7 +39,7 @@ class AttributeSetWithFallbacksTest extends TestCase
*/
public function attribute_set_with_fallbacks_can_be_configured_when_creating_an_assertion_adapter()
{
$assertion = Mockery::mock(SAML2_Assertion::class);
$assertion = Mockery::mock(Assertion::class);
$assertion
->shouldReceive('getAttributes')
->andReturn([]);
Expand Down Expand Up @@ -68,7 +68,7 @@ public function attribute_set_with_fallbacks_contains_an_attribute_with_an_exist

$attributeDefinition = new AttributeDefinition('some-attribute', $attributeMaceUrn);

$assertion = Mockery::mock(SAML2_Assertion::class);
$assertion = Mockery::mock(Assertion::class);
$assertion
->shouldReceive('getAttributes')
->andReturn([
Expand Down Expand Up @@ -97,7 +97,7 @@ public function attribute_set_with_fallbacks_falls_back_to_the_the_received_urn_
$undefinedAttributeUrn = 'urn:mace:not-defined';
$attributeValue = ['some-value'];

$assertion = Mockery::mock(SAML2_Assertion::class);
$assertion = Mockery::mock(Assertion::class);
$assertion
->shouldReceive('getAttributes')
->andReturn([
Expand Down

0 comments on commit 9d0fb14

Please sign in to comment.