diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/AddSecurityKeyGrantPopup.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/AddSecurityKeyGrantPopup.java index 325748e7..ee254a70 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/AddSecurityKeyGrantPopup.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/exam/AddSecurityKeyGrantPopup.java @@ -84,18 +84,23 @@ public class AddSecurityKeyGrantPopup { action.pageContext().getParent().getShell(), this.pageService.getWidgetFactory()); dialog.setDialogWidth(800); - //dialog.setDialogHeight(600); final Predicate> 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> 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(); diff --git a/src/main/resources/config/application-dev-ws.properties b/src/main/resources/config/application-dev-ws.properties index 6d85c2b3..0cbfad95 100644 --- a/src/main/resources/config/application-dev-ws.properties +++ b/src/main/resources/config/application-dev-ws.properties @@ -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 diff --git a/src/main/resources/config/application-ws.properties b/src/main/resources/config/application-ws.properties index a67ea9b4..94a94b85 100644 --- a/src/main/resources/config/application-ws.properties +++ b/src/main/resources/config/application-ws.properties @@ -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