public void setApacheSslEnabled(String deploymentName, boolean enabled) { getApacheSsl(deploymentName).setEnabled(enabled); }
public void setSpringSsl(String deploymentName, SpringSsl apacheSsl) { ApiSecurity uiSecurity = getApiSecurity(deploymentName); uiSecurity.setSsl(apacheSsl); }
public void setAuthnMethodEnabled(String deploymentName, String methodName, boolean enabled) { AuthnMethod method = getAuthnMethod(deploymentName, methodName); method.setEnabled(enabled); setAuthnMethod(deploymentName, method); }
public void setUiSecurity(String deploymentName, UiSecurity apiSecurity) { Security security = getSecurity(deploymentName); security.setUiSecurity(apiSecurity); }
@RequestMapping(value = "/authn/{methodName:.+}", method = RequestMethod.GET) DaemonTask<Halconfig, AuthnMethod> getAuthmethod(@PathVariable String deploymentName, @PathVariable String methodName, @ModelAttribute ValidationSettings validationSettings) { return GenericGetRequest.<AuthnMethod>builder() .getter(() -> securityService.getAuthnMethod(deploymentName, methodName)) .validator(() -> securityService.validateAuthnMethod(deploymentName, methodName)) .description("Get authentication settings") .build() .execute(validationSettings); }
@RequestMapping(value = "/ui/", method = RequestMethod.GET) DaemonTask<Halconfig, UiSecurity> getUiSecurity(@PathVariable String deploymentName, @ModelAttribute ValidationSettings validationSettings) { return GenericGetRequest.<UiSecurity>builder() .getter(() -> securityService.getUiSecurity(deploymentName)) .validator(() -> securityService.validateUiSecurity(deploymentName)) .description("Get UI security settings") .build() .execute(validationSettings); }
@RequestMapping(value = "/api/", method = RequestMethod.GET) DaemonTask<Halconfig, ApiSecurity> getApiSecurity(@PathVariable String deploymentName, @ModelAttribute ValidationSettings validationSettings) { return GenericGetRequest.<ApiSecurity>builder() .getter(() -> securityService.getApiSecurity(deploymentName)) .validator(() -> securityService.validateApiSecurity(deploymentName)) .description("Get API security settings") .build() .execute(validationSettings); }
@RequestMapping(value = "/", method = RequestMethod.GET) DaemonTask<Halconfig, Security> getSecurity(@PathVariable String deploymentName, @ModelAttribute ValidationSettings validationSettings) { return GenericGetRequest.<Security>builder() .getter(() -> securityService.getSecurity(deploymentName)) .validator(() -> securityService.validateSecurity(deploymentName)) .description("Get all security settings") .build() .execute(validationSettings); }
@RequestMapping(value = "/ui/ssl/", method = RequestMethod.GET) DaemonTask<Halconfig, ApacheSsl> getApacheSsl(@PathVariable String deploymentName, @ModelAttribute ValidationSettings validationSettings) { return GenericGetRequest.<ApacheSsl>builder() .getter(() -> securityService.getApacheSsl(deploymentName)) .validator(() -> securityService.validateApacheSsl(deploymentName)) .description("Get UI SSL settings") .build() .execute(validationSettings); }
@RequestMapping(value = "/api/ssl/", method = RequestMethod.GET) DaemonTask<Halconfig, SpringSsl> getSpringSsl(@PathVariable String deploymentName, @ModelAttribute ValidationSettings validationSettings) { return GenericGetRequest.<SpringSsl>builder() .getter(() -> securityService.getSpringSsl(deploymentName)) .validator(() -> securityService.validateSpringSsl(deploymentName)) .description("Get API SSL settings") .build() .execute(validationSettings); }
@RequestMapping(value = "/ui/ssl/", method = RequestMethod.PUT) DaemonTask<Halconfig, Void> setApacheSSl(@PathVariable String deploymentName, @ModelAttribute ValidationSettings validationSettings, @RequestBody ApacheSsl apacheSsl) { return GenericUpdateRequest.<ApacheSsl>builder(halconfigParser) .stagePath(halconfigDirectoryStructure.getStagingPath(deploymentName)) .updater(a -> securityService.setApacheSsl(deploymentName, a)) .validator(() -> securityService.validateApacheSsl(deploymentName)) .description("Edit UI SSL settings") .build() .execute(validationSettings, apacheSsl); }
@RequestMapping(value = "/api/", method = RequestMethod.PUT) DaemonTask<Halconfig, Void> setApiSecurity(@PathVariable String deploymentName, @ModelAttribute ValidationSettings validationSettings, @RequestBody ApiSecurity apiSecurity) { return GenericUpdateRequest.<ApiSecurity>builder(halconfigParser) .stagePath(halconfigDirectoryStructure.getStagingPath(deploymentName)) .updater(a -> securityService.setApiSecurity(deploymentName, a)) .validator(() -> securityService.validateApiSecurity(deploymentName)) .description("Edit API security settings") .build() .execute(validationSettings, apiSecurity); }
@RequestMapping(value = "/authn/{methodName:.+}", method = RequestMethod.PUT) DaemonTask<Halconfig, Void> setAuthnMethod(@PathVariable String deploymentName, @PathVariable String methodName, @ModelAttribute ValidationSettings validationSettings, @RequestBody Object rawMethod) { AuthnMethod method = objectMapper.convertValue( rawMethod, AuthnMethod.translateAuthnMethodName(methodName) ); return GenericUpdateRequest.<AuthnMethod>builder(halconfigParser) .stagePath(halconfigDirectoryStructure.getStagingPath(deploymentName)) .updater(m -> securityService.setAuthnMethod(deploymentName, m)) .validator(() -> securityService.validateAuthnMethod(deploymentName, methodName)) .description("Edit " + methodName + " authentication settings") .build() .execute(validationSettings, method); }
@RequestMapping(value = "/authz/groupMembership/{roleProviderName:.+}", method = RequestMethod.PUT) DaemonTask<Halconfig, Void> setRoleProvider(@PathVariable String deploymentName, @PathVariable String roleProviderName, @ModelAttribute ValidationSettings validationSettings, @RequestBody Object rawProvider) { RoleProvider roleProvider = objectMapper.convertValue( rawProvider, GroupMembership.translateRoleProviderType(roleProviderName) ); return GenericUpdateRequest.<RoleProvider>builder(halconfigParser) .stagePath(halconfigDirectoryStructure.getStagingPath(deploymentName)) .updater(r -> securityService.setRoleProvider(deploymentName, r)) .validator(() -> securityService.validateRoleProvider(deploymentName, roleProviderName)) .description("Edit " + roleProviderName + " group membership settings") .build() .execute(validationSettings, roleProvider); }
public ApacheSsl getApacheSsl(String deploymentName) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setSecurity().setUiSecurity().setApacheSsl(); return lookupService.getSingularNodeOrDefault(filter, ApacheSsl.class, ApacheSsl::new, n -> setApacheSsl(deploymentName, n)); }
public ApiSecurity getApiSecurity(String deploymentName) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setSecurity().setApiSecurity(); return lookupService.getSingularNodeOrDefault(filter, ApiSecurity.class, ApiSecurity::new, n -> setApiSecurity(deploymentName, n)); }
public void setApacheSsl(String deploymentName, ApacheSsl apacheSsl) { UiSecurity uiSecurity = getUiSecurity(deploymentName); uiSecurity.setSsl(apacheSsl); }
public RoleProvider getRoleProvider(String deploymentName, String roleProviderName) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setSecurity().setRoleProvider(roleProviderName); return lookupService.getSingularNodeOrDefault(filter, RoleProvider.class, () -> { try { return GroupMembership.translateRoleProviderType(roleProviderName).newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException(e); } }, n -> setRoleProvider(deploymentName, n)); }
public AuthnMethod getAuthnMethod(String deploymentName, String methodName) { NodeFilter filter = new NodeFilter().setDeployment(deploymentName).setSecurity().setAuthnMethod(methodName); return lookupService.getSingularNodeOrDefault(filter, AuthnMethod.class, () -> { try { return AuthnMethod.translateAuthnMethodName(methodName).newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException(e); } }, n -> setAuthnMethod(deploymentName, n)); }
public void setSpringSslEnabled(String deploymentName, boolean enabled) { getSpringSsl(deploymentName).setEnabled(enabled); }