Skip to content

Commit

Permalink
Merge branch 'feature/SHIBUI-2268-ui' into feature/shibui-2268
Browse files Browse the repository at this point in the history
Former-commit-id: f7f12c07164ec735b0761a4fc2c43dd6b9a079a3
  • Loading branch information
rmathis committed Aug 10, 2022
2 parents 0c2d285 + 8ae250b commit 77e7a40
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 4 deletions.
13 changes: 12 additions & 1 deletion backend/src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -728,4 +728,15 @@ tooltip.group-description=Group Description
tooltip.role-name=Role Name
tooltip.role-description=Role Description

tooltip.contact-information=Contact Information
tooltip.contact-information=Contact Information

label.algorithm=Algorithm
tooltip.algorithm=Block encryption algorithms are designed for encrypting and decrypting data in fixed size, multiple octet blocks.

value.algorithm-gcm-256=GCM (256) - http://www.w3.org/2009/xmlenc11#aes256-gcm
value.algorithm-gcm-192=GCM (192) - http://www.w3.org/2009/xmlenc11#aes192-gcm
value.algorithm-gcm-128=GCM (128) - http://www.w3.org/2009/xmlenc11#aes128-gcm
value.algorithm-cbc-256=CBC (256) - http://www.w3.org/2001/04/xmlenc#aes256-cbc
value.algorithm-cbc-192=CBC (192) - http://www.w3.org/2001/04/xmlenc#aes192-cbc
value.algorithm-cbc-128=CBC (128) - http://www.w3.org/2001/04/xmlenc#aes128-cbc
value.algorithm-cbc-tripledes=CBC (TRIPLEDES) - http://www.w3.org/2001/04/xmlenc#tripledes-cbc
76 changes: 76 additions & 0 deletions ui/public/assets/schema/filter/algorithm.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"type": "object",
"required": ["name"],
"properties": {
"name": {
"title": "label.filter-name",
"description": "tooltip.filter-name",
"type": "string"
},
"filterEnabled": {
"title": "label.enable-filter",
"description": "tooltip.enable-filter",
"type": "boolean",
"default": false
},
"algorithmFilterTarget": {
"title": "label.search-criteria",
"description": "tooltip.search-criteria",
"type": "object",
"properties": {
"algorithmFilterTargetType": {
"title": "label.filter-target-type",
"type": "string",
"default": "ENTITY",
"enum": ["ENTITY", "REGEX", "CONDITION_SCRIPT"],
"enumNames": [
"value.entity-id",
"value.regex",
"value.script"
]
},
"value": {
"title": "label.filter-target-value",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string"
}
}
},
"required": ["value", "algorithmFilterTargetType"]
},
"@type": {
"type": "string",
"default": "NameIDFormat"
},
"version": {
"type": "integer"
},
"algorithm": {
"title": "label.algorithm",
"description": "tooltip.algorithm",
"type": "string",
"enum": [
"http://www.w3.org/2009/xmlenc11#aes256-gcm",
"http://www.w3.org/2009/xmlenc11#aes192-gcm",
"http://www.w3.org/2009/xmlenc11#aes128-gcm",
"http://www.w3.org/2001/04/xmlenc#aes256-cbc",
"http://www.w3.org/2001/04/xmlenc#aes192-cbc",
"http://www.w3.org/2001/04/xmlenc#aes128-cbc",
"http://www.w3.org/2001/04/xmlenc#tripledes-cbc"
],
"enumNames": [
"value.algorithm-gcm-256",
"value.algorithm-gcm-192",
"value.algorithm-gcm-128",
"value.algorithm-cbc-256",
"value.algorithm-cbc-192",
"value.algorithm-cbc-128",
"value.algorithm-cbc-tripledes"
]
}
},
"definitions": {}
}
3 changes: 2 additions & 1 deletion ui/src/app/form/component/fields/FilterTargetField.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ const FilterTargetField = ({
<Button variant="success"
type="button"
disabled={!term || !match}
onClick={() => onSelectValue(term)}>
onClick={() => onSelectValue(term)}
style={{minWidth: '160px'}}>
<Translate value="action.add-entity-id">Add Entity ID</Translate>&nbsp;&nbsp;
<FontAwesomeIcon icon={faPlus} />
</Button>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import defaultsDeep from "lodash/defaultsDeep";
// import API_BASE_PATH from "../../../../App.constant";
import { BASE_PATH } from '../../../../App.constant';
import { BaseFilterDefinition } from "./BaseFilterDefinition";

export const AlgorithmFilterWizard = {
...BaseFilterDefinition,
uiSchema: defaultsDeep({
algorithmFilterTarget: {
'ui:field': 'FilterTargetField',
api: ''
},
formats: {
"ui:options": {
orderable: false
},
items: {
'ui:widget': 'OptionWidget'
}
}
}, BaseFilterDefinition.uiSchema),
label: 'Algorithm',
type: 'Algorithm',
// schema: `${API_BASE_PATH}/ui/AlgorithmFilter`,
schema: `${BASE_PATH}assets/schema/filter/algorithm.schema.json`,
steps: [],
validator: (data = [], current = { resourceId: null }, group) => {
return BaseFilterDefinition.validator(data, current, group, 'algorithmFilterTarget', 'algorithmFilterTargetType')
},
formatter: (changes) => ({
...changes,
'@type': AlgorithmFilterWizard.type
})
};

export const AlgorithmFilterEditor = {
...AlgorithmFilterWizard,
steps: [
{
id: 'common',
label: 'label.target',
index: 1,
fields: [
'name',
'@type',
'resourceId',
'algorithmFilterTarget',
'filterEnabled'
]
},
{
id: 'options',
label: 'label.options',
index: 2,
initialValues: [],
fields: [
'algorithm'
]
}
]
};
7 changes: 5 additions & 2 deletions ui/src/app/metadata/domain/filter/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { EntityAttributesFilterEditor } from './definition/EntityAttributesFilterDefinition';
import { NameIDFilterEditor } from './definition/NameIdFilterDefinition';
import { AlgorithmFilterEditor } from './definition/AlgorithmFilterDefinition';

export const MetadataFilterWizardTypes = {
EntityAttributes: EntityAttributesFilterEditor,
NameIDFormat: NameIDFilterEditor
NameIDFormat: NameIDFilterEditor,
Algorithm: AlgorithmFilterEditor,
};

export const MetadataFilterEditorTypes = [
EntityAttributesFilterEditor,
NameIDFilterEditor
NameIDFilterEditor,
AlgorithmFilterEditor,
];

export const MetadataFilterTypes = [
Expand Down

0 comments on commit 77e7a40

Please sign in to comment.