-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uml 3013 kick off one login process (#2369)
* Initial landing page and route, structure behat test * Add landing page with button and add test step * One login page behind feature flag * Add one login form, submit button produces logger output * Fix linting errors * Button returns 200 status - Link factory classes in configProvider, api returns array * AuthoriseOneLoginHandler sends request with en or cy * Add unit test coverage * Clicking button sends us to redirect pag, change login flag * Add unit test for OneLoginForm and fix failing api-app test * Add SecretsManagerFactoryTest --------- Co-authored-by: Sam Ainsworth <[email protected]>
- Loading branch information
Showing
19 changed files
with
383 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
service-api/app/src/App/src/Service/Aws/SecretsManagerFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Service\Aws; | ||
|
||
use Aws\Sdk; | ||
use Psr\Container\ContainerInterface; | ||
|
||
/** | ||
* Builds a configured instance of the AWS Secrets Manager Client | ||
*/ | ||
class SecretsManagerFactory | ||
{ | ||
public function __invoke(ContainerInterface $container) | ||
{ | ||
return $container->get(Sdk::class)->createSecretsManager(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
service-api/app/test/AppTest/Service/Aws/SecretsManagerFactoryTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace AppTest\Service\Aws; | ||
|
||
use App\Service\Aws\SecretsManagerFactory; | ||
use Aws\Sdk; | ||
use Aws\SecretsManager\SecretsManagerClient; | ||
use Monolog\Test\TestCase; | ||
use Prophecy\PhpUnit\ProphecyTrait; | ||
use Psr\Container\ContainerInterface; | ||
|
||
class SecretsManagerFactoryTest extends TestCase | ||
{ | ||
use ProphecyTrait; | ||
|
||
/** @test */ | ||
public function it_creates_a_SecretsManager(): void | ||
{ | ||
$containerProphecy = $this->prophesize(ContainerInterface::class); | ||
|
||
$containerProphecy->get(Sdk::class) | ||
->willReturn(new Sdk([ | ||
'region' => 'eu-west-1', | ||
'version' => 'latest', | ||
])); | ||
|
||
$factory = new SecretsManagerFactory(); | ||
$client = $factory($containerProphecy->reveal()); | ||
|
||
$this->assertInstanceOf(SecretsManagerClient::class, $client); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@onelogin | ||
Feature: Authenticate One Login | ||
|
||
@ui @actor @ff:allow_gov_one_login:true | ||
Scenario: I initiate authentication via one login | ||
Given I am on the temporary one login page | ||
When I click the one login button | ||
Then I am redirected to the redirect page |
Oops, something went wrong.