@RequestMapping(value = "/authn/{methodName:.+}/enabled/", method = RequestMethod.PUT) DaemonTask<Halconfig, Void> setMethodEnabled(@PathVariable String deploymentName, @PathVariable String methodName, @ModelAttribute ValidationSettings validationSettings, @RequestBody boolean enabled) { return GenericEnableDisableRequest.builder(halconfigParser) .updater(e -> securityService.setAuthnMethodEnabled(deploymentName, methodName, e)) .validator(() -> securityService.validateAuthnMethod(deploymentName, methodName)) .description("Edit " + methodName + " authentication settings") .build() .execute(validationSettings, enabled); }
@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 = "/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); }