SEBSERV-335 finished up and code cleanup

This commit is contained in:
anhefti 2022-12-06 14:53:27 +01:00
parent 4a8a2adc8f
commit 6a7d565e88
3 changed files with 22 additions and 13 deletions

View file

@ -84,18 +84,23 @@ public class AddSecurityKeyGrantPopup {
action.pageContext().getParent().getShell(),
this.pageService.getWidgetFactory());
dialog.setDialogWidth(800);
//dialog.setDialogHeight(600);
final Predicate<FormHandle<?>> applyGrant = formHandle -> applyGrant(
pageContext,
formHandle,
appSignatureKeyInfo);
dialog.open(
TITLE_TEXT_KEY,
applyGrant,
Utils.EMPTY_EXECUTION,
popupComposer);
if (appSignatureKeyInfo.key == null) {
dialog.open(
TITLE_TEXT_KEY,
popupComposer);
} else {
dialog.open(
TITLE_TEXT_KEY,
applyGrant,
Utils.EMPTY_EXECUTION,
popupComposer);
}
} catch (final Exception e) {
action.pageContext().notifyUnexpectedError(e);
@ -123,20 +128,23 @@ public class AddSecurityKeyGrantPopup {
public Supplier<FormHandle<?>> compose(final Composite parent) {
final WidgetFactory widgetFactory = this.pageService.getWidgetFactory();
widgetFactory.addFormSubContextHeader(parent, TITLE_TEXT_INFO, null);
final boolean hasASK = this.appSignatureKeyInfo.key != null;
final PageContext formContext = this.pageContext.copyOf(parent);
final FormHandle<?> form = this.pageService.formBuilder(formContext)
.addField(FormBuilder.text(
Domain.SEB_SECURITY_KEY_REGISTRY.ATTR_KEY_VALUE,
TITLE_TEXT_FORM_SIGNATURE,
String.valueOf(this.appSignatureKeyInfo.key))
(hasASK)
? String.valueOf(this.appSignatureKeyInfo.key)
: Constants.EMPTY_NOTE)
.readonly(true))
.addField(FormBuilder.text(
Domain.SEB_SECURITY_KEY_REGISTRY.ATTR_TAG,
TITLE_TEXT_FORM_TAG)
.mandatory())
.addFieldIf(() -> hasASK,
() -> FormBuilder.text(
Domain.SEB_SECURITY_KEY_REGISTRY.ATTR_TAG,
TITLE_TEXT_FORM_TAG)
.mandatory())
.build();

View file

@ -36,6 +36,7 @@ sebserver.webservice.http.redirect.gui=/gui
sebserver.webservice.api.admin.endpoint=/admin-api/v1
sebserver.webservice.api.admin.accessTokenValiditySeconds=3600
sebserver.webservice.api.admin.refreshTokenValiditySeconds=-1
sebserver.webservice.api.admin.exam.app.signature.key.enabled=true
sebserver.webservice.api.exam.config.init.permittedProcesses=config/initialPermittedProcesses.xml
sebserver.webservice.api.exam.config.init.prohibitedProcesses=config/initialProhibitedProcesses.xml
sebserver.webservice.api.exam.time-prefix=0

View file

@ -66,7 +66,7 @@ sebserver.webservice.api.admin.request.limit.refill=2
sebserver.webservice.api.admin.create.limit=10
sebserver.webservice.api.admin.create.limit.interval.min=3600
sebserver.webservice.api.admin.create.limit.refill=10
sebserver.webservice.api.admin.exam.app.signature.key.enabled=true
sebserver.webservice.api.admin.exam.app.signature.key.enabled=false
sebserver.webservice.api.exam.config.init.permittedProcesses=config/initialPermittedProcesses.xml
sebserver.webservice.api.exam.config.init.prohibitedProcesses=config/initialProhibitedProcesses.xml
sebserver.webservice.api.exam.endpoint=/exam-api