-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide nameIdFormat when unspecified
#668
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
namespace Surfnet\ServiceProviderDashboard\Webtests; | ||
|
||
use Surfnet\ServiceProviderDashboard\Application\Service\AttributeService; | ||
use Surfnet\ServiceProviderDashboard\Domain\Entity\Constants; | ||
use Surfnet\ServiceProviderDashboard\Infrastructure\DashboardBundle\DataFixtures\ORM\WebTestFixtures; | ||
use Surfnet\ServiceProviderDashboard\Infrastructure\DashboardBundle\Form\Entity\AttributeType; | ||
|
||
|
@@ -81,6 +82,33 @@ public function test_it_renders_the_form() | |
); | ||
} | ||
|
||
public function test_it_hides_name_id_format_unspecified() | ||
{ | ||
// 1. When NameIdFormat is not Unspecified, the form field does appear on the form | ||
$crawler = self::$pantherClient->request('GET', "/entity/edit/test/{$this->manageId}/1"); | ||
$this->assertOnPage( | ||
'Name id format', | ||
$crawler | ||
); | ||
// 2. But when the nameIdFormat is unspecified, the form field is not displayed on the form | ||
$this->registerManageEntity( | ||
'test', | ||
'saml20_sp', | ||
'88888888-1111-1111-1111-888888888888', | ||
'SP1', | ||
'https://spx-entityid.example.com', | ||
'https://spx-entityid.example.com/metadata', | ||
WebTestFixtures::TEAMNAME_SURF, | ||
'12', | ||
Constants::NAME_ID_FORMAT_UNSPECIFIED | ||
); | ||
$crawler = self::$pantherClient->request('GET', "/entity/edit/test/88888888-1111-1111-1111-888888888888/1"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not have to be with a full blown panther instance I guess, could also be done with lightweigth kernelbrowser There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, only thing is we only have a panther based test setup. This could be a nice optimization we could look into. Although the performance gain is not that big IIRC from when we chose to move to Panther. |
||
$this->assertNotOnPage( | ||
'Name id format', | ||
$crawler | ||
); | ||
} | ||
|
||
public function test_it_rejects_unauthorized_visitors() | ||
{ | ||
$ibuildings = $this->getServiceRepository()->findByName('Ibuildings B.V.'); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
"grants": [ | ||
"client_credentials" | ||
], | ||
"NameIDFormat": "nameidformat", | ||
"NameIDFormat": "%9$s", | ||
"isResourceServer": false, | ||
"contacts:0:emailAddress": "[email protected]", | ||
"contacts:0:contactType": "support", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ | |
"authorization_code", | ||
"refresh_token" | ||
], | ||
"NameIDFormat": "nameidformat", | ||
"NameIDFormat": "%9$s", | ||
"isResourceServer": false, | ||
"contacts:0:emailAddress": "[email protected]", | ||
"contacts:0:contactType": "support", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see some repetition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not realy a dry thing in my opinion; the one block deals with the nameIdFormat and the other with the clientId. They kind-of are the same thing. Leaving it as is for now