Skip to content

Commit

Permalink
Get the app back up and running (CLI)
Browse files Browse the repository at this point in the history
  • Loading branch information
MKodde committed Oct 31, 2023
1 parent fd37bf9 commit 528c830
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 23 deletions.
5 changes: 1 addition & 4 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ framework:
secret: '%env(APP_SECRET)%'
csrf_protection: true
http_method_override: true

error_controller: Surfnet\AzureMfa\Infrastructure\Controller\ExceptionController::showAction
# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
Expand All @@ -17,6 +17,3 @@ framework:
fragments: false
php_errors:
log: false
templating:
engines:
- twig
8 changes: 0 additions & 8 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ security:
pattern: ^/(info|health)$
security: false

main:
anonymous: true

# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#firewalls-authentication

# https://symfony.com/doc/current/security/impersonating_user.html
# switch_user: true

# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
Expand Down
2 changes: 1 addition & 1 deletion config/packages/test/parameters.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
parameters:
# overridden for test (behat)
saml_remote_sp_certificate: '%kernel.root_dir%/../../../../vendor/surfnet/stepup-saml-bundle/src/Resources/keys/development_publickey.cer'
saml_remote_sp_certificate: '%kernel.project_dir%/../../../../vendor/surfnet/stepup-saml-bundle/src/Resources/keys/development_publickey.cer'
ra_issuer_entity_id_regex: '@@^https://azuremfa.stepup.example.com/saml/metadata$@'
1 change: 0 additions & 1 deletion config/packages/twig.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
twig:
exception_controller: Surfnet\AzureMfa\Infrastructure\Controller\ExceptionController::showAction
default_path: '%kernel.project_dir%/templates'
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getSsoLocation() : Destination;

public function getCertificates() : CertificateCollection;

public function getEntityId() : EntityId;
public function getEntityId() : ?string;

public function isAzureAD() : bool;
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function showAction(Request $request, Exception $exception)
* @param Exception $exception
* @return array View parameters 'title' and 'description'
*/
protected function getPageTitleAndDescription(Exception $exception)
protected function getPageTitleAndDescription(Exception $exception): array
{
return parent::getPageTitleAndDescription($exception);
}
Expand All @@ -71,7 +71,7 @@ protected function getPageTitleAndDescription(Exception $exception)
* @param Exception $exception
* @return int HTTP status code
*/
protected function getStatusCode(Exception $exception)
protected function getStatusCode(Exception $exception): int
{
return parent::getStatusCode($exception);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public function __construct(EntityId $entityId, Destination $destination, Certif
parent::__construct($configuration);
}

public function getEntityId() : EntityId
public function getEntityId() : ?string
{
return new EntityId(parent::getEntityId());
return parent::getEntityId();
}

public function getSsoLocation(): Destination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ public function test_happy_flow() : void

$this->assertEquals('institution-a.example.com', $institutionA->getName());
$this->assertInstanceOf(Destination::class, $institutionA->getIdentityProvider()->getSsoLocation());
$this->assertInstanceOf(EntityId::class, $institutionA->getIdentityProvider()->getEntityId());
$this->assertEquals('https://adfs.stepup.example.com/adfs/ls/', $institutionA->getIdentityProvider()->getSsoLocation()->getUrl());
$this->assertEquals('https://adfs.harting-college.nl/', $harting->getIdentityProvider()->getEntityId()->getEntityId());
$this->assertEquals('https://adfs.harting-college.nl/', $harting->getIdentityProvider()->getEntityId());

// Todo: at this point we do not know how we want to work with this collection. Update test coverage once this becomes clear!
$this->assertInstanceOf(EmailDomainCollection::class, $institutionA->getEmailDomainCollection());
Expand All @@ -80,7 +79,7 @@ public function test_happy_flow() : void
$this->assertInstanceOf(Destination::class, $harting->getIdentityProvider()->getSsoLocation());
$this->assertInstanceOf(EntityId::class, $harting->getIdentityProvider()->getEntityId());
$this->assertEquals('https://adfs.harting-college.nl/adfs/ls/', $harting->getIdentityProvider()->getSsoLocation()->getUrl());
$this->assertEquals('https://adfs.harting-college.nl/', $harting->getIdentityProvider()->getEntityId()->getEntityId());
$this->assertEquals('https://adfs.harting-college.nl/', $harting->getIdentityProvider()->getEntityId());
$this->assertInstanceOf(EmailDomainCollection::class, $harting->getEmailDomainCollection());
$this->assertInstanceOf(CertificateCollection::class, $harting->getIdentityProvider()->getCertificates());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function test_build()
->andReturn('certData');

$identityProvider = $factory->build($entityId, $ssoLocation, $certCollection, false);
$this->assertEquals('entityId', $identityProvider->getEntityId()->getEntityId());
$this->assertEquals('entityId', $identityProvider->getEntityId());
$this->assertEquals('https://sso-location.example.com', $identityProvider->getSsoLocation()->getUrl());
$this->assertEquals('certData', $identityProvider->getCertificates()->first()->getCertData());
$this->assertEquals(false, $identityProvider->isAzureAD());
Expand Down

0 comments on commit 528c830

Please sign in to comment.