@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | use Symfony\Component\Dotenv\Dotenv; |
| 4 | 4 | |
| 5 | -require dirname(__DIR__).'/vendor/autoload.php'; |
|
| 5 | +require dirname(__DIR__) . '/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | if (!class_exists(Dotenv::class)) { |
| 8 | 8 | throw new LogicException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); |
@@ -10,11 +10,11 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | // Load cached env vars if the .env.local.php file exists |
| 12 | 12 | // Run "composer dump-env prod" to create it (requires symfony/flex >=1.2) |
| 13 | -if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) { |
|
| 13 | +if (is_array($env = @include dirname(__DIR__) . '/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) { |
|
| 14 | 14 | (new Dotenv(false))->populate($env); |
| 15 | 15 | } else { |
| 16 | 16 | // load all the .env files |
| 17 | - (new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env'); |
|
| 17 | + (new Dotenv(false))->loadEnv(dirname(__DIR__) . '/.env'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | $_SERVER += $_ENV; |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | use Symfony\Component\ErrorHandler\Debug; |
| 5 | 5 | use Symfony\Component\HttpFoundation\Request; |
| 6 | 6 | |
| 7 | -require dirname(__DIR__).'/config/bootstrap.php'; |
|
| 7 | +require dirname(__DIR__) . '/config/bootstrap.php'; |
|
| 8 | 8 | |
| 9 | 9 | if ($_SERVER['APP_DEBUG']) { |
| 10 | 10 | umask(0000); |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | public function anInstitutionThatAllows(string $institution, string $option) |
| 193 | 193 | { |
| 194 | - switch(true) { |
|
| 194 | + switch (true) { |
|
| 195 | 195 | case $option === 'sso_on_2fa': |
| 196 | 196 | $optionColumnName = 'sso_on2fa_enabled'; |
| 197 | 197 | break; |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | private function getCookieNames(array $responseCookieHeaders): array |
| 311 | 311 | { |
| 312 | 312 | $response = []; |
| 313 | - foreach($responseCookieHeaders as $cookie) { |
|
| 313 | + foreach ($responseCookieHeaders as $cookie) { |
|
| 314 | 314 | $parts = explode('=', $cookie); |
| 315 | 315 | $response[] = array_shift($parts); |
| 316 | 316 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $request = Saml2AuthnRequest::createNew($authnRequest); |
| 201 | 201 | $query = $request->buildRequestQuery(); |
| 202 | 202 | |
| 203 | - $this->getSession()->visit($request->getDestination().'?'.$query); |
|
| 203 | + $this->getSession()->visit($request->getDestination() . '?' . $query); |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | /** |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | ); |
| 257 | 257 | $request = Saml2AuthnRequest::createNew($authnRequest); |
| 258 | 258 | $query = $request->buildRequestQuery(); |
| 259 | - $this->getSession()->visit($authnRequest->getDestination().'?'.$query); |
|
| 259 | + $this->getSession()->visit($authnRequest->getDestination() . '?' . $query); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | $request = Saml2AuthnRequest::createNew($authnRequest); |
| 299 | 299 | $query = $request->buildRequestQuery(); |
| 300 | - $this->getSession()->visit($request->getDestination().'?'.$query); |
|
| 300 | + $this->getSession()->visit($request->getDestination() . '?' . $query); |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | { |
| 105 | 105 | $newAssertion = new Assertion(); |
| 106 | 106 | $newAssertion->setNotBefore(time()); |
| 107 | - $newAssertion->setNotOnOrAfter(time() + (60 * 5));// |
|
| 107 | + $newAssertion->setNotOnOrAfter(time() + (60 * 5)); // |
|
| 108 | 108 | $newAssertion->setAttributes(['urn:mace:dir:attribute-def:eduPersonTargetedID' => [NameID::fromArray($nameId)]]); |
| 109 | 109 | $newAssertion->setIssuer('https://idp.stepup.example.com/'); |
| 110 | 110 | $newAssertion->setIssueInstant(time()); |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | use App\Kernel; |
| 4 | 4 | use Symfony\Component\HttpFoundation\Request; |
| 5 | 5 | |
| 6 | -require dirname(__DIR__).'/config/bootstrap.php'; |
|
| 6 | +require dirname(__DIR__) . '/config/bootstrap.php'; |
|
| 7 | 7 | |
| 8 | 8 | $kernel = new Kernel('test', false); |
| 9 | 9 | $request = Request::createFromGlobals(); |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | $this->hostedIdentityProvider = $hostedIdentityProvider; |
| 67 | 67 | $this->proxyStateHandler = $proxyStateHandler; |
| 68 | 68 | $this->assertionSigningService = $assertionSigningService; |
| 69 | - $this->currentTime = is_null($now) ? new DateTime('now', new DateTimeZone('UTC')): $now; |
|
| 69 | + $this->currentTime = is_null($now) ? new DateTime('now', new DateTimeZone('UTC')) : $now; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -133,7 +133,7 @@ |
||
| 133 | 133 | $this->getSecondFactorRespondService()->resetRespondState($responseContext); |
| 134 | 134 | |
| 135 | 135 | // Handle SAML response |
| 136 | - $httpResponse = $responseRendering->renderResponse($responseContext, $response, $request); |
|
| 136 | + $httpResponse = $responseRendering->renderResponse($responseContext, $response, $request); |
|
| 137 | 137 | |
| 138 | 138 | $ssoCookieService = $this->get('gateway.service.sso_2fa_cookie'); |
| 139 | 139 | $ssoCookieService->handleSsoOn2faCookieStorage($responseContext, $request, $httpResponse, 'sfo'); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | ->scalarNode('http_basic_realm') |
| 34 | 34 | ->defaultValue('Secure Gateway API') |
| 35 | 35 | ->validate() |
| 36 | - ->ifTrue(function ($realm) { |
|
| 36 | + ->ifTrue(function($realm) { |
|
| 37 | 37 | return !is_string($realm) || empty($realm); |
| 38 | 38 | }) |
| 39 | 39 | ->thenInvalid("Invalid HTTP Basic realm '%s'. Must be string and non-empty.") |