-
Notifications
You must be signed in to change notification settings - Fork 9
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
OPENEUROPA-1501: Implement configuration UI for Authentication. #42
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a60ca80
OPENEUROPA-1501: Implement configuration UI for Authentication.
nagyad 1e0c76c
OPENEUROPA-1501: Create behat tag for Drupal logins.
nagyad 8b5d610
OPENEUROPA-1501: Backup default authentication config during behat.
nagyad 422d292
OPENEUROPA-1501: Set task runner to beta4.
nagyad 5f20421
OPENEUROPA-1501: Disable Big Pipe and fix typo..
nagyad 75ee3ac
OPENEUROPA-1501: Add dom-crawler to composer.
nagyad c6a3618
OPENEUROPA-1501: Set CAS version to 1.3 release and remove not necess…
nagyad 47e0a4d
OPENEUROPA-1501: Set CAS version to dev.
nagyad 930e50f
OPENEUROPA-1501: Extend the proper class for behat context and fix test.
nagyad 7d7ed6b
OPENEUROPA-1501: Rename constant and add string for path in behat.
nagyad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
oe_authentication.settings: | ||
title: Authentication settings | ||
description: 'Configure Authentication settings.' | ||
route_name: oe_authentication.settings | ||
parent: system.admin_config_system |
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,3 @@ | ||
administer authentication configuration: | ||
title: 'Administer Authentication configuration' | ||
restrict access: false |
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,7 @@ | ||
oe_authentication.settings: | ||
path: '/admin/config/system/oe_authentication' | ||
defaults: | ||
_form: 'Drupal\oe_authentication\Form\AuthenticationSettingsForm' | ||
_title: 'Authentication settings' | ||
requirements: | ||
_permission: 'administer authentication configuration' |
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,80 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Drupal\oe_authentication\Form; | ||
|
||
use Drupal\Core\Form\ConfigFormBase; | ||
use Drupal\Core\Form\FormStateInterface; | ||
|
||
/** | ||
* Settings form for module. | ||
*/ | ||
class AuthenticationSettingsForm extends ConfigFormBase { | ||
|
||
/** | ||
* Name of the config being edited. | ||
*/ | ||
const CONFIGNAME = 'oe_authentication.settings'; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getFormId() { | ||
return 'oe_authentication_settings'; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function buildForm(array $form, FormStateInterface $form_state) { | ||
$form['protocol'] = [ | ||
'#type' => 'textfield', | ||
'#title' => $this->t('Application authentication protocol'), | ||
'#default_value' => $this->config(static::CONFIGNAME)->get('protocol'), | ||
]; | ||
$form['register_path'] = [ | ||
'#type' => 'textfield', | ||
'#title' => $this->t('Application register path'), | ||
'#default_value' => $this->config(static::CONFIGNAME)->get('register_path'), | ||
]; | ||
$form['validation_path'] = [ | ||
'#type' => 'textfield', | ||
'#title' => $this->t('Application validation path'), | ||
'#default_value' => $this->config(static::CONFIGNAME)->get('validation_path'), | ||
]; | ||
$form['assurance_level'] = [ | ||
'#type' => 'textfield', | ||
'#title' => $this->t('Application assurance levels'), | ||
'#default_value' => $this->config(static::CONFIGNAME)->get('assurance_level'), | ||
]; | ||
$form['ticket_types'] = [ | ||
'#type' => 'textfield', | ||
'#title' => $this->t('Application available ticket types'), | ||
'#default_value' => $this->config(static::CONFIGNAME)->get('ticket_types'), | ||
]; | ||
return parent::buildForm($form, $form_state); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function submitForm(array &$form, FormStateInterface $form_state) { | ||
$this->config(static::CONFIGNAME) | ||
->set('protocol', $form_state->getValue('protocol')) | ||
->set('register_path', $form_state->getValue('register_path')) | ||
->set('validation_path', $form_state->getValue('validation_path')) | ||
->set('assurance_level', $form_state->getValue('assurance_level')) | ||
->set('ticket_types', $form_state->getValue('ticket_types')) | ||
->save(); | ||
parent::submitForm($form, $form_state); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function getEditableConfigNames() { | ||
return ['oe_authentication.settings']; | ||
} | ||
|
||
} |
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,31 @@ | ||
@api | ||
Feature: Authentication | ||
As the site manager | ||
I need to be able to configure the settings | ||
|
||
Background: | ||
Given I am logged in as a user with the "administer authentication configuration" permission | ||
|
||
@DrupalLogin @BackupAuthConfigs | ||
Scenario: Configure Authentication settings | ||
Given I am on "admin/config/system/oe_authentication" | ||
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. Same scenario as openeuropa/oe_webtools#24 (comment) |
||
Then I should see "Authentication settings" | ||
# Check for the default config is there. | ||
And the "Application authentication protocol" field should contain "eulogin" | ||
And the "Application register path" field should contain "eim/external/register.cgi" | ||
And the "Application validation path" field should contain "TicketValidationService" | ||
And the "Application assurance levels" field should contain "TOP" | ||
And the "Application available ticket types" field should contain "SERVICE,PROXY" | ||
# Change the configuration values. | ||
When I fill in "Application authentication protocol" with "something" | ||
And I fill in "Application register path" with "test/something" | ||
And I fill in "Application validation path" with "validation/path" | ||
And I fill in "Application assurance levels" with "assurance" | ||
And I fill in "Application available ticket types" with "ticket.test" | ||
And I press "Save configuration" | ||
Then I should see the message "The configuration options have been saved." | ||
And the "Application authentication protocol" field should contain "something" | ||
nagyad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
And the "Application register path" field should contain "test/something" | ||
And the "Application validation path" field should contain "validation/path" | ||
And the "Application assurance levels" field should contain "assurance" | ||
And the "Application available ticket types" field should contain "ticket.test" |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
"#description" could be useful.
This remark is relevant to other fields too.
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.
There are no description provided in the configurations either. I would not add anything based on my own assumption.