Skip to content

Commit

Permalink
feat(config-api): script default script validation for location (#3786)
Browse files Browse the repository at this point in the history
* feat(config-api): default template script exclusion and locationType

* feat(config-api): script enhancement

* feat(config-api): updated swagger spec

* feat(config-api): reverted user config changes

* feat(config-api): swagger changes

* feat(config-api): user service changes

* feat(config-api): userservice conflict with fido2

* feat(config-api): userservice conflict with fido2

* feat(config-api): userservice conflict with fido2

* feat(config-api): userservice conflict with fido2

* feat(config-api): userservice conflict with fido2

* feat(config-api): userservice conflict with fido2

* feat(config-api): script default script logs

* feat(config-api): script default script validation for location

* feat(config-api): script default script validation for location

* feat(config-api): script default script validation for location
  • Loading branch information
pujavs committed Feb 6, 2023
1 parent 6153a13 commit 446de9e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
14 changes: 8 additions & 6 deletions jans-config-api/docs/jans-config-api-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3926,6 +3926,8 @@ paths:
}
"401":
description: Unauthorized
"400":
description: Bad Request
"500":
description: InternalServerError
security:
Expand Down Expand Up @@ -7533,19 +7535,19 @@ components:
$ref: '#/components/schemas/AttributeValidation'
tooltip:
type: string
userCanView:
type: boolean
adminCanAccess:
type: boolean
adminCanView:
whitePagesCanView:
type: boolean
userCanEdit:
type: boolean
adminCanEdit:
type: boolean
adminCanView:
type: boolean
userCanAccess:
type: boolean
whitePagesCanView:
userCanView:
type: boolean
adminCanAccess:
type: boolean
baseDn:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public Response getCustomScriptByInum(
@ApiResponses(value = {
@ApiResponse(responseCode = "201", description = "Created", content = @Content(mediaType = MediaType.APPLICATION_JSON, schema = @Schema(implementation = CustomScript.class), examples = @ExampleObject(name = "Response json example", value = "example/auth/scripts/scripts-response.json"))),
@ApiResponse(responseCode = "401", description = "Unauthorized"),
@ApiResponse(responseCode = "400", description = "Bad Request"),
@ApiResponse(responseCode = "500", description = "InternalServerError") })
@POST
@ProtectedApi(scopes = { ApiAccessConstants.SCRIPTS_WRITE_ACCESS }, groupScopes = {}, superScopes = {
Expand Down Expand Up @@ -221,10 +222,7 @@ public Response updateScript(@Valid @NotNull CustomScript customScript) {
CustomScript existingScript = customScriptService.getScriptByInum(customScript.getInum());
checkResourceNotNull(existingScript, CUSTOM_SCRIPT);
customScript.setInum(existingScript.getInum());
logger.debug("Custom Script updated {}", customScript);

// validate Script LocationType value
validateScriptLocationType(customScript);
logger.debug("Custom Script to be updated {}", customScript);

customScriptService.update(customScript);
return Response.ok(customScript).build();
Expand Down Expand Up @@ -320,6 +318,7 @@ private void validateScriptLocationType(CustomScript customScript) {
if (customScript == null || customScript.getLocationType() == null) {
return;
}
logger.trace("validate customScript.getLocationType().getValue():{}", customScript.getLocationType().getValue());

if (ScriptLocationType.LDAP.getValue().equalsIgnoreCase(customScript.getLocationType().getValue())) {

Expand Down

0 comments on commit 446de9e

Please sign in to comment.