-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4045 from open-formulieren/fix/3969-remove-eherke…
…nning-loa-overwrite [#3969] Remove ability to override LoA for eHekrenning/eIDAS
- Loading branch information
Showing
18 changed files
with
246 additions
and
126 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
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
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
78 changes: 78 additions & 0 deletions
78
src/openforms/js/components/admin/form_design/authentication/LoAOverrideOption.js
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,78 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import {FormattedMessage} from 'react-intl'; | ||
|
||
import Field from 'components/admin/forms/Field'; | ||
import FormRow from 'components/admin/forms/FormRow'; | ||
import Select from 'components/admin/forms/Select'; | ||
|
||
const LoAOverrideOption = ({ | ||
availableAuthPlugins, | ||
selectedAuthPlugins, | ||
authenticationBackendOptions, | ||
onChange, | ||
}) => { | ||
// These are the selected plugins that support overriding the LoA via the Authentication request | ||
const pluginsToDisplay = availableAuthPlugins.filter( | ||
plugin => | ||
selectedAuthPlugins.includes(plugin.id) && | ||
plugin.supportsLoaOverride && | ||
plugin.assuranceLevels.length | ||
); | ||
|
||
if (pluginsToDisplay.length === 0) return null; | ||
|
||
return ( | ||
<FormRow> | ||
<Field | ||
name="form.authenticationBackendOptions" | ||
label={ | ||
<FormattedMessage | ||
description="Minimal levels of assurance label" | ||
defaultMessage="Minimal levels of assurance" | ||
/> | ||
} | ||
helpText={ | ||
<FormattedMessage | ||
defaultMessage="Override the minimum Level of Assurance. This is not supported by all authentication plugins." | ||
description="Minimal LoA override help text" | ||
/> | ||
} | ||
> | ||
<ul> | ||
{pluginsToDisplay.map(plugin => ( | ||
<li key={plugin.id}> | ||
<label htmlFor={`form.authenticationBackendOptions.${plugin.id}.loa`}> | ||
{plugin.label} | ||
</label> | ||
<Select | ||
key={plugin.id} | ||
id={`form.authenticationBackendOptions.${plugin.id}.loa`} | ||
name={`form.authenticationBackendOptions.${plugin.id}.loa`} | ||
value={authenticationBackendOptions[plugin.id]?.loa} | ||
onChange={onChange} | ||
allowBlank={true} | ||
choices={plugin.assuranceLevels.map(loa => [loa.value, loa.label])} | ||
/> | ||
</li> | ||
))} | ||
</ul> | ||
</Field> | ||
</FormRow> | ||
); | ||
}; | ||
|
||
export default LoAOverrideOption; | ||
|
||
LoAOverrideOption.propTypes = { | ||
onChange: PropTypes.func.isRequired, | ||
availableAuthPlugins: PropTypes.arrayOf( | ||
PropTypes.shape({ | ||
id: PropTypes.string, | ||
label: PropTypes.string, | ||
providesAuth: PropTypes.string, | ||
}) | ||
).isRequired, | ||
selectedAuthPlugins: PropTypes.arrayOf(PropTypes.string).isRequired, | ||
authenticationBackendOptions: PropTypes.object, | ||
}; |
Oops, something went wrong.