diff --git a/components/org.wso2.carbon.identity.api.expired.password.identification/org.wso2.carbon.identity.api.expired.password.identification.common/pom.xml b/components/org.wso2.carbon.identity.api.expired.password.identification/org.wso2.carbon.identity.api.expired.password.identification.common/pom.xml index 61117f4b62..b8b448741d 100644 --- a/components/org.wso2.carbon.identity.api.expired.password.identification/org.wso2.carbon.identity.api.expired.password.identification.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.expired.password.identification/org.wso2.carbon.identity.api.expired.password.identification.common/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.expired.password.identification - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.expired.password.identification/org.wso2.carbon.identity.api.expired.password.identification.v1/pom.xml b/components/org.wso2.carbon.identity.api.expired.password.identification/org.wso2.carbon.identity.api.expired.password.identification.v1/pom.xml index 6c29d1463d..0788d1353e 100644 --- a/components/org.wso2.carbon.identity.api.expired.password.identification/org.wso2.carbon.identity.api.expired.password.identification.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.expired.password.identification/org.wso2.carbon.identity.api.expired.password.identification.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.expired.password.identification - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.expired.password.identification/pom.xml b/components/org.wso2.carbon.identity.api.expired.password.identification/pom.xml index e4c46934a4..10418b6473 100644 --- a/components/org.wso2.carbon.identity.api.expired.password.identification/pom.xml +++ b/components/org.wso2.carbon.identity.api.expired.password.identification/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.common/pom.xml b/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.common/pom.xml index ee1083e63a..57b29ecce6 100644 --- a/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.common/pom.xml @@ -19,7 +19,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.idle.account.identification - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.v1/pom.xml b/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.v1/pom.xml index 807f4c0079..ed8f42fe2d 100644 --- a/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.idle.account.identification/org.wso2.carbon.identity.api.idle.account.identification.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.idle.account.identification - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.idle.account.identification/pom.xml b/components/org.wso2.carbon.identity.api.idle.account.identification/pom.xml index d9a089c738..5753dfc0e9 100644 --- a/components/org.wso2.carbon.identity.api.idle.account.identification/pom.xml +++ b/components/org.wso2.carbon.identity.api.idle.account.identification/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.common/pom.xml index ee66c75e62..b4f3eb617a 100644 --- a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.common/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.action.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/pom.xml index a987ab51c5..455c42e8c0 100644 --- a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.action.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/action/management/v1/ActionType.java b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/action/management/v1/ActionType.java index 066b02d80a..b3c7b8859d 100644 --- a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/action/management/v1/ActionType.java +++ b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/action/management/v1/ActionType.java @@ -28,7 +28,7 @@ @XmlEnum(String.class) public enum ActionType { - @XmlEnumValue("PRE_ISSUE_ACCESS_TOKEN") PRE_ISSUE_ACCESS_TOKEN(String.valueOf("PRE_ISSUE_ACCESS_TOKEN")), @XmlEnumValue("PRE_UPDATE_PASSWORD") PRE_UPDATE_PASSWORD(String.valueOf("PRE_UPDATE_PASSWORD")), @XmlEnumValue("PRE_UPDATE_PROFILE") PRE_UPDATE_PROFILE(String.valueOf("PRE_UPDATE_PROFILE")), @XmlEnumValue("PRE_REGISTRATION") PRE_REGISTRATION(String.valueOf("PRE_REGISTRATION")), @XmlEnumValue("AUTHENTICATION") AUTHENTICATION(String.valueOf("AUTHENTICATION")); + @XmlEnumValue("PRE_ISSUE_ACCESS_TOKEN") PRE_ISSUE_ACCESS_TOKEN(String.valueOf("PRE_ISSUE_ACCESS_TOKEN")), @XmlEnumValue("PRE_UPDATE_PASSWORD") PRE_UPDATE_PASSWORD(String.valueOf("PRE_UPDATE_PASSWORD")), @XmlEnumValue("PRE_UPDATE_PROFILE") PRE_UPDATE_PROFILE(String.valueOf("PRE_UPDATE_PROFILE")), @XmlEnumValue("PRE_REGISTRATION") PRE_REGISTRATION(String.valueOf("PRE_REGISTRATION")); private String value; diff --git a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/action/management/v1/ActionsApi.java b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/action/management/v1/ActionsApi.java index a87f949f88..53ee5e6abd 100644 --- a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/action/management/v1/ActionsApi.java +++ b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/action/management/v1/ActionsApi.java @@ -67,7 +67,7 @@ public class ActionsApi { @ApiResponse(code = 404, message = "Not Found", response = Error.class), @ApiResponse(code = 500, message = "Server Error", response = Error.class) }) - public Response activateAction(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration, authentication") @PathParam("actionType") String actionType, @ApiParam(value = "Id of the Action.",required=true) @PathParam("actionId") String actionId) { + public Response activateAction(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration") @PathParam("actionType") String actionType, @ApiParam(value = "Id of the Action.",required=true) @PathParam("actionId") String actionId) { return delegate.activateAction(actionType, actionId ); } @@ -92,7 +92,7 @@ public Response activateAction(@ApiParam(value = "Name of the Action Type.",requ @ApiResponse(code = 500, message = "Server Error", response = Error.class), @ApiResponse(code = 501, message = "Not Implemented", response = Error.class) }) - public Response createAction(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration, authentication") @PathParam("actionType") String actionType, @ApiParam(value = "This represents the action to be created." ,required=true) @Valid ActionModel actionModel) { + public Response createAction(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration") @PathParam("actionType") String actionType, @ApiParam(value = "This represents the action to be created." ,required=true) @Valid ActionModel actionModel) { return delegate.createAction(actionType, actionModel ); } @@ -116,7 +116,7 @@ public Response createAction(@ApiParam(value = "Name of the Action Type.",requir @ApiResponse(code = 404, message = "Not Found", response = Error.class), @ApiResponse(code = 500, message = "Server Error", response = Error.class) }) - public Response deactivateAction(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration, authentication") @PathParam("actionType") String actionType, @ApiParam(value = "Id of the Action.",required=true) @PathParam("actionId") String actionId) { + public Response deactivateAction(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration") @PathParam("actionType") String actionType, @ApiParam(value = "Id of the Action.",required=true) @PathParam("actionId") String actionId) { return delegate.deactivateAction(actionType, actionId ); } @@ -140,24 +140,24 @@ public Response deactivateAction(@ApiParam(value = "Name of the Action Type.",re @ApiResponse(code = 404, message = "Not Found", response = Error.class), @ApiResponse(code = 500, message = "Server Error", response = Error.class) }) - public Response deleteAction(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration, authentication") @PathParam("actionType") String actionType, @ApiParam(value = "Id of the Action.",required=true) @PathParam("actionId") String actionId) { + public Response deleteAction(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration") @PathParam("actionType") String actionType, @ApiParam(value = "Id of the Action.",required=true) @PathParam("actionId") String actionId) { return delegate.deleteAction(actionType, actionId ); } @Valid @GET - @Path("/types") + @Path("/{actionType}/{actionId}") @Produces({ "application/json" }) - @ApiOperation(value = "Detailed summary of the Action Types ", notes = "This API provides the capability to retrieve the detailed summary of the action types.
Scope required:
* internal_action_mgt_view ", response = ActionTypesResponseItem.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Retrieve Action information by given Id. ", notes = "This API provides the capability to retrieve the action by action Id.
Scope required:
* internal_action_mgt_view ", response = ActionResponse.class, authorizations = { @Authorization(value = "BasicAuth"), @Authorization(value = "OAuth2", scopes = { }) }, tags={ "Actions", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = ActionTypesResponseItem.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "OK", response = ActionResponse.class), @ApiResponse(code = 400, message = "Bad Request", response = Error.class), @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), @ApiResponse(code = 403, message = "Forbidden", response = Void.class), @@ -165,24 +165,24 @@ public Response deleteAction(@ApiParam(value = "Name of the Action Type.",requir @ApiResponse(code = 500, message = "Server Error", response = Error.class), @ApiResponse(code = 501, message = "Not Implemented", response = Error.class) }) - public Response getActionTypes() { + public Response getActionByActionId(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration") @PathParam("actionType") String actionType, @ApiParam(value = "Id of the Action.",required=true) @PathParam("actionId") String actionId) { - return delegate.getActionTypes(); + return delegate.getActionByActionId(actionType, actionId ); } @Valid @GET - @Path("/{actionType}/{actionId}") + @Path("/types") @Produces({ "application/json" }) - @ApiOperation(value = "Retrieve Action information by given Id. ", notes = "This API provides the capability to retrieve the action by action Id.
Scope required:
* internal_action_mgt_view ", response = ActionResponse.class, authorizations = { + @ApiOperation(value = "Detailed summary of the Action Types ", notes = "This API provides the capability to retrieve the detailed summary of the action types.
Scope required:
* internal_action_mgt_view ", response = ActionTypesResponseItem.class, responseContainer = "List", authorizations = { @Authorization(value = "BasicAuth"), @Authorization(value = "OAuth2", scopes = { }) }, tags={ "Actions", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "OK", response = ActionResponse.class), + @ApiResponse(code = 200, message = "OK", response = ActionTypesResponseItem.class, responseContainer = "List"), @ApiResponse(code = 400, message = "Bad Request", response = Error.class), @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), @ApiResponse(code = 403, message = "Forbidden", response = Void.class), @@ -190,9 +190,9 @@ public Response getActionTypes() { @ApiResponse(code = 500, message = "Server Error", response = Error.class), @ApiResponse(code = 501, message = "Not Implemented", response = Error.class) }) - public Response getActionByActionId(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration, authentication") @PathParam("actionType") String actionType, @ApiParam(value = "Id of the Action.",required=true) @PathParam("actionId") String actionId) { + public Response getActionTypes() { - return delegate.getActionByActionId(actionType, actionId ); + return delegate.getActionTypes(); } @Valid @@ -215,7 +215,7 @@ public Response getActionByActionId(@ApiParam(value = "Name of the Action Type." @ApiResponse(code = 500, message = "Server Error", response = Error.class), @ApiResponse(code = 501, message = "Not Implemented", response = Error.class) }) - public Response getActionsByActionType(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration, authentication") @PathParam("actionType") String actionType) { + public Response getActionsByActionType(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration") @PathParam("actionType") String actionType) { return delegate.getActionsByActionType(actionType ); } @@ -239,7 +239,7 @@ public Response getActionsByActionType(@ApiParam(value = "Name of the Action Typ @ApiResponse(code = 404, message = "Not Found", response = Error.class), @ApiResponse(code = 500, message = "Server Error", response = Error.class) }) - public Response updateAction(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration, authentication") @PathParam("actionType") String actionType, @ApiParam(value = "Id of the Action.",required=true) @PathParam("actionId") String actionId, @ApiParam(value = "This represents the action information to be updated." ,required=true) @Valid ActionUpdateModel actionUpdateModel) { + public Response updateAction(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration") @PathParam("actionType") String actionType, @ApiParam(value = "Id of the Action.",required=true) @PathParam("actionId") String actionId, @ApiParam(value = "This represents the action information to be updated." ,required=true) @Valid ActionUpdateModel actionUpdateModel) { return delegate.updateAction(actionType, actionId, actionUpdateModel ); } @@ -263,7 +263,7 @@ public Response updateAction(@ApiParam(value = "Name of the Action Type.",requir @ApiResponse(code = 404, message = "Not Found", response = Error.class), @ApiResponse(code = 500, message = "Server Error", response = Error.class) }) - public Response updateActionEndpointAuthentication(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration, authentication") @PathParam("actionType") String actionType, @ApiParam(value = "Id of the Action.",required=true) @PathParam("actionId") String actionId, @ApiParam(value = "Authentication Type of the Action Endpoint.",required=true, allowableValues="none, basic, apiKey, bearer") @PathParam("authType") String authType, @ApiParam(value = "This represents the action endpoint authentication to be updated." ,required=true) @Valid AuthenticationTypeProperties authenticationTypeProperties) { + public Response updateActionEndpointAuthentication(@ApiParam(value = "Name of the Action Type.",required=true, allowableValues="preIssueAccessToken, preUpdatePassword, preUpdateProfile, preRegistration") @PathParam("actionType") String actionType, @ApiParam(value = "Id of the Action.",required=true) @PathParam("actionId") String actionId, @ApiParam(value = "Authentication Type of the Action Endpoint.",required=true, allowableValues="none, basic, apiKey, bearer") @PathParam("authType") String authType, @ApiParam(value = "This represents the action endpoint authentication to be updated." ,required=true) @Valid AuthenticationTypeProperties authenticationTypeProperties) { return delegate.updateActionEndpointAuthentication(actionType, actionId, authType, authenticationTypeProperties ); } diff --git a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/action/management/v1/ActionsApiService.java b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/action/management/v1/ActionsApiService.java index 029bdca4e0..04a51fe1e1 100644 --- a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/action/management/v1/ActionsApiService.java +++ b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/action/management/v1/ActionsApiService.java @@ -44,10 +44,10 @@ public interface ActionsApiService { public Response deleteAction(String actionType, String actionId); - public Response getActionTypes(); - public Response getActionByActionId(String actionType, String actionId); + public Response getActionTypes(); + public Response getActionsByActionType(String actionType); public Response updateAction(String actionType, String actionId, ActionUpdateModel actionUpdateModel); diff --git a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/main/java/org/wso2/carbon/identity/api/server/action/management/v1/constants/ActionMgtEndpointConstants.java b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/main/java/org/wso2/carbon/identity/api/server/action/management/v1/constants/ActionMgtEndpointConstants.java index 16e8085990..4bad886bb4 100644 --- a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/main/java/org/wso2/carbon/identity/api/server/action/management/v1/constants/ActionMgtEndpointConstants.java +++ b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/main/java/org/wso2/carbon/identity/api/server/action/management/v1/constants/ActionMgtEndpointConstants.java @@ -36,21 +36,23 @@ private ActionMgtEndpointConstants() { public enum ErrorMessage { // Client errors. - ERROR_INVALID_ACTION_ENDPOINT_AUTHENTICATION_PROPERTIES("60001", + ERROR_INVALID_ACTION_TYPE("60001", "Invalid action type.", + "Invalid action type used for path parameter."), + ERROR_INVALID_ACTION_ENDPOINT_AUTHENTICATION_PROPERTIES("60010", "Unable to perform the operation.", "Required authentication properties are not provided or invalid."), - ERROR_INVALID_ACTION_ENDPOINT_AUTH_TYPE("60002", + ERROR_INVALID_ACTION_ENDPOINT_AUTH_TYPE("60011", "Invalid Authentication Type for Action Endpoint.", "Invalid authentication type used for path parameter."), - ERROR_EMPTY_ACTION_ENDPOINT_AUTHENTICATION_PROPERTIES("60003", + ERROR_EMPTY_ACTION_ENDPOINT_AUTHENTICATION_PROPERTIES("60012", "Unable to perform the operation.", "Authentication property values cannot be empty."), - ERROR_NO_ACTION_FOUND_ON_GIVEN_ACTION_TYPE_AND_ID("60004", + ERROR_NO_ACTION_FOUND_ON_GIVEN_ACTION_TYPE_AND_ID("60013", "Action is not found.", "No action is found for given action id and action type"), // Server errors. - ERROR_NOT_IMPLEMENTED_ACTION_TYPE("65001", + ERROR_NOT_IMPLEMENTED_ACTION_TYPE("650015", "Unable to perform the operation.", "The requested action type is not currently supported by the server."); diff --git a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/main/java/org/wso2/carbon/identity/api/server/action/management/v1/core/ServerActionManagementService.java b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/main/java/org/wso2/carbon/identity/api/server/action/management/v1/core/ServerActionManagementService.java index a4cf6ba42c..575d4bc203 100644 --- a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/main/java/org/wso2/carbon/identity/api/server/action/management/v1/core/ServerActionManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/main/java/org/wso2/carbon/identity/api/server/action/management/v1/core/ServerActionManagementService.java @@ -50,6 +50,7 @@ import static org.wso2.carbon.identity.api.server.action.management.v1.constants.ActionMgtEndpointConstants.ErrorMessage.ERROR_EMPTY_ACTION_ENDPOINT_AUTHENTICATION_PROPERTIES; import static org.wso2.carbon.identity.api.server.action.management.v1.constants.ActionMgtEndpointConstants.ErrorMessage.ERROR_INVALID_ACTION_ENDPOINT_AUTHENTICATION_PROPERTIES; import static org.wso2.carbon.identity.api.server.action.management.v1.constants.ActionMgtEndpointConstants.ErrorMessage.ERROR_INVALID_ACTION_ENDPOINT_AUTH_TYPE; +import static org.wso2.carbon.identity.api.server.action.management.v1.constants.ActionMgtEndpointConstants.ErrorMessage.ERROR_INVALID_ACTION_TYPE; import static org.wso2.carbon.identity.api.server.action.management.v1.constants.ActionMgtEndpointConstants.ErrorMessage.ERROR_NOT_IMPLEMENTED_ACTION_TYPE; import static org.wso2.carbon.identity.api.server.action.management.v1.constants.ActionMgtEndpointConstants.ErrorMessage.ERROR_NO_ACTION_FOUND_ON_GIVEN_ACTION_TYPE_AND_ID; @@ -71,7 +72,7 @@ public class ServerActionManagementService { public ActionResponse createAction(String actionType, ActionModel actionModel) { try { - handleNotImplementedActionTypes(actionType); + validateActionType(actionType); return buildActionResponse(ActionManagementServiceHolder.getActionManagementService() .addAction(actionType, buildAction(actionModel), CarbonContext.getThreadLocalCarbonContext().getTenantDomain())); @@ -83,7 +84,7 @@ public ActionResponse createAction(String actionType, ActionModel actionModel) { public List getActionsByActionType(String actionType) { try { - handleNotImplementedActionTypes(actionType); + validateActionType(actionType); List actions = ActionManagementServiceHolder.getActionManagementService() .getActionsByActionType(actionType, CarbonContext.getThreadLocalCarbonContext().getTenantDomain()); @@ -101,7 +102,7 @@ public List getActionsByActionType(String actionType) { public ActionResponse getActionByActionId(String actionType, String actionId) { try { - handleNotImplementedActionTypes(actionType); + validateActionType(actionType); Action action = ActionManagementServiceHolder.getActionManagementService() .getActionByActionId(actionType, actionId, CarbonContext.getThreadLocalCarbonContext().getTenantDomain()); @@ -120,7 +121,7 @@ public ActionResponse getActionByActionId(String actionType, String actionId) { public ActionResponse updateAction(String actionType, String actionId, ActionUpdateModel actionUpdateModel) { try { - handleNotImplementedActionTypes(actionType); + validateActionType(actionType); return buildActionResponse(ActionManagementServiceHolder.getActionManagementService() .updateAction(actionType, actionId, buildUpdatingAction(actionUpdateModel), CarbonContext.getThreadLocalCarbonContext().getTenantDomain())); @@ -132,7 +133,7 @@ public ActionResponse updateAction(String actionType, String actionId, ActionUpd public void deleteAction(String actionType, String actionId) { try { - handleNotImplementedActionTypes(actionType); + validateActionType(actionType); ActionManagementServiceHolder.getActionManagementService().deleteAction(actionType, actionId, CarbonContext.getThreadLocalCarbonContext().getTenantDomain()); } catch (ActionMgtException e) { @@ -143,7 +144,7 @@ public void deleteAction(String actionType, String actionId) { public ActionBasicResponse activateAction(String actionType, String actionId) { try { - handleNotImplementedActionTypes(actionType); + validateActionType(actionType); return buildActionBasicResponse(ActionManagementServiceHolder.getActionManagementService() .activateAction(actionType, actionId, CarbonContext.getThreadLocalCarbonContext().getTenantDomain())); @@ -155,7 +156,7 @@ public ActionBasicResponse activateAction(String actionType, String actionId) { public ActionBasicResponse deactivateAction(String actionType, String actionId) { try { - handleNotImplementedActionTypes(actionType); + validateActionType(actionType); return buildActionBasicResponse(ActionManagementServiceHolder.getActionManagementService() .deactivateAction(actionType, actionId, CarbonContext.getThreadLocalCarbonContext().getTenantDomain())); @@ -174,7 +175,8 @@ public List getActionTypes() { .getActionsCountPerType(CarbonContext.getThreadLocalCarbonContext().getTenantDomain()); List actionTypesResponseItems = new ArrayList<>(); - for (Action.ActionTypes actionType : Action.ActionTypes.values()) { + for (Action.ActionTypes actionType : Action.ActionTypes.filterByCategory( + Action.ActionTypes.Category.PRE_POST)) { if (!NOT_IMPLEMENTED_ACTION_TYPES.contains(actionType.getPathParam())) { actionTypesResponseItems.add(new ActionTypesResponseItem() @@ -196,7 +198,7 @@ public ActionResponse updateActionEndpointAuthentication(String actionType, Stri AuthenticationTypeProperties authenticationTypeProperties) { try { - handleNotImplementedActionTypes(actionType); + validateActionType(actionType); Authentication authentication = buildAuthentication(getAuthTypeFromPath(authType), authenticationTypeProperties.getProperties()); return buildActionResponse(ActionManagementServiceHolder.getActionManagementService() @@ -374,14 +376,16 @@ private Authentication.Type getAuthTypeFromPath(String authType) { ERROR_INVALID_ACTION_ENDPOINT_AUTH_TYPE)); } - /** - * Handle not implemented action types. - * - * @param actionType Action type. - */ - private void handleNotImplementedActionTypes(String actionType) { + private void validateActionType(String actionType) { + + Action.ActionTypes actionTypeEnum = + Arrays.stream(Action.ActionTypes.filterByCategory(Action.ActionTypes.Category.PRE_POST)) + .filter(actionTypeObj -> actionTypeObj.getPathParam().equals(actionType)) + .findFirst() + .orElseThrow(() -> ActionMgtEndpointUtil.handleException(Response.Status.BAD_REQUEST, + ERROR_INVALID_ACTION_TYPE)); - if (NOT_IMPLEMENTED_ACTION_TYPES.contains(actionType)) { + if (NOT_IMPLEMENTED_ACTION_TYPES.contains(actionTypeEnum.getPathParam())) { throw ActionMgtEndpointUtil.handleException(Response.Status.NOT_IMPLEMENTED, ERROR_NOT_IMPLEMENTED_ACTION_TYPE); } diff --git a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/main/resources/Actions.yaml b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/main/resources/Actions.yaml index e1094fc047..8aa699f98b 100644 --- a/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/main/resources/Actions.yaml +++ b/components/org.wso2.carbon.identity.api.server.action.management/org.wso2.carbon.identity.api.server.action.management.v1/src/main/resources/Actions.yaml @@ -88,7 +88,6 @@ paths: - preUpdatePassword - preUpdateProfile - preRegistration - - authentication requestBody: content: application/json: @@ -153,7 +152,6 @@ paths: - preUpdatePassword - preUpdateProfile - preRegistration - - authentication responses: '200': description: OK @@ -212,7 +210,6 @@ paths: - preUpdatePassword - preUpdateProfile - preRegistration - - authentication - name: actionId in: path description: Id of the Action. @@ -275,7 +272,6 @@ paths: - preUpdatePassword - preUpdateProfile - preRegistration - - authentication - name: actionId in: path description: Id of the Action. @@ -340,7 +336,6 @@ paths: - preUpdatePassword - preUpdateProfile - preRegistration - - authentication - name: actionId in: path description: Id of the Action. @@ -395,7 +390,6 @@ paths: - preUpdatePassword - preUpdateProfile - preRegistration - - authentication - name: actionId in: path description: Id of the Action. @@ -454,7 +448,6 @@ paths: - preUpdatePassword - preUpdateProfile - preRegistration - - authentication - name: actionId in: path description: Id of the Action. @@ -513,7 +506,6 @@ paths: - preUpdatePassword - preUpdateProfile - preRegistration - - authentication - name: actionId in: path description: Id of the Action. @@ -588,7 +580,6 @@ components: - PRE_UPDATE_PASSWORD - PRE_UPDATE_PROFILE - PRE_REGISTRATION - - AUTHENTICATION ActionModel: type: object required: diff --git a/components/org.wso2.carbon.identity.api.server.action.management/pom.xml b/components/org.wso2.carbon.identity.api.server.action.management/pom.xml index 6bbfbab8f8..bce57b283c 100644 --- a/components/org.wso2.carbon.identity.api.server.action.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.action.management/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.identity.server.api identity-api-server - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.common/pom.xml index 67e33691d5..a4e8374444 100644 --- a/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.common/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.api.server.admin.advisory.management org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.v1/pom.xml index b83f58b020..409c6f95d4 100644 --- a/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.admin.advisory.management/org.wso2.carbon.identity.api.server.admin.advisory.management.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.api.server.admin.advisory.management org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.admin.advisory.management/pom.xml b/components/org.wso2.carbon.identity.api.server.admin.advisory.management/pom.xml index 0f0c7526da..35a02067bf 100644 --- a/components/org.wso2.carbon.identity.api.server.admin.advisory.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.admin.advisory.management/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.common/pom.xml b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.common/pom.xml index 4a098edde3..92453ba6f8 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.api.resource - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/pom.xml index 39199f0147..78fc256f2f 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.api.resource - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/pom.xml b/components/org.wso2.carbon.identity.api.server.api.resource/pom.xml index 05131aa207..85122fc38a 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.api.resource/pom.xml @@ -22,7 +22,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.common/pom.xml index df37755bc2..902a492cfe 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.common/pom.xml @@ -22,12 +22,12 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.application.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml org.wso2.carbon.identity.api.server.application.management.common - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT jar diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/pom.xml index 7938659aaa..b69f9c069d 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.application.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml WSO2 Identity Server - Applications Rest API WSO2 Identity Server - Applications Rest API org.wso2.carbon.identity.api.server.application.management.v1 - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT jar diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/application/management/v1/ApplicationsApi.java b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/application/management/v1/ApplicationsApi.java index f0cd6db86e..01a43fc798 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/application/management/v1/ApplicationsApi.java +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/application/management/v1/ApplicationsApi.java @@ -481,9 +481,10 @@ public Response getAllApplicationTemplates( @Valid@ApiParam(value = "Maximum @ApiResponse(code = 500, message = "Server Error", response = Error.class), @ApiResponse(code = 501, message = "Not Implemented", response = Error.class) }) - public Response getAllApplications( @Valid @Min(1)@ApiParam(value = "Maximum number of records to return. ", defaultValue="30") @DefaultValue("30") @QueryParam("limit") Integer limit, @Valid@ApiParam(value = "Number of records to skip for pagination. ", defaultValue="0") @DefaultValue("0") @QueryParam("offset") Integer offset, @Valid@ApiParam(value = "Condition to filter the retrieval of records. Supports 'sw', 'co', 'ew', and 'eq' operations with 'and', 'or' logical operators. Please note that 'and' and 'or' operators in filters follow the general precedence of logical operators ex: A and B or C and D = (A and B) or (C and D)). Currently supports only filtering based on the 'name', the 'clientId', and the 'issuer' attributes. /applications?filter=name+eq+user_portal
/applications?filter=name+co+prod+or+clientId+co+123 ") @QueryParam("filter") String filter, @Valid@ApiParam(value = "Define the order in which the retrieved records should be sorted. _This parameter is not supported yet._ ", allowableValues="ASC, DESC") @QueryParam("sortOrder") String sortOrder, @Valid@ApiParam(value = "Attribute by which the retrieved records should be sorted. _This parameter is not supported yet._ ") @QueryParam("sortBy") String sortBy, @Valid@ApiParam(value = "Specifies the required parameters in the response. Currently supports for only 'advancedConfigurations', 'templateId', 'templateVersion', 'clientId', 'issuer', 'applicationEnabled' and 'associatedRoles.allowedAudience' attributes. /applications?attributes=advancedConfigurations,templateId,templateVersion,clientId,applicationEnabled,associatedRoles.allowedAudience ") @QueryParam("attributes") String attributes) { + public Response getAllApplications( @Valid @Min(1)@ApiParam(value = "Maximum number of records to return. ", defaultValue="30") @DefaultValue("30") @QueryParam("limit") Integer limit, @Valid@ApiParam(value = "Number of records to skip for pagination. ", defaultValue="0") @DefaultValue("0") @QueryParam("offset") Integer offset, @Valid@ApiParam(value = "Condition to filter the retrieval of records. Supports 'sw', 'co', 'ew', and 'eq' operations with 'and', 'or' logical operators. Please note that 'and' and 'or' operators in filters follow the general precedence of logical operators ex: A and B or C and D = (A and B) or (C and D)). Currently supports only filtering based on the 'name', the 'clientId', and the 'issuer' attributes. /applications?filter=name+eq+user_portal
/applications?filter=name+co+prod+or+clientId+co+123 ") @QueryParam("filter") String filter, @Valid@ApiParam(value = "Define the order in which the retrieved records should be sorted. _This parameter is not supported yet._ ", allowableValues="ASC, DESC") @QueryParam("sortOrder") String sortOrder, @Valid@ApiParam(value = "Attribute by which the retrieved records should be sorted. _This parameter is not supported yet._ ") @QueryParam("sortBy") String sortBy, @Valid@ApiParam(value = "Specifies the required parameters in the response. Currently supports for only 'advancedConfigurations', 'templateId', 'templateVersion', 'clientId', 'issuer', 'applicationEnabled' and 'associatedRoles.allowedAudience' attributes. /applications?attributes=advancedConfigurations,templateId,templateVersion,clientId,applicationEnabled,associatedRoles.allowedAudience ") @QueryParam("attributes") String attributes, @Valid@ApiParam(value = "Specifies whether to include or exclude system portals in the response. /applications?excludeSystemPortals=true ") @QueryParam("excludeSystemPortals") Boolean excludeSystemPortals) { - return delegate.getAllApplications(limit, offset, filter, sortOrder, sortBy, attributes ); + return delegate.getAllApplications(limit, offset, filter, sortOrder, sortBy, attributes, + excludeSystemPortals); } @Valid diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/application/management/v1/ApplicationsApiService.java b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/application/management/v1/ApplicationsApiService.java index c90527e09b..42f25d323c 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/application/management/v1/ApplicationsApiService.java +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/application/management/v1/ApplicationsApiService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -90,6 +90,8 @@ public interface ApplicationsApiService { public Response getAllApplications(Integer limit, Integer offset, String filter, String sortOrder, String sortBy, String attributes); + public Response getAllApplications(Integer limit, Integer offset, String filter, String sortOrder, String sortBy, String attributes, Boolean excludeSystemPortals); + public Response getApplication(String applicationId); public Response getApplicationTemplate(String templateId); diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/ServerApplicationManagementService.java b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/ServerApplicationManagementService.java index 98b26b3272..08404d7944 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/ServerApplicationManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/ServerApplicationManagementService.java @@ -251,9 +251,17 @@ public class ServerApplicationManagementService { @Autowired private ServerApplicationMetadataService applicationMetadataService; + @Deprecated public ApplicationListResponse getAllApplications(Integer limit, Integer offset, String filter, String sortOrder, String sortBy, String requiredAttributes) { + return getAllApplications(limit, offset, filter, sortOrder, sortBy, requiredAttributes, false); + } + + public ApplicationListResponse getAllApplications(Integer limit, Integer offset, String filter, String sortOrder, + String sortBy, String requiredAttributes, + Boolean excludeSystemPortals) { + handleNotImplementedCapabilities(sortOrder, sortBy); String tenantDomain = ContextLoader.getTenantDomainFromContext(); @@ -277,10 +285,10 @@ public ApplicationListResponse getAllApplications(Integer limit, Integer offset, String username = ContextLoader.getUsernameFromContext(); try { int totalResults = getApplicationManagementService() - .getCountOfApplications(tenantDomain, username, filter); + .getCountOfApplications(tenantDomain, username, filter, excludeSystemPortals); ApplicationBasicInfo[] filteredAppList = getApplicationManagementService() - .getApplicationBasicInfo(tenantDomain, username, filter, offset, limit); + .getApplicationBasicInfo(tenantDomain, username, filter, offset, limit, excludeSystemPortals); int resultsInCurrentPage = filteredAppList.length; List requestedAttributeList = new ArrayList<>(); diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/functions/application/UpdateAuthenticationSequence.java b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/functions/application/UpdateAuthenticationSequence.java index 7b62ac766d..bd76572d87 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/functions/application/UpdateAuthenticationSequence.java +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/core/functions/application/UpdateAuthenticationSequence.java @@ -22,6 +22,7 @@ import org.wso2.carbon.identity.api.server.application.management.v1.core.functions.UpdateFunction; import org.wso2.carbon.identity.api.server.application.management.v1.core.functions.Utils; import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants; +import org.wso2.carbon.identity.application.common.ApplicationAuthenticatorService; import org.wso2.carbon.identity.application.common.model.AuthenticationStep; import org.wso2.carbon.identity.application.common.model.FederatedAuthenticatorConfig; import org.wso2.carbon.identity.application.common.model.IdentityProvider; @@ -31,6 +32,7 @@ import org.wso2.carbon.identity.application.common.model.ServiceProvider; import org.wso2.carbon.identity.application.common.model.script.AuthenticationScriptConfig; import org.wso2.carbon.identity.application.mgt.ApplicationConstants; +import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.DefinedByType; import java.util.ArrayList; import java.util.Collections; @@ -160,11 +162,17 @@ private AuthenticationStep buildAuthenticationStep(AuthenticationStepModel stepM LocalAuthenticatorConfig localAuthOption = new LocalAuthenticatorConfig(); localAuthOption.setEnabled(true); localAuthOption.setName(option.getAuthenticator()); + DefinedByType definedByType = ApplicationAuthenticatorService.getInstance() + .getLocalAuthenticatorByName(option.getAuthenticator()).getDefinedByType(); + localAuthOption.setDefinedByType(definedByType); localAuthOptions.add(localAuthOption); } else { FederatedAuthenticatorConfig federatedAuthConfig = new FederatedAuthenticatorConfig(); federatedAuthConfig.setEnabled(true); federatedAuthConfig.setName(option.getAuthenticator()); + DefinedByType definedByType = ApplicationAuthenticatorService.getInstance() + .getFederatedAuthenticatorByName(option.getAuthenticator()).getDefinedByType(); + federatedAuthConfig.setDefinedByType(definedByType); IdentityProvider federatedIdp = new IdentityProvider(); federatedIdp.setIdentityProviderName(option.getIdp()); diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/impl/ApplicationsApiServiceImpl.java b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/impl/ApplicationsApiServiceImpl.java index d6fef0ca9b..3b23d55554 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/impl/ApplicationsApiServiceImpl.java +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/java/org/wso2/carbon/identity/api/server/application/management/v1/impl/ApplicationsApiServiceImpl.java @@ -67,12 +67,20 @@ public class ApplicationsApiServiceImpl implements ApplicationsApiService { @Autowired private ServerApplicationSharingService applicationSharingService; + @Deprecated @Override public Response getAllApplications(Integer limit, Integer offset, String filter, String sortOrder, String sortBy, String requiredAttributes) { - ApplicationListResponse listResponse = applicationManagementService - .getAllApplications(limit, offset, filter, sortOrder, sortBy, requiredAttributes); + return getAllApplications(limit, offset, filter, sortOrder, sortBy, requiredAttributes, false); + } + + @Override + public Response getAllApplications(Integer limit, Integer offset, String filter, String sortOrder, String sortBy, + String requiredAttributes, Boolean excludeSystemPortals) { + + ApplicationListResponse listResponse = applicationManagementService.getAllApplications(limit, offset, filter, + sortOrder, sortBy, requiredAttributes, Boolean.TRUE.equals(excludeSystemPortals)); return Response.ok().entity(listResponse).build(); } diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/resources/applications.yaml b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/resources/applications.yaml index 015870dd03..0fa41a8d2b 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/resources/applications.yaml +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.v1/src/main/resources/applications.yaml @@ -38,6 +38,7 @@ paths: - $ref: '#/components/parameters/sortOrderQueryParam' - $ref: '#/components/parameters/sortByQueryParam' - $ref: '#/components/parameters/attributesQueryParam' + - $ref: '#/components/parameters/excludeSystemPortalsQueryParam' responses: '200': description: OK @@ -2701,6 +2702,17 @@ components: /applications?attributes=advancedConfigurations,templateId,templateVersion,clientId,applicationEnabled,associatedRoles.allowedAudience schema: type: string + excludeSystemPortalsQueryParam: + in: query + name: excludeSystemPortals + required: false + description: | + Specifies whether to include or exclude system portals in the response. + Default will be treated as false if parameter is not preset in the request. + + /applications?excludeSystemPortals=true + schema: + type: boolean exportSecretsQueryParam: in: query name: exportSecrets diff --git a/components/org.wso2.carbon.identity.api.server.application.management/pom.xml b/components/org.wso2.carbon.identity.api.server.application.management/pom.xml index fbbefeca25..e83882b8c6 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.application.management/pom.xml @@ -22,12 +22,12 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml org.wso2.carbon.identity.api.server.application.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT pom diff --git a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.common/pom.xml b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.common/pom.xml index 2002023858..e83ff1186b 100644 --- a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.authenticators - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT org.wso2.carbon.identity.api.server.authenticators.common diff --git a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/pom.xml index 32f9404184..d74c312656 100644 --- a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.authenticators - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT org.wso2.carbon.identity.api.server.authenticators.v1 diff --git a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/gen/java/org/wso2/carbon/identity/api/server/authenticators/v1/model/Authenticator.java b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/gen/java/org/wso2/carbon/identity/api/server/authenticators/v1/model/Authenticator.java index a79c8f2621..76fd698e31 100644 --- a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/gen/java/org/wso2/carbon/identity/api/server/authenticators/v1/model/Authenticator.java +++ b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/gen/java/org/wso2/carbon/identity/api/server/authenticators/v1/model/Authenticator.java @@ -37,6 +37,40 @@ public class Authenticator { private String displayName; private Boolean isEnabled; +@XmlType(name="DefinedByEnum") +@XmlEnum(String.class) +public enum DefinedByEnum { + + @XmlEnumValue("SYSTEM") SYSTEM(String.valueOf("SYSTEM")), @XmlEnumValue("USER") USER(String.valueOf("USER")); + + + private String value; + + DefinedByEnum(String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DefinedByEnum fromValue(String value) { + for (DefinedByEnum b : DefinedByEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private DefinedByEnum definedBy; + @XmlType(name="TypeEnum") @XmlEnum(String.class) public enum TypeEnum { @@ -148,6 +182,24 @@ public void setIsEnabled(Boolean isEnabled) { this.isEnabled = isEnabled; } + /** + **/ + public Authenticator definedBy(DefinedByEnum definedBy) { + + this.definedBy = definedBy; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("definedBy") + @Valid + public DefinedByEnum getDefinedBy() { + return definedBy; + } + public void setDefinedBy(DefinedByEnum definedBy) { + this.definedBy = definedBy; + } + /** **/ public Authenticator type(TypeEnum type) { @@ -262,6 +314,7 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.name, authenticator.name) && Objects.equals(this.displayName, authenticator.displayName) && Objects.equals(this.isEnabled, authenticator.isEnabled) && + Objects.equals(this.definedBy, authenticator.definedBy) && Objects.equals(this.type, authenticator.type) && Objects.equals(this.image, authenticator.image) && Objects.equals(this.description, authenticator.description) && @@ -271,7 +324,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(id, name, displayName, isEnabled, type, image, description, tags, self); + return Objects.hash(id, name, displayName, isEnabled, definedBy, type, image, description, tags, self); } @Override @@ -284,6 +337,7 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" definedBy: ").append(toIndentedString(definedBy)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" image: ").append(toIndentedString(image)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); diff --git a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/main/java/org/wso2/carbon/identity/api/server/authenticators/v1/core/ServerAuthenticatorManagementService.java b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/main/java/org/wso2/carbon/identity/api/server/authenticators/v1/core/ServerAuthenticatorManagementService.java index a67a7bf481..c888cfafdc 100644 --- a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/main/java/org/wso2/carbon/identity/api/server/authenticators/v1/core/ServerAuthenticatorManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/main/java/org/wso2/carbon/identity/api/server/authenticators/v1/core/ServerAuthenticatorManagementService.java @@ -41,6 +41,7 @@ import org.wso2.carbon.identity.application.common.model.IdentityProvider; import org.wso2.carbon.identity.application.common.model.LocalAuthenticatorConfig; import org.wso2.carbon.identity.application.common.model.RequestPathAuthenticatorConfig; +import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.DefinedByType; import org.wso2.carbon.identity.base.IdentityException; import org.wso2.carbon.identity.core.model.ExpressionNode; import org.wso2.carbon.identity.core.model.FilterTreeBuilder; @@ -421,6 +422,19 @@ private void addIdp(IdentityProvider identityProvider, List authe authenticator.setType(Authenticator.TypeEnum.FEDERATED); authenticator.setImage(identityProvider.getImageUrl()); authenticator.setDescription(identityProvider.getIdentityProviderDescription()); + + /* For the /authenticators APIs, per IDP have an item in the response payload, not per federated authenticator + within the IDP. If an IDP has more than one federated authenticator, it is considered as an existing older + authenticator and should always be classified as a SYSTEM type. Otherwise, it can be classified as either + SYSTEM or USER, depending on the 'definedBy' type of the federated authenticator. */ + if (identityProvider.getFederatedAuthenticatorConfigs().length == 1) { + DefinedByType definedByType = + identityProvider.getFederatedAuthenticatorConfigs()[0].getDefinedByType(); + authenticator.definedBy(Authenticator.DefinedByEnum.valueOf(definedByType.toString())); + } else { + authenticator.definedBy(Authenticator.DefinedByEnum.SYSTEM); + } + if (CollectionUtils.isNotEmpty(configTagsListDistinct)) { authenticator.setTags(configTagsListDistinct); } @@ -512,6 +526,7 @@ private Authenticator addLocalAuthenticator(LocalAuthenticatorConfig config) { authenticator.setDisplayName(config.getDisplayName()); authenticator.setIsEnabled(config.isEnabled()); authenticator.setType(Authenticator.TypeEnum.LOCAL); + authenticator.definedBy(Authenticator.DefinedByEnum.valueOf(config.getDefinedByType().toString())); String[] tags = config.getTags(); if (ArrayUtils.isNotEmpty(tags)) { authenticator.setTags(Arrays.asList(tags)); diff --git a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/main/resources/authenticators.yaml b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/main/resources/authenticators.yaml index fc489ae816..c91bc6ab54 100644 --- a/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/main/resources/authenticators.yaml +++ b/components/org.wso2.carbon.identity.api.server.authenticators/org.wso2.carbon.identity.api.server.authenticators.v1/src/main/resources/authenticators.yaml @@ -202,6 +202,11 @@ components: isEnabled: type: boolean example: true + definedBy: + type: string + enum: + - SYSTEM + - USER type: type: string enum: diff --git a/components/org.wso2.carbon.identity.api.server.authenticators/pom.xml b/components/org.wso2.carbon.identity.api.server.authenticators/pom.xml index a2b15be62d..50ed7e982d 100644 --- a/components/org.wso2.carbon.identity.api.server.authenticators/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.authenticators/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.common/pom.xml index 3a12f19bb6..eb23ec64bb 100644 --- a/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.common/pom.xml @@ -24,7 +24,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.branding.preference.management ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT org.wso2.carbon.identity.server.api diff --git a/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.v1/pom.xml index 12a4d70c20..0a87f1cb40 100644 --- a/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.branding.preference.management/org.wso2.carbon.identity.api.server.branding.preference.management.v1/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.identity.api.server.branding.preference.management org.wso2.carbon.identity.server.api ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.branding.preference.management/pom.xml b/components/org.wso2.carbon.identity.api.server.branding.preference.management/pom.xml index 387134c8c9..2fc00ef73e 100644 --- a/components/org.wso2.carbon.identity.api.server.branding.preference.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.branding.preference.management/pom.xml @@ -22,7 +22,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.api.server.claim.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.api.server.claim.management.common/pom.xml index 99a2161cc6..796131545e 100644 --- a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.api.server.claim.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.api.server.claim.management.common/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.api.server.claim.management org.wso2.carbon.identity.server.api ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.claim.management.common diff --git a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/pom.xml index 91de596731..a4283dc309 100644 --- a/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.claim.management/org.wso2.carbon.identity.rest.api.server.claim.management.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.claim.management ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 org.wso2.carbon.identity.rest.api.server.claim.management.v1 diff --git a/components/org.wso2.carbon.identity.api.server.claim.management/pom.xml b/components/org.wso2.carbon.identity.api.server.claim.management/pom.xml index 14c20c7d51..47401da4f2 100644 --- a/components/org.wso2.carbon.identity.api.server.claim.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.claim.management/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.common/pom.xml b/components/org.wso2.carbon.identity.api.server.common/pom.xml index d603fc074d..4810f2d31b 100644 --- a/components/org.wso2.carbon.identity.api.server.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.common/pom.xml @@ -19,7 +19,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.common/pom.xml b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.common/pom.xml index 2876ce0009..4d89b1a473 100644 --- a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.configs - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT org.wso2.carbon.identity.api.server.configs.common diff --git a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/pom.xml index bb2fc4c926..dba10a9fb3 100644 --- a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.configs - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT org.wso2.carbon.identity.api.server.configs.v1 diff --git a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/gen/java/org/wso2/carbon/identity/api/server/configs/v1/model/Authenticator.java b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/gen/java/org/wso2/carbon/identity/api/server/configs/v1/model/Authenticator.java index ab982bc225..744e6dbe18 100644 --- a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/gen/java/org/wso2/carbon/identity/api/server/configs/v1/model/Authenticator.java +++ b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/gen/java/org/wso2/carbon/identity/api/server/configs/v1/model/Authenticator.java @@ -38,6 +38,40 @@ public class Authenticator { private String displayName; private Boolean isEnabled = true; +@XmlType(name="DefinedByEnum") +@XmlEnum(String.class) +public enum DefinedByEnum { + + @XmlEnumValue("SYSTEM") SYSTEM(String.valueOf("SYSTEM")), @XmlEnumValue("USER") USER(String.valueOf("USER")); + + + private String value; + + DefinedByEnum(String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DefinedByEnum fromValue(String value) { + for (DefinedByEnum b : DefinedByEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private DefinedByEnum definedBy; + @XmlType(name="TypeEnum") @XmlEnum(String.class) public enum TypeEnum { @@ -152,6 +186,24 @@ public void setIsEnabled(Boolean isEnabled) { this.isEnabled = isEnabled; } + /** + **/ + public Authenticator definedBy(DefinedByEnum definedBy) { + + this.definedBy = definedBy; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("definedBy") + @Valid + public DefinedByEnum getDefinedBy() { + return definedBy; + } + public void setDefinedBy(DefinedByEnum definedBy) { + this.definedBy = definedBy; + } + /** **/ public Authenticator type(TypeEnum type) { @@ -238,6 +290,7 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.name, authenticator.name) && Objects.equals(this.displayName, authenticator.displayName) && Objects.equals(this.isEnabled, authenticator.isEnabled) && + Objects.equals(this.definedBy, authenticator.definedBy) && Objects.equals(this.type, authenticator.type) && Objects.equals(this.tags, authenticator.tags) && Objects.equals(this.properties, authenticator.properties); @@ -245,7 +298,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(id, name, displayName, isEnabled, type, tags, properties); + return Objects.hash(id, name, displayName, isEnabled, definedBy, type, tags, properties); } @Override @@ -258,6 +311,7 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" definedBy: ").append(toIndentedString(definedBy)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); diff --git a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/gen/java/org/wso2/carbon/identity/api/server/configs/v1/model/AuthenticatorListItem.java b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/gen/java/org/wso2/carbon/identity/api/server/configs/v1/model/AuthenticatorListItem.java index 4703973ec6..ba26a797e4 100644 --- a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/gen/java/org/wso2/carbon/identity/api/server/configs/v1/model/AuthenticatorListItem.java +++ b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/gen/java/org/wso2/carbon/identity/api/server/configs/v1/model/AuthenticatorListItem.java @@ -37,6 +37,40 @@ public class AuthenticatorListItem { private String displayName; private Boolean isEnabled = true; +@XmlType(name="DefinedByEnum") +@XmlEnum(String.class) +public enum DefinedByEnum { + + @XmlEnumValue("SYSTEM") SYSTEM(String.valueOf("SYSTEM")), @XmlEnumValue("USER") USER(String.valueOf("USER")); + + + private String value; + + DefinedByEnum(String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DefinedByEnum fromValue(String value) { + for (DefinedByEnum b : DefinedByEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private DefinedByEnum definedBy; + @XmlType(name="TypeEnum") @XmlEnum(String.class) public enum TypeEnum { @@ -146,6 +180,24 @@ public void setIsEnabled(Boolean isEnabled) { this.isEnabled = isEnabled; } + /** + **/ + public AuthenticatorListItem definedBy(DefinedByEnum definedBy) { + + this.definedBy = definedBy; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("definedBy") + @Valid + public DefinedByEnum getDefinedBy() { + return definedBy; + } + public void setDefinedBy(DefinedByEnum definedBy) { + this.definedBy = definedBy; + } + /** **/ public AuthenticatorListItem type(TypeEnum type) { @@ -224,6 +276,7 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.name, authenticatorListItem.name) && Objects.equals(this.displayName, authenticatorListItem.displayName) && Objects.equals(this.isEnabled, authenticatorListItem.isEnabled) && + Objects.equals(this.definedBy, authenticatorListItem.definedBy) && Objects.equals(this.type, authenticatorListItem.type) && Objects.equals(this.tags, authenticatorListItem.tags) && Objects.equals(this.self, authenticatorListItem.self); @@ -231,7 +284,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(id, name, displayName, isEnabled, type, tags, self); + return Objects.hash(id, name, displayName, isEnabled, definedBy, type, tags, self); } @Override @@ -244,6 +297,7 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" definedBy: ").append(toIndentedString(definedBy)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" self: ").append(toIndentedString(self)).append("\n"); diff --git a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/main/java/org/wso2/carbon/identity/api/server/configs/v1/core/ServerConfigManagementService.java b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/main/java/org/wso2/carbon/identity/api/server/configs/v1/core/ServerConfigManagementService.java index 142d5bfe13..023adfee91 100644 --- a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/main/java/org/wso2/carbon/identity/api/server/configs/v1/core/ServerConfigManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/main/java/org/wso2/carbon/identity/api/server/configs/v1/core/ServerConfigManagementService.java @@ -704,6 +704,8 @@ private List buildAuthenticatorListResponse( authenticatorListItem.setDisplayName(config.getDisplayName()); authenticatorListItem.setIsEnabled(config.isEnabled()); authenticatorListItem.setType(AuthenticatorListItem.TypeEnum.LOCAL); + authenticatorListItem.setDefinedBy( + AuthenticatorListItem.DefinedByEnum.valueOf(config.getDefinedByType().toString())); String[] tags = config.getTags(); if (ArrayUtils.isNotEmpty(tags)) { authenticatorListItem.setTags(Arrays.asList(tags)); @@ -722,6 +724,7 @@ private List buildAuthenticatorListResponse( authenticatorListItem.setDisplayName(config.getDisplayName()); authenticatorListItem.setIsEnabled(config.isEnabled()); authenticatorListItem.setType(AuthenticatorListItem.TypeEnum.REQUEST_PATH); + authenticatorListItem.setDefinedBy(AuthenticatorListItem.DefinedByEnum.SYSTEM); String[] tags = config.getTags(); if (ArrayUtils.isNotEmpty(tags)) { authenticatorListItem.setTags(Arrays.asList(tags)); @@ -771,6 +774,7 @@ private Authenticator buildAuthenticatorResponse(LocalAuthenticatorConfig config authenticator.setName(config.getName()); authenticator.setDisplayName(config.getDisplayName()); authenticator.setIsEnabled(config.isEnabled()); + authenticator.definedBy(Authenticator.DefinedByEnum.valueOf(config.getDefinedByType().toString())); if (config instanceof RequestPathAuthenticatorConfig) { authenticator.setType(Authenticator.TypeEnum.REQUEST_PATH); } else { diff --git a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/main/resources/configs.yaml b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/main/resources/configs.yaml index a7226d6ec9..fa508a56ff 100644 --- a/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/main/resources/configs.yaml +++ b/components/org.wso2.carbon.identity.api.server.configs/org.wso2.carbon.identity.api.server.configs.v1/src/main/resources/configs.yaml @@ -1187,6 +1187,11 @@ components: type: boolean default: true example: true + definedBy: + type: string + enum: + - SYSTEM + - USER type: type: string enum: @@ -1217,6 +1222,11 @@ components: isEnabled: type: boolean default: true + definedBy: + type: string + enum: + - SYSTEM + - USER type: type: string enum: diff --git a/components/org.wso2.carbon.identity.api.server.configs/pom.xml b/components/org.wso2.carbon.identity.api.server.configs/pom.xml index 7d7c47137c..89cf73c10a 100644 --- a/components/org.wso2.carbon.identity.api.server.configs/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.configs/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.common/pom.xml b/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.common/pom.xml index d355b48ec4..af54143afe 100644 --- a/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.cors - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT org.wso2.carbon.identity.api.server.cors.common diff --git a/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.v1/pom.xml index 21c02b17ad..0e555d8630 100644 --- a/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.cors/org.wso2.carbon.identity.api.server.cors.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.cors - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT org.wso2.carbon.identity.api.server.cors.v1 diff --git a/components/org.wso2.carbon.identity.api.server.cors/pom.xml b/components/org.wso2.carbon.identity.api.server.cors/pom.xml index abe1391a4c..bd420cc4a4 100644 --- a/components/org.wso2.carbon.identity.api.server.cors/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.cors/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.api.server.email.template.common/pom.xml b/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.api.server.email.template.common/pom.xml index a108b72b17..e61089392a 100644 --- a/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.api.server.email.template.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.api.server.email.template.common/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.email.template - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.rest.api.server.email.template.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.rest.api.server.email.template.v1/pom.xml index f3ff4a274d..ac8cc05164 100644 --- a/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.rest.api.server.email.template.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.rest.api.server.email.template.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.email.template - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.rest.api.server.email.template.v2/pom.xml b/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.rest.api.server.email.template.v2/pom.xml index cb5ed2901d..f88e797829 100644 --- a/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.rest.api.server.email.template.v2/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.email.template/org.wso2.carbon.identity.rest.api.server.email.template.v2/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.email.template - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.email.template/pom.xml b/components/org.wso2.carbon.identity.api.server.email.template/pom.xml index 3291d4e6a4..e0ec5fb2a8 100644 --- a/components/org.wso2.carbon.identity.api.server.email.template/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.email.template/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api identity-api-server - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.common/pom.xml index b5fbb989be..b78d1e6842 100644 --- a/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.common/pom.xml @@ -19,7 +19,7 @@ org.wso2.carbon.identity.api.server.extension.management org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.v1/pom.xml index 9bb4610cff..2de9bd7365 100644 --- a/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.extension.management/org.wso2.carbon.identity.api.server.extension.management.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.extension.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT org.wso2.carbon.identity.api.server.extension.management.v1 diff --git a/components/org.wso2.carbon.identity.api.server.extension.management/pom.xml b/components/org.wso2.carbon.identity.api.server.extension.management/pom.xml index 19e2fb316f..9b69233cf8 100644 --- a/components/org.wso2.carbon.identity.api.server.extension.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.extension.management/pom.xml @@ -19,7 +19,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.common/pom.xml b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.common/pom.xml index 451a577e57..0dcbb6da55 100644 --- a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.common/pom.xml @@ -18,7 +18,7 @@ org.wso2.carbon.identity.api.server.identity.governance org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/pom.xml index d099249ce0..cc591fcc25 100644 --- a/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/org.wso2.carbon.identity.api.server.identity.governance.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.identity.governance ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.identity.governance.v1 diff --git a/components/org.wso2.carbon.identity.api.server.identity.governance/pom.xml b/components/org.wso2.carbon.identity.api.server.identity.governance/pom.xml index 088edff51c..cc94baa428 100644 --- a/components/org.wso2.carbon.identity.api.server.identity.governance/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.identity.governance/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/pom.xml b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/pom.xml index a4e0e7bf71..1024d69add 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.api.server.idp org.wso2.carbon.identity.server.api ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/pom.xml index 81063de30a..855a05b300 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.idp ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/FederatedAuthenticator.java b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/FederatedAuthenticator.java index 84373ee10c..5996d10619 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/FederatedAuthenticator.java +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/FederatedAuthenticator.java @@ -36,6 +36,40 @@ public class FederatedAuthenticator { private String authenticatorId; private String name; private Boolean isEnabled = false; + +@XmlType(name="DefinedByEnum") +@XmlEnum(String.class) +public enum DefinedByEnum { + + @XmlEnumValue("SYSTEM") SYSTEM(String.valueOf("SYSTEM")), @XmlEnumValue("USER") USER(String.valueOf("USER")); + + + private String value; + + DefinedByEnum(String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DefinedByEnum fromValue(String value) { + for (DefinedByEnum b : DefinedByEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private DefinedByEnum definedBy; private Boolean isDefault = false; private List tags = null; @@ -98,6 +132,24 @@ public void setIsEnabled(Boolean isEnabled) { this.isEnabled = isEnabled; } + /** + **/ + public FederatedAuthenticator definedBy(DefinedByEnum definedBy) { + + this.definedBy = definedBy; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("definedBy") + @Valid + public DefinedByEnum getDefinedBy() { + return definedBy; + } + public void setDefinedBy(DefinedByEnum definedBy) { + this.definedBy = definedBy; + } + /** **/ public FederatedAuthenticator isDefault(Boolean isDefault) { @@ -183,6 +235,7 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.authenticatorId, federatedAuthenticator.authenticatorId) && Objects.equals(this.name, federatedAuthenticator.name) && Objects.equals(this.isEnabled, federatedAuthenticator.isEnabled) && + Objects.equals(this.definedBy, federatedAuthenticator.definedBy) && Objects.equals(this.isDefault, federatedAuthenticator.isDefault) && Objects.equals(this.tags, federatedAuthenticator.tags) && Objects.equals(this.properties, federatedAuthenticator.properties); @@ -190,7 +243,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(authenticatorId, name, isEnabled, isDefault, tags, properties); + return Objects.hash(authenticatorId, name, isEnabled, definedBy, isDefault, tags, properties); } @Override @@ -202,6 +255,7 @@ public String toString() { sb.append(" authenticatorId: ").append(toIndentedString(authenticatorId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" definedBy: ").append(toIndentedString(definedBy)).append("\n"); sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/FederatedAuthenticatorListItem.java b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/FederatedAuthenticatorListItem.java index 1c479915aa..ea7d4d2a13 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/FederatedAuthenticatorListItem.java +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/FederatedAuthenticatorListItem.java @@ -35,6 +35,40 @@ public class FederatedAuthenticatorListItem { private String authenticatorId; private String name; private Boolean isEnabled = false; + +@XmlType(name="DefinedByEnum") +@XmlEnum(String.class) +public enum DefinedByEnum { + + @XmlEnumValue("SYSTEM") SYSTEM(String.valueOf("SYSTEM")), @XmlEnumValue("USER") USER(String.valueOf("USER")); + + + private String value; + + DefinedByEnum(String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DefinedByEnum fromValue(String value) { + for (DefinedByEnum b : DefinedByEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private DefinedByEnum definedBy; private List tags = null; private String self; @@ -93,6 +127,24 @@ public void setIsEnabled(Boolean isEnabled) { this.isEnabled = isEnabled; } + /** + **/ + public FederatedAuthenticatorListItem definedBy(DefinedByEnum definedBy) { + + this.definedBy = definedBy; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("definedBy") + @Valid + public DefinedByEnum getDefinedBy() { + return definedBy; + } + public void setDefinedBy(DefinedByEnum definedBy) { + this.definedBy = definedBy; + } + /** **/ public FederatedAuthenticatorListItem tags(List tags) { @@ -152,13 +204,14 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.authenticatorId, federatedAuthenticatorListItem.authenticatorId) && Objects.equals(this.name, federatedAuthenticatorListItem.name) && Objects.equals(this.isEnabled, federatedAuthenticatorListItem.isEnabled) && + Objects.equals(this.definedBy, federatedAuthenticatorListItem.definedBy) && Objects.equals(this.tags, federatedAuthenticatorListItem.tags) && Objects.equals(this.self, federatedAuthenticatorListItem.self); } @Override public int hashCode() { - return Objects.hash(authenticatorId, name, isEnabled, tags, self); + return Objects.hash(authenticatorId, name, isEnabled, definedBy, tags, self); } @Override @@ -170,6 +223,7 @@ public String toString() { sb.append(" authenticatorId: ").append(toIndentedString(authenticatorId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" definedBy: ").append(toIndentedString(definedBy)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" self: ").append(toIndentedString(self)).append("\n"); sb.append("}"); diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/FederatedAuthenticatorPUTRequest.java b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/FederatedAuthenticatorPUTRequest.java index 0ec1edc32b..685579c64a 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/FederatedAuthenticatorPUTRequest.java +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/FederatedAuthenticatorPUTRequest.java @@ -37,6 +37,40 @@ public class FederatedAuthenticatorPUTRequest { private String name; private Boolean isEnabled = false; private Boolean isDefault = false; + +@XmlType(name="DefinedByEnum") +@XmlEnum(String.class) +public enum DefinedByEnum { + + @XmlEnumValue("SYSTEM") SYSTEM(String.valueOf("SYSTEM")), @XmlEnumValue("USER") USER(String.valueOf("USER")); + + + private String value; + + DefinedByEnum(String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DefinedByEnum fromValue(String value) { + for (DefinedByEnum b : DefinedByEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private DefinedByEnum definedBy; private List properties = null; @@ -112,6 +146,24 @@ public void setIsDefault(Boolean isDefault) { this.isDefault = isDefault; } + /** + **/ + public FederatedAuthenticatorPUTRequest definedBy(DefinedByEnum definedBy) { + + this.definedBy = definedBy; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("definedBy") + @Valid + public DefinedByEnum getDefinedBy() { + return definedBy; + } + public void setDefinedBy(DefinedByEnum definedBy) { + this.definedBy = definedBy; + } + /** **/ public FederatedAuthenticatorPUTRequest properties(List properties) { @@ -154,12 +206,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.name, federatedAuthenticatorPUTRequest.name) && Objects.equals(this.isEnabled, federatedAuthenticatorPUTRequest.isEnabled) && Objects.equals(this.isDefault, federatedAuthenticatorPUTRequest.isDefault) && + Objects.equals(this.definedBy, federatedAuthenticatorPUTRequest.definedBy) && Objects.equals(this.properties, federatedAuthenticatorPUTRequest.properties); } @Override public int hashCode() { - return Objects.hash(authenticatorId, name, isEnabled, isDefault, properties); + return Objects.hash(authenticatorId, name, isEnabled, isDefault, definedBy, properties); } @Override @@ -172,6 +225,7 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" definedBy: ").append(toIndentedString(definedBy)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/MetaFederatedAuthenticator.java b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/MetaFederatedAuthenticator.java index d85f7cc9af..46483c4c83 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/MetaFederatedAuthenticator.java +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/MetaFederatedAuthenticator.java @@ -36,6 +36,40 @@ public class MetaFederatedAuthenticator { private String authenticatorId; private String name; private String displayName; + +@XmlType(name="DefinedByEnum") +@XmlEnum(String.class) +public enum DefinedByEnum { + + @XmlEnumValue("SYSTEM") SYSTEM(String.valueOf("SYSTEM")), @XmlEnumValue("USER") USER(String.valueOf("USER")); + + + private String value; + + DefinedByEnum(String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DefinedByEnum fromValue(String value) { + for (DefinedByEnum b : DefinedByEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private DefinedByEnum definedBy; private List tags = null; private List properties = null; @@ -95,6 +129,24 @@ public void setDisplayName(String displayName) { this.displayName = displayName; } + /** + **/ + public MetaFederatedAuthenticator definedBy(DefinedByEnum definedBy) { + + this.definedBy = definedBy; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("definedBy") + @Valid + public DefinedByEnum getDefinedBy() { + return definedBy; + } + public void setDefinedBy(DefinedByEnum definedBy) { + this.definedBy = definedBy; + } + /** **/ public MetaFederatedAuthenticator tags(List tags) { @@ -162,13 +214,14 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.authenticatorId, metaFederatedAuthenticator.authenticatorId) && Objects.equals(this.name, metaFederatedAuthenticator.name) && Objects.equals(this.displayName, metaFederatedAuthenticator.displayName) && + Objects.equals(this.definedBy, metaFederatedAuthenticator.definedBy) && Objects.equals(this.tags, metaFederatedAuthenticator.tags) && Objects.equals(this.properties, metaFederatedAuthenticator.properties); } @Override public int hashCode() { - return Objects.hash(authenticatorId, name, displayName, tags, properties); + return Objects.hash(authenticatorId, name, displayName, definedBy, tags, properties); } @Override @@ -180,6 +233,7 @@ public String toString() { sb.append(" authenticatorId: ").append(toIndentedString(authenticatorId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" definedBy: ").append(toIndentedString(definedBy)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); sb.append("}"); diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/MetaFederatedAuthenticatorListItem.java b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/MetaFederatedAuthenticatorListItem.java index b7ef4c326a..7def0a4289 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/MetaFederatedAuthenticatorListItem.java +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/gen/java/org/wso2/carbon/identity/api/server/idp/v1/model/MetaFederatedAuthenticatorListItem.java @@ -34,6 +34,40 @@ public class MetaFederatedAuthenticatorListItem { private String authenticatorId; private String name; + +@XmlType(name="DefinedByEnum") +@XmlEnum(String.class) +public enum DefinedByEnum { + + @XmlEnumValue("SYSTEM") SYSTEM(String.valueOf("SYSTEM")), @XmlEnumValue("USER") USER(String.valueOf("USER")); + + + private String value; + + DefinedByEnum(String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DefinedByEnum fromValue(String value) { + for (DefinedByEnum b : DefinedByEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private DefinedByEnum definedBy; private List tags = null; private String self; @@ -74,6 +108,24 @@ public void setName(String name) { this.name = name; } + /** + **/ + public MetaFederatedAuthenticatorListItem definedBy(DefinedByEnum definedBy) { + + this.definedBy = definedBy; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("definedBy") + @Valid + public DefinedByEnum getDefinedBy() { + return definedBy; + } + public void setDefinedBy(DefinedByEnum definedBy) { + this.definedBy = definedBy; + } + /** **/ public MetaFederatedAuthenticatorListItem tags(List tags) { @@ -132,13 +184,14 @@ public boolean equals(java.lang.Object o) { MetaFederatedAuthenticatorListItem metaFederatedAuthenticatorListItem = (MetaFederatedAuthenticatorListItem) o; return Objects.equals(this.authenticatorId, metaFederatedAuthenticatorListItem.authenticatorId) && Objects.equals(this.name, metaFederatedAuthenticatorListItem.name) && + Objects.equals(this.definedBy, metaFederatedAuthenticatorListItem.definedBy) && Objects.equals(this.tags, metaFederatedAuthenticatorListItem.tags) && Objects.equals(this.self, metaFederatedAuthenticatorListItem.self); } @Override public int hashCode() { - return Objects.hash(authenticatorId, name, tags, self); + return Objects.hash(authenticatorId, name, definedBy, tags, self); } @Override @@ -149,6 +202,7 @@ public String toString() { sb.append(" authenticatorId: ").append(toIndentedString(authenticatorId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" definedBy: ").append(toIndentedString(definedBy)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" self: ").append(toIndentedString(self)).append("\n"); sb.append("}"); diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.java b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.java index da4f38f5c9..bac516e2d9 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/java/org/wso2/carbon/identity/api/server/idp/v1/core/ServerIdpManagementService.java @@ -94,6 +94,7 @@ import org.wso2.carbon.identity.application.common.model.RoleMapping; import org.wso2.carbon.identity.application.common.model.SubProperty; import org.wso2.carbon.identity.application.common.util.IdentityApplicationConstants; +import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.DefinedByType; import org.wso2.carbon.identity.claim.metadata.mgt.exception.ClaimMetadataException; import org.wso2.carbon.identity.claim.metadata.mgt.model.LocalClaim; import org.wso2.carbon.identity.configuration.mgt.core.model.ResourceSearchBean; @@ -673,8 +674,7 @@ public FederatedAuthenticatorListResponse updateFederatedAuthenticators(String i // Need to create a clone, since modifying the fields of the original object, will modify the cached // IDP object. IdentityProvider idpToUpdate = createIdPClone(idp); - updateFederatedAuthenticatorConfig(idpToUpdate, authenticatorRequest); - + updateFederatedAuthenticatorConfig(idpToUpdate, authenticatorRequest, false); IdentityProvider updatedIdp = IdentityProviderServiceHolder.getIdentityProviderManager() .updateIdPByResourceId( idpId, idpToUpdate, ContextLoader.getTenantDomainFromContext()); @@ -683,7 +683,6 @@ public FederatedAuthenticatorListResponse updateFederatedAuthenticators(String i throw handleIdPException(e, Constants.ErrorMessage.ERROR_CODE_ERROR_UPDATING_IDP, StringUtils.EMPTY); } } - /** * Update federated authenticator of and IDP. * @@ -708,7 +707,7 @@ public FederatedAuthenticator updateFederatedAuthenticator(String idpId, String IdentityProvider idpToUpdate = createIdPClone(idp); // Create new FederatedAuthenticatorConfig to store the federated authenticator information. - FederatedAuthenticatorConfig authConfig = createFederatedAuthenticatorConfig(federatedAuthenticatorId, + FederatedAuthenticatorConfig authConfig = updateFederatedAuthenticatorConfig(federatedAuthenticatorId, authenticator); FederatedAuthenticatorConfig[] fedAuthConfigs = createFederatedAuthenticatorArrayClone (federatedAuthenticatorId, idp.getFederatedAuthenticatorConfigs()); @@ -1759,7 +1758,7 @@ private MetaOutboundConnector createMetaOutboundConnector(ProvisioningConnectorC } private void updateFederatedAuthenticatorConfig(IdentityProvider idp, FederatedAuthenticatorRequest - federatedAuthenticatorRequest) { + federatedAuthenticatorRequest, boolean isNewFederatedAuthenticator) { if (federatedAuthenticatorRequest != null) { List federatedAuthenticators = federatedAuthenticatorRequest.getAuthenticators(); @@ -1771,6 +1770,14 @@ private void updateFederatedAuthenticatorConfig(IdentityProvider idp, FederatedA authConfig.setName(base64URLDecode(authenticator.getAuthenticatorId())); authConfig.setDisplayName(getDisplayNameOfAuthenticator(authConfig.getName())); authConfig.setEnabled(authenticator.getIsEnabled()); + + String definedByType = null; + if (authenticator.getDefinedBy() != null) { + definedByType = authenticator.getDefinedBy().toString(); + } + authConfig.setDefinedByType(resolveDefinedByType(authConfig.getName(), + definedByType, isNewFederatedAuthenticator)); + List authProperties = authenticator.getProperties(); if (IdentityApplicationConstants.Authenticator.SAML2SSO.FED_AUTH_NAME.equals(authConfig.getName())) { @@ -2110,7 +2117,7 @@ private IdentityProvider createIDP(IdentityProviderPOSTRequest identityProviderP } idp.setFederationHub(identityProviderPOSTRequest.getIsFederationHub()); - updateFederatedAuthenticatorConfig(idp, identityProviderPOSTRequest.getFederatedAuthenticators()); + updateFederatedAuthenticatorConfig(idp, identityProviderPOSTRequest.getFederatedAuthenticators(), true); if (identityProviderPOSTRequest.getProvisioning() != null) { updateOutboundConnectorConfig(idp, identityProviderPOSTRequest.getProvisioning().getOutboundConnectors()); updateJIT(idp, identityProviderPOSTRequest.getProvisioning().getJit()); @@ -2456,6 +2463,8 @@ private FederatedAuthenticatorListResponse createFederatedAuthenticatorResponse( fedAuthListItem.setAuthenticatorId(base64URLEncode(fedAuthConfig.getName())); fedAuthListItem.setName(fedAuthConfig.getName()); fedAuthListItem.setIsEnabled(fedAuthConfig.isEnabled()); + fedAuthListItem.setDefinedBy(FederatedAuthenticatorListItem.DefinedByEnum.valueOf( + fedAuthConfig.getDefinedByType().toString())); FederatedAuthenticatorConfig federatedAuthenticatorConfig = ApplicationAuthenticatorService.getInstance().getFederatedAuthenticatorByName( fedAuthConfig.getName()); @@ -2829,7 +2838,7 @@ private ProvisioningConnectorConfig createProvisioningConnectorConfig(String out * @param authenticator Internal federated authenticator config. * @return Federated authenticator config of the specified ID. */ - private FederatedAuthenticatorConfig createFederatedAuthenticatorConfig(String federatedAuthenticatorId, + private FederatedAuthenticatorConfig updateFederatedAuthenticatorConfig(String federatedAuthenticatorId, FederatedAuthenticatorPUTRequest authenticator) { @@ -2838,6 +2847,13 @@ private FederatedAuthenticatorConfig createFederatedAuthenticatorConfig(String f authConfig.setName(authenticatorName); authConfig.setDisplayName(getDisplayNameOfAuthenticator(authenticatorName)); authConfig.setEnabled(authenticator.getIsEnabled()); + + String definedByType = null; + if (authenticator.getDefinedBy() != null) { + definedByType = authenticator.getDefinedBy().toString(); + } + authConfig.setDefinedByType(resolveDefinedByType(authenticatorName, definedByType, false)); + List authProperties = authenticator.getProperties(); if (IdentityApplicationConstants.Authenticator.SAML2SSO.FED_AUTH_NAME.equals(authenticatorName)) { validateSamlMetadata(authProperties); @@ -2851,6 +2867,30 @@ private FederatedAuthenticatorConfig createFederatedAuthenticatorConfig(String f return authConfig; } + private DefinedByType resolveDefinedByType( + String authenticatorName, String definedByType, boolean isNewFederatedAuthenticator) { + + /* For new federated authenticators: + If 'definedByType' is not null, use the value provided in the request payload. If not, default to SYSTEM. */ + if (isNewFederatedAuthenticator) { + if (definedByType != null) { + return DefinedByType.valueOf(definedByType); + } else { + return DefinedByType.SYSTEM; + } + } + /* For existing federated authenticators, disregard any value provided in the request payload. + Instead, resolve and retrieve the 'definedBy' type of the corresponding existing authenticator. + If the authenticator config is present in the ApplicationAuthenticatorService list, return its type, + if not return USER. */ + FederatedAuthenticatorConfig authenticatorConfig = ApplicationAuthenticatorService.getInstance() + .getFederatedAuthenticatorByName(authenticatorName); + if (authenticatorConfig != null) { + return DefinedByType.valueOf(authenticatorConfig.getDefinedByType().toString()); + } + return DefinedByType.USER; + } + /** * Verify if scopes have not been set in both Scopes field and Additional Query Parameters field * @@ -3030,6 +3070,8 @@ private FederatedAuthenticator createFederatedAuthenticator(String authenticator federatedAuthenticator.setName(config.getName()); federatedAuthenticator.setIsEnabled(config.isEnabled()); federatedAuthenticator.setIsDefault(isDefaultAuthenticator); + federatedAuthenticator.setDefinedBy(FederatedAuthenticator.DefinedByEnum.valueOf( + config.getDefinedByType().toString())); FederatedAuthenticatorConfig federatedAuthenticatorConfig = ApplicationAuthenticatorService.getInstance().getFederatedAuthenticatorByName( config.getName()); diff --git a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/resources/idp.yaml b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/resources/idp.yaml index 8fee505e59..9e0df2e09d 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/resources/idp.yaml +++ b/components/org.wso2.carbon.identity.api.server.idp/org.wso2.carbon.identity.api.server.idp.v1/src/main/resources/idp.yaml @@ -2783,6 +2783,11 @@ components: name: type: string example: SAML2Authenticator + definedBy: + type: string + enum: + - SYSTEM + - USER tags: type: array items: @@ -2804,6 +2809,11 @@ components: displayName: type: string example: 'SAML2 Web SSO Configuration' + definedBy: + type: string + enum: + - SYSTEM + - USER tags: type: array items: @@ -2849,6 +2859,11 @@ components: type: boolean default: false example: true + definedBy: + type: string + enum: + - SYSTEM + - USER isDefault: type: boolean default: false @@ -2881,6 +2896,11 @@ components: type: boolean default: false example: false + definedBy: + type: string + enum: + - SYSTEM + - USER properties: type: array items: @@ -2908,6 +2928,11 @@ components: type: boolean default: false example: true + definedBy: + type: string + enum: + - SYSTEM + - USER tags: type: array items: diff --git a/components/org.wso2.carbon.identity.api.server.idp/pom.xml b/components/org.wso2.carbon.identity.api.server.idp/pom.xml index 8032759ab3..47dafb0b0d 100644 --- a/components/org.wso2.carbon.identity.api.server.idp/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.idp/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.common/pom.xml b/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.common/pom.xml index 5f16eb0e35..ade8510fcf 100644 --- a/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.idv.provider ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT org.wso2.carbon.identity.api.server.idv.provider.common diff --git a/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.v1/pom.xml index da4b3d940f..d7f51a2df5 100644 --- a/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.idv.provider/org.wso2.carbon.identity.api.server.idv.provider.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.idv.provider ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT org.wso2.carbon.identity.api.server.idv.provider.v1 diff --git a/components/org.wso2.carbon.identity.api.server.idv.provider/pom.xml b/components/org.wso2.carbon.identity.api.server.idv.provider/pom.xml index 86e98964b4..295f27a897 100644 --- a/components/org.wso2.carbon.identity.api.server.idv.provider/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.idv.provider/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api identity-api-server - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.common/pom.xml b/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.common/pom.xml index 44e6405023..577fa27a21 100644 --- a/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.api.server.input.validation org.wso2.carbon.identity.server.api ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.v1/pom.xml index 4d45e7a5aa..d23158b528 100644 --- a/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.input.validation/org.wso2.carbon.identity.api.server.input.validation.v1/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.input.validation - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml WSO2 Identity Server - Input Validation Rest API WSO2 Identity Server - Validation Rest API org.wso2.carbon.identity.api.server.input.validation.v1 - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT jar diff --git a/components/org.wso2.carbon.identity.api.server.input.validation/pom.xml b/components/org.wso2.carbon.identity.api.server.input.validation/pom.xml index f61b3a43ac..7e0c846ab2 100644 --- a/components/org.wso2.carbon.identity.api.server.input.validation/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.input.validation/pom.xml @@ -22,7 +22,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.common/pom.xml index a6ddfb3466..52a27ef722 100644 --- a/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.common/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.keystore.management ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.keystore.management.common diff --git a/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.v1/pom.xml index 67a5a123a4..573a136d8b 100644 --- a/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.keystore.management/org.wso2.carbon.identity.api.server.keystore.management.v1/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.keystore.management ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.keystore.management.v1 diff --git a/components/org.wso2.carbon.identity.api.server.keystore.management/pom.xml b/components/org.wso2.carbon.identity.api.server.keystore.management/pom.xml index 4ba9826caa..e3994f9144 100644 --- a/components/org.wso2.carbon.identity.api.server.keystore.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.keystore.management/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.common/pom.xml b/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.common/pom.xml index 77e2e36cf1..ae3a06aacc 100644 --- a/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.api.server.notification.sender org.wso2.carbon.identity.server.api ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.v1/pom.xml index 6343d0d7be..bb12c0c2fd 100644 --- a/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.notification.sender/org.wso2.carbon.identity.api.server.notification.sender.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.api.server.notification.sender org.wso2.carbon.identity.server.api ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.notification.sender/pom.xml b/components/org.wso2.carbon.identity.api.server.notification.sender/pom.xml index c897f8f9be..31455474c5 100644 --- a/components/org.wso2.carbon.identity.api.server.notification.sender/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.notification.sender/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.common/pom.xml index 7b5abe787d..d13d5db90b 100644 --- a/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.oidc.scope.management ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.v1/pom.xml index ee0512772f..53676df506 100644 --- a/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.oidc.scope.management/org.wso2.carbon.identity.api.server.oidc.scope.management.v1/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.oidc.scope.management ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.oidc.scope.management.v1 diff --git a/components/org.wso2.carbon.identity.api.server.oidc.scope.management/pom.xml b/components/org.wso2.carbon.identity.api.server.oidc.scope.management/pom.xml index 08a238c3b9..2c3a724379 100644 --- a/components/org.wso2.carbon.identity.api.server.oidc.scope.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.oidc.scope.management/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.organization.configs/org.wso2.carbon.identity.api.server.organization.configs.common/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.configs/org.wso2.carbon.identity.api.server.organization.configs.common/pom.xml index 401ff8b00e..e83fff526b 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.configs/org.wso2.carbon.identity.api.server.organization.configs.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.configs/org.wso2.carbon.identity.api.server.organization.configs.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.configs - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT org.wso2.carbon.identity.api.server.organization.configs.common diff --git a/components/org.wso2.carbon.identity.api.server.organization.configs/org.wso2.carbon.identity.api.server.organization.configs.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.configs/org.wso2.carbon.identity.api.server.organization.configs.v1/pom.xml index a34b83e22d..18272c51fa 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.configs/org.wso2.carbon.identity.api.server.organization.configs.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.configs/org.wso2.carbon.identity.api.server.organization.configs.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.configs - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT org.wso2.carbon.identity.api.server.organization.configs.v1 diff --git a/components/org.wso2.carbon.identity.api.server.organization.configs/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.configs/pom.xml index 904c3cd442..ccc6d434de 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.configs/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.configs/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.common/pom.xml index a72236eef7..c57e76876e 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.v1/pom.xml index 69e035c923..3cc9e44bda 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.management/org.wso2.carbon.identity.api.server.organization.management.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.management/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.management/pom.xml index d87ec4cfa5..f93f26ca4c 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.management/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.common/pom.xml index 57fd739d39..d164dd2de7 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.role.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.v1/pom.xml index 5ddbca76a2..53e185f131 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.role.management/org.wso2.carbon.identity.api.server.organization.role.management.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.role.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.role.management/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.role.management/pom.xml index a70a5c6967..49a76d7776 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.role.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.role.management/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.organization.selfservice/org.wso2.carbon.identity.api.server.organization.selfservice.common/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.selfservice/org.wso2.carbon.identity.api.server.organization.selfservice.common/pom.xml index d4c2d24291..30b91956d8 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.selfservice/org.wso2.carbon.identity.api.server.organization.selfservice.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.selfservice/org.wso2.carbon.identity.api.server.organization.selfservice.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.selfservice ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.organization.selfservice/org.wso2.carbon.identity.api.server.organization.selfservice.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.selfservice/org.wso2.carbon.identity.api.server.organization.selfservice.v1/pom.xml index 41b5ad6029..489dc4b7f4 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.selfservice/org.wso2.carbon.identity.api.server.organization.selfservice.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.selfservice/org.wso2.carbon.identity.api.server.organization.selfservice.v1/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.selfservice ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.organization.selfservice.v1 diff --git a/components/org.wso2.carbon.identity.api.server.organization.selfservice/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.selfservice/pom.xml index 9e0bcd8a87..d7b45f8c99 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.selfservice/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.selfservice/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api identity-api-server - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.common/pom.xml index f22bcaa3d1..793036d58e 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.common/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.user.invitation.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1/pom.xml index 9c521bf942..8a44ee02ef 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/org.wso2.carbon.identity.api.server.organization.user.invitation.management.v1/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.organization.user.invitation.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/pom.xml b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/pom.xml index 764d91801e..68eda7f0c5 100644 --- a/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.organization.user.invitation.management/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api identity-api-server - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.common/pom.xml index c38171d9aa..6c77938793 100644 --- a/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.permission.management ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT WSO2 Identity Server - Common Permission Management WSO2 Identity Server - PCommon Permission Management diff --git a/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.v1/pom.xml index 18798f4e9e..403040001a 100644 --- a/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.permission.management/org.wso2.carbon.identity.api.server.permission.management.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.permission.management ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.permission.management.v1 diff --git a/components/org.wso2.carbon.identity.api.server.permission.management/pom.xml b/components/org.wso2.carbon.identity.api.server.permission.management/pom.xml index e1a67ca6d4..19dd53b071 100644 --- a/components/org.wso2.carbon.identity.api.server.permission.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.permission.management/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.common/pom.xml b/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.common/pom.xml index 1643783a37..7d6ce8e94b 100644 --- a/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.common/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.api.server.script.library org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.v1/pom.xml index 189a0c9c8d..cc8a5a2f09 100644 --- a/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.script.library/org.wso2.carbon.identity.api.server.script.library.v1/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.script.library/pom.xml b/components/org.wso2.carbon.identity.api.server.script.library/pom.xml index 8a1dd971bd..19b7c126fb 100644 --- a/components/org.wso2.carbon.identity.api.server.script.library/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.script.library/pom.xml @@ -20,7 +20,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.common/pom.xml index 2c0872b065..810e0da565 100644 --- a/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.common/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.secret.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.v1/pom.xml index 7ff7b30e09..7765399ebd 100644 --- a/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.secret.management/org.wso2.carbon.identity.api.server.secret.management.v1/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.secret.management - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.secret.management/pom.xml b/components/org.wso2.carbon.identity.api.server.secret.management/pom.xml index 5edea56546..f85ef57041 100644 --- a/components/org.wso2.carbon.identity.api.server.secret.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.secret.management/pom.xml @@ -21,7 +21,7 @@ org.wso2.carbon.identity.server.api identity-api-server - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/pom.xml b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/pom.xml index 68f144b2c6..e952e663da 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/pom.xml @@ -18,7 +18,7 @@ org.wso2.carbon.identity.api.server.tenant.management org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementConstants.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementConstants.java index 04600981fa..1c34f94170 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementConstants.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementConstants.java @@ -1,17 +1,19 @@ /* - * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * Copyright (c) 2020-2024, WSO2 LLC. (http://www.wso2.com). * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.identity.api.server.tenant.management.common; @@ -31,6 +33,7 @@ private TenantManagementConstants() { public static final String PAGINATION_WITH_FILTER_LINK_FORMAT = "?offset=%d&limit=%d&filter=%s"; public static final String PAGE_LINK_REL_NEXT = "next"; public static final String PAGE_LINK_REL_PREVIOUS = "previous"; + public static final String NON_EXISTING_USER_CODE = "30007 - "; /** * Enum for error messages. @@ -43,6 +46,12 @@ public enum ErrorMessage { ERROR_CODE_TENANT_LIMIT_REACHED("TM-60019", "Unable to create a tenant.", "Maximum number of allowed tenants have been reached."), + ERROR_CODE_OWNER_NOT_FOUND("TM-60020", + "Unable to retrieve the tenant owner.", + "Tenant owner cannot be found for the provided tenant id: %s."), + ERROR_CODE_PARTIALLY_CREATED_OR_UPDATED("TM-60021", + "Tenant creation / update was completed with errors.", + "Tenant creation / update was completed with error: %s"), ERROR_CODE_ERROR_LISTING_TENANTS("TM-65001", "Unable to list existing tenants.", "Server encountered an error while listing the tenants."), @@ -64,7 +73,11 @@ public enum ErrorMessage { "Unable to check availability of domain.", "Server encountered an error while checking for tenant domain"), ERROR_CODE_DELETE_TENANT_METADATA("TM-65008", "Error while deleting the tenant metadata.", - "Server encountered an error while deleting the tenant metadata identified by %s ."); + "Server encountered an error while deleting the tenant metadata identified by %s."), + ERROR_CODE_ERROR_RETRIEVING_OWNER("TM-65009", "Unable to retrieve the tenant owner.", + "Server encountered an error while retrieving the owner identified by tenant id %s."), + ERROR_CODE_ERROR_UPDATING_OWNER("TM-65010", "Unable to update the tenant owner.", + "Server encountered an error while updating the owner identified by tenant id %s."); private final String code; private final String message; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementServiceHolder.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementServiceHolder.java index b1d16bc533..336f822078 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementServiceHolder.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementServiceHolder.java @@ -1,21 +1,24 @@ /* - * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * Copyright (c) 2020-2024, WSO2 LLC. (http://www.wso2.com). * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.identity.api.server.tenant.management.common; import org.wso2.carbon.tenant.mgt.services.TenantMgtService; +import org.wso2.carbon.user.core.service.RealmService; /** * Service holder class for tenant management. @@ -23,6 +26,7 @@ public class TenantManagementServiceHolder { private static TenantMgtService tenantMgtService; + private static RealmService realmService; /** * Get TenantMgtService osgi service. @@ -43,4 +47,24 @@ public static void setTenantMgtService(TenantMgtService tenantMgtService) { TenantManagementServiceHolder.tenantMgtService = tenantMgtService; } + + /** + * Get RealmService osgi service. + * + * @return RealmService + */ + public static RealmService getRealmService() { + + return realmService; + } + + /** + * Set RealmService osgi service. + * + * @param realmService RealmService. + */ + public static void setRealmService(RealmService realmService) { + + TenantManagementServiceHolder.realmService = realmService; + } } diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/factory/RealmServiceOSGIServiceFactory.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/factory/RealmServiceOSGIServiceFactory.java new file mode 100644 index 0000000000..e321492313 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/factory/RealmServiceOSGIServiceFactory.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.identity.api.server.tenant.management.common.factory; + +import org.springframework.beans.factory.config.AbstractFactoryBean; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.user.core.service.RealmService; + +/** + * Factory Beans serves as a factory for creating other beans within the IOC container. This factory bean is used to + * instantiate the RealmService inside the container. + */ +public class RealmServiceOSGIServiceFactory extends AbstractFactoryBean { + + private RealmService realmService; + + @Override + public Class getObjectType() { + + return Object.class; + } + + @Override + protected RealmService createInstance() throws Exception { + + if (this.realmService == null) { + RealmService realmService = (RealmService) + PrivilegedCarbonContext.getThreadLocalCarbonContext() + .getOSGiService(RealmService.class, null); + if (realmService != null) { + this.realmService = realmService; + } else { + throw new Exception("Unable to retrieve RealmService service."); + } + } + return this.realmService; + } +} diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/pom.xml index 46725dcdbd..b1bf988847 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/pom.xml @@ -18,7 +18,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../../pom.xml diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApi.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApi.java index 4c0bdb7d78..b468d2adaa 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApi.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApi.java @@ -1,37 +1,39 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.Authorization; import org.springframework.beans.factory.annotation.Autowired; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import java.io.InputStream; -import java.util.List; - import org.wso2.carbon.identity.api.server.tenant.management.v1.model.ChannelVerifiedTenantModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.Error; -import org.wso2.carbon.identity.api.server.tenant.management.v1.ChannelVerifiedTenantsApiService; import javax.validation.Valid; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; import javax.ws.rs.core.Response; -import io.swagger.annotations.*; - -import javax.validation.constraints.*; @Path("/channel-verified-tenants") @Api(description = "The channel-verified-tenants API") diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApiService.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApiService.java index 215e059d07..55d26dd4fd 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApiService.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApiService.java @@ -1,29 +1,25 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1; -import org.wso2.carbon.identity.api.server.tenant.management.v1.*; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.*; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import java.io.InputStream; -import java.util.List; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.ChannelVerifiedTenantModel; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.Error; + import javax.ws.rs.core.Response; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApi.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApi.java index 81405cdcbe..67411f774d 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApi.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApi.java @@ -1,41 +1,52 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.Authorization; import org.springframework.beans.factory.annotation.Autowired; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import java.io.InputStream; -import java.util.List; - import org.wso2.carbon.identity.api.server.tenant.management.v1.model.Error; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerInfoResponse; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerPutModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerResponse; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantPutModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantResponseModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantsListResponse; -import org.wso2.carbon.identity.api.server.tenant.management.v1.TenantsApiService; import javax.validation.Valid; -import javax.ws.rs.*; +import javax.validation.constraints.Min; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HEAD; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; -import io.swagger.annotations.*; - -import javax.validation.constraints.*; @Path("/tenants") @Api(description = "The tenants API") @@ -58,6 +69,7 @@ public class TenantsApi { }, tags={ "Tenants", }) @ApiResponses(value = { @ApiResponse(code = 201, message = "Item Created", response = Void.class), + @ApiResponse(code = 206, message = "Partial Content", response = Error.class), @ApiResponse(code = 400, message = "Invalid Input Request", response = Error.class), @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), @ApiResponse(code = 403, message = "Resource Forbidden", response = Void.class), @@ -93,6 +105,30 @@ public Response deleteTenantMetadata(@ApiParam(value = "tenant id",required=true return delegate.deleteTenantMetadata(tenantId ); } + @Valid + @GET + @Path("/{tenant-id}/owners/{owner-id}") + + @Produces({ "application/json" }) + @ApiOperation(value = "Retrieve tenant owner.", notes = "Retrieve the tenant owner identified by the provided tenant id and owner id. Permission required: * /permission/protected/manage/monitor/tenants/list scope required: * internal_list_tenants ", response = OwnerInfoResponse.class, authorizations = { + @Authorization(value = "BasicAuth"), + @Authorization(value = "OAuth2", scopes = { + + }) + }, tags={ "Tenants", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = OwnerInfoResponse.class), + @ApiResponse(code = 400, message = "Invalid Input Request", response = Error.class), + @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + @ApiResponse(code = 403, message = "Resource Forbidden", response = Void.class), + @ApiResponse(code = 404, message = "The specified resource is not found", response = Error.class), + @ApiResponse(code = 500, message = "Internal Server Error", response = Error.class) + }) + public Response getOwner(@ApiParam(value = "tenant id",required=true) @PathParam("tenant-id") String tenantId, @ApiParam(value = "owner id",required=true) @PathParam("owner-id") String ownerId, @Valid@ApiParam(value = "Define set of additional user claims (as comma separated) to be returned.") @QueryParam("additionalClaims") String additionalClaims) { + + return delegate.getOwner(tenantId, ownerId, additionalClaims ); + } + @Valid @GET @Path("/{tenant-id}/owners") @@ -213,6 +249,31 @@ public Response retrieveTenants( @Valid @Min(0)@ApiParam(value = "Maximum num return delegate.retrieveTenants(limit, offset, sortOrder, sortBy, filter ); } + @Valid + @PUT + @Path("/{tenant-id}/owners/{owner-id}") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "Update tenant owner.", notes = "This API provides the capability to update the tenant owner. Permission required: * /permission/protected/manage/modify/tenants scope required: * internal_modify_tenants ", response = Void.class, authorizations = { + @Authorization(value = "BasicAuth"), + @Authorization(value = "OAuth2", scopes = { + + }) + }, tags={ "Tenants", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Successful", response = Void.class), + @ApiResponse(code = 206, message = "Partial Content", response = Error.class), + @ApiResponse(code = 400, message = "Invalid Input Request", response = Error.class), + @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + @ApiResponse(code = 403, message = "Resource Forbidden", response = Void.class), + @ApiResponse(code = 404, message = "The specified resource is not found", response = Error.class), + @ApiResponse(code = 500, message = "Internal Server Error", response = Error.class) + }) + public Response updateOwner(@ApiParam(value = "tenant id",required=true) @PathParam("tenant-id") String tenantId, @ApiParam(value = "owner id",required=true) @PathParam("owner-id") String ownerId, @ApiParam(value = "This represents the tenant owner to be updated." ,required=true) @Valid OwnerPutModel ownerPutModel) { + + return delegate.updateOwner(tenantId, ownerId, ownerPutModel ); + } + @Valid @PUT @Path("/{tenant-id}/lifecycle-status") diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApiService.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApiService.java index 0c5b5c1f2a..4941044b41 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApiService.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApiService.java @@ -1,33 +1,27 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1; -import org.wso2.carbon.identity.api.server.tenant.management.v1.*; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.*; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import java.io.InputStream; -import java.util.List; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.Error; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerResponse; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerPutModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantPutModel; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantResponseModel; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantsListResponse; + import javax.ws.rs.core.Response; @@ -37,6 +31,8 @@ public interface TenantsApiService { public Response deleteTenantMetadata(String tenantId); + public Response getOwner(String tenantId, String ownerId, String additionalClaims); + public Response getOwners(String tenantId); public Response getTenant(String tenantId); @@ -47,5 +43,7 @@ public interface TenantsApiService { public Response retrieveTenants(Integer limit, Integer offset, String sortOrder, String sortBy, String filter); + public Response updateOwner(String tenantId, String ownerId, OwnerPutModel ownerPutModel); + public Response updateTenantStatus(String tenantId, TenantPutModel tenantPutModel); } diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/ChannelVerifiedTenantsApiServiceFactory.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/ChannelVerifiedTenantsApiServiceFactory.java index 044308568f..7dec970f02 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/ChannelVerifiedTenantsApiServiceFactory.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/ChannelVerifiedTenantsApiServiceFactory.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.factories; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/TenantsApiServiceFactory.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/TenantsApiServiceFactory.java index 1692d26b8d..1f8c29dcdf 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/TenantsApiServiceFactory.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/TenantsApiServiceFactory.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.factories; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/AdditionalClaims.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/AdditionalClaims.java index c58a26ce84..5afbf60a7f 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/AdditionalClaims.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/AdditionalClaims.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Attribute.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Attribute.java index b51145e140..4662edc81f 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Attribute.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Attribute.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/ChannelVerifiedTenantModel.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/ChannelVerifiedTenantModel.java index a3a98a9f56..8587be875c 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/ChannelVerifiedTenantModel.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/ChannelVerifiedTenantModel.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Error.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Error.java index 334dd1028f..f60e4856af 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Error.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Error.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/LifeCycleStatus.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/LifeCycleStatus.java index 06e59417d9..fef139f9ba 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/LifeCycleStatus.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/LifeCycleStatus.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Link.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Link.java index e203e03917..eadcdc8155 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Link.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Link.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Owner.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Owner.java index 4fb88118fc..c02ad5467a 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Owner.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Owner.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerInfoResponse.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerInfoResponse.java new file mode 100644 index 0000000000..37e0f7a7f6 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerInfoResponse.java @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.identity.api.server.tenant.management.v1.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.AdditionalClaims; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; +import javax.validation.Valid; +import javax.xml.bind.annotation.*; + +public class OwnerInfoResponse { + + private String id; + private String username; + private String email; + private String firstname; + private String lastname; + private List additionalClaims = null; + + + /** + * id of the tenant owner. + **/ + public OwnerInfoResponse id(String id) { + + this.id = id; + return this; + } + + @ApiModelProperty(example = "4875-jhgr-454hb", value = "id of the tenant owner.") + @JsonProperty("id") + @Valid + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + /** + * Username for the tenant owner. + **/ + public OwnerInfoResponse username(String username) { + + this.username = username; + return this; + } + + @ApiModelProperty(example = "kim", value = "Username for the tenant owner.") + @JsonProperty("username") + @Valid + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + /** + * Email address of the owner. + **/ + public OwnerInfoResponse email(String email) { + + this.email = email; + return this; + } + + @ApiModelProperty(example = "kim@wso2.com", value = "Email address of the owner.") + @JsonProperty("email") + @Valid + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + * First name of the owner. + **/ + public OwnerInfoResponse firstname(String firstname) { + + this.firstname = firstname; + return this; + } + + @ApiModelProperty(example = "kim", value = "First name of the owner.") + @JsonProperty("firstname") + @Valid + public String getFirstname() { + return firstname; + } + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + /** + * Last name of the owner. + **/ + public OwnerInfoResponse lastname(String lastname) { + + this.lastname = lastname; + return this; + } + + @ApiModelProperty(example = "kim", value = "Last name of the owner.") + @JsonProperty("lastname") + @Valid + public String getLastname() { + return lastname; + } + public void setLastname(String lastname) { + this.lastname = lastname; + } + + /** + **/ + public OwnerInfoResponse additionalClaims(List additionalClaims) { + + this.additionalClaims = additionalClaims; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("additionalClaims") + @Valid + public List getAdditionalClaims() { + return additionalClaims; + } + public void setAdditionalClaims(List additionalClaims) { + this.additionalClaims = additionalClaims; + } + + public OwnerInfoResponse addAdditionalClaimsItem(AdditionalClaims additionalClaimsItem) { + if (this.additionalClaims == null) { + this.additionalClaims = new ArrayList<>(); + } + this.additionalClaims.add(additionalClaimsItem); + return this; + } + + + + @Override + public boolean equals(java.lang.Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OwnerInfoResponse ownerInfoResponse = (OwnerInfoResponse) o; + return Objects.equals(this.id, ownerInfoResponse.id) && + Objects.equals(this.username, ownerInfoResponse.username) && + Objects.equals(this.email, ownerInfoResponse.email) && + Objects.equals(this.firstname, ownerInfoResponse.firstname) && + Objects.equals(this.lastname, ownerInfoResponse.lastname) && + Objects.equals(this.additionalClaims, ownerInfoResponse.additionalClaims); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, email, firstname, lastname, additionalClaims); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class OwnerInfoResponse {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstname: ").append(toIndentedString(firstname)).append("\n"); + sb.append(" lastname: ").append(toIndentedString(lastname)).append("\n"); + sb.append(" additionalClaims: ").append(toIndentedString(additionalClaims)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n"); + } +} + diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerPutModel.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerPutModel.java new file mode 100644 index 0000000000..6b51180b47 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerPutModel.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.identity.api.server.tenant.management.v1.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.AdditionalClaims; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; +import javax.validation.Valid; +import javax.xml.bind.annotation.*; + +public class OwnerPutModel { + + private String email; + private String password; + private String firstname; + private String lastname; + private List additionalClaims = null; + + + /** + * Email address of the owner. + **/ + public OwnerPutModel email(String email) { + + this.email = email; + return this; + } + + @ApiModelProperty(example = "kim@wso2.com", required = true, value = "Email address of the owner.") + @JsonProperty("email") + @Valid + @NotNull(message = "Property email cannot be null.") + + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + * Password of the owner. + **/ + public OwnerPutModel password(String password) { + + this.password = password; + return this; + } + + @ApiModelProperty(example = "kim123", value = "Password of the owner.") + @JsonProperty("password") + @Valid + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + /** + * First name of the owner. + **/ + public OwnerPutModel firstname(String firstname) { + + this.firstname = firstname; + return this; + } + + @ApiModelProperty(example = "kim", required = true, value = "First name of the owner.") + @JsonProperty("firstname") + @Valid + @NotNull(message = "Property firstname cannot be null.") + + public String getFirstname() { + return firstname; + } + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + /** + * Last name of the owner. + **/ + public OwnerPutModel lastname(String lastname) { + + this.lastname = lastname; + return this; + } + + @ApiModelProperty(example = "kim", required = true, value = "Last name of the owner.") + @JsonProperty("lastname") + @Valid + @NotNull(message = "Property lastname cannot be null.") + + public String getLastname() { + return lastname; + } + public void setLastname(String lastname) { + this.lastname = lastname; + } + + /** + **/ + public OwnerPutModel additionalClaims(List additionalClaims) { + + this.additionalClaims = additionalClaims; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("additionalClaims") + @Valid + public List getAdditionalClaims() { + return additionalClaims; + } + public void setAdditionalClaims(List additionalClaims) { + this.additionalClaims = additionalClaims; + } + + public OwnerPutModel addAdditionalClaimsItem(AdditionalClaims additionalClaimsItem) { + if (this.additionalClaims == null) { + this.additionalClaims = new ArrayList<>(); + } + this.additionalClaims.add(additionalClaimsItem); + return this; + } + + + + @Override + public boolean equals(java.lang.Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OwnerPutModel ownerPutModel = (OwnerPutModel) o; + return Objects.equals(this.email, ownerPutModel.email) && + Objects.equals(this.password, ownerPutModel.password) && + Objects.equals(this.firstname, ownerPutModel.firstname) && + Objects.equals(this.lastname, ownerPutModel.lastname) && + Objects.equals(this.additionalClaims, ownerPutModel.additionalClaims); + } + + @Override + public int hashCode() { + return Objects.hash(email, password, firstname, lastname, additionalClaims); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class OwnerPutModel {\n"); + + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" firstname: ").append(toIndentedString(firstname)).append("\n"); + sb.append(" lastname: ").append(toIndentedString(lastname)).append("\n"); + sb.append(" additionalClaims: ").append(toIndentedString(additionalClaims)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n"); + } +} + diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerResponse.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerResponse.java index 5a203994c4..a2b7b56ab1 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerResponse.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerResponse.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Purpose.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Purpose.java index 372b8d46f1..53e7bce44f 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Purpose.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Purpose.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantListItem.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantListItem.java index 081d46601f..f74e70a312 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantListItem.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantListItem.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantModel.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantModel.java index 8ac2fca41c..1f1aa14b69 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantModel.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantModel.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantPutModel.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantPutModel.java index 085d3c6261..feb9f6a214 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantPutModel.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantPutModel.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantResponseModel.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantResponseModel.java index 32d07387da..5757542d85 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantResponseModel.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantResponseModel.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantsListResponse.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantsListResponse.java index 574a1a3f20..d0cc220671 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantsListResponse.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantsListResponse.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/core/ServerTenantManagementService.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/core/ServerTenantManagementService.java index 330dc1112e..23f98cdeb6 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/core/ServerTenantManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/core/ServerTenantManagementService.java @@ -28,6 +28,8 @@ import org.wso2.carbon.identity.api.server.tenant.management.v1.model.ChannelVerifiedTenantModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.LifeCycleStatus; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.Link; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerInfoResponse; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerPutModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerResponse; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantListItem; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantModel; @@ -42,8 +44,11 @@ import org.wso2.carbon.stratos.common.exception.TenantManagementClientException; import org.wso2.carbon.stratos.common.exception.TenantManagementServerException; import org.wso2.carbon.stratos.common.exception.TenantMgtException; +import org.wso2.carbon.stratos.common.util.ClaimsMgtUtil; import org.wso2.carbon.tenant.mgt.services.TenantMgtService; +import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.common.User; +import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.user.core.tenant.Tenant; import org.wso2.carbon.user.core.tenant.TenantSearchResult; @@ -62,6 +67,7 @@ import static org.wso2.carbon.identity.api.server.common.Constants.ERROR_CODE_RESOURCE_LIMIT_REACHED; import static org.wso2.carbon.identity.api.server.common.Constants.V1_API_PATH_COMPONENT; +import static org.wso2.carbon.identity.api.server.tenant.management.common.TenantManagementConstants.ErrorMessage.ERROR_CODE_PARTIALLY_CREATED_OR_UPDATED; import static org.wso2.carbon.identity.api.server.tenant.management.common.TenantManagementConstants.ErrorMessage.ERROR_CODE_TENANT_LIMIT_REACHED; import static org.wso2.carbon.identity.api.server.tenant.management.common.TenantManagementConstants.TENANT_MANAGEMENT_PATH_COMPONENT; import static org.wso2.carbon.stratos.common.constants.TenantConstants.ErrorMessage.ERROR_CODE_INVALID_EMAIL; @@ -193,6 +199,35 @@ public List getOwners(String tenantUniqueID) { } } + public OwnerInfoResponse getOwner(String tenantUniqueID, String ownerID, String additionalClaims) { + + try { + Tenant tenant = TenantManagementServiceHolder.getTenantMgtService().getTenant(tenantUniqueID); + validateTenantOwnerId(tenant, ownerID); + + String[] claimsList = StringUtils.split(additionalClaims, ","); + return createOwnerInfoResponse(tenant, claimsList); + } catch (TenantMgtException e) { + throw handleTenantManagementException(e, TenantManagementConstants.ErrorMessage. + ERROR_CODE_ERROR_RETRIEVING_OWNER, tenantUniqueID); + } + } + + public void updateOwner(String tenantUniqueID, String ownerID, OwnerPutModel ownerPutModel) { + + try { + Tenant tenant = TenantManagementServiceHolder.getTenantMgtService().getTenant(tenantUniqueID); + validateTenantOwnerId(tenant, ownerID); + + createTenantInfoBean(tenant, ownerPutModel); + + TenantManagementServiceHolder.getTenantMgtService().updateOwner(tenant); + } catch (TenantMgtException e) { + throw handleTenantManagementException(e, TenantManagementConstants.ErrorMessage. + ERROR_CODE_ERROR_UPDATING_OWNER, tenantUniqueID); + } + } + /** * Delete the metadata of the tenant which is identified by tenant unique id. * @@ -241,6 +276,74 @@ private List createOwnerResponse(User user) { return ownerResponseList; } + private void createTenantInfoBean(Tenant tenant, OwnerPutModel ownerPutModel) { + + if (StringUtils.isNotBlank(ownerPutModel.getFirstname())) { + tenant.setAdminFirstName(ownerPutModel.getFirstname()); + } + if (StringUtils.isNotBlank(ownerPutModel.getLastname())) { + tenant.setAdminLastName(ownerPutModel.getLastname()); + } + if (StringUtils.isNotBlank(ownerPutModel.getEmail())) { + tenant.setEmail(ownerPutModel.getEmail()); + } + tenant.setAdminPassword(ownerPutModel.getPassword()); + List additionalClaimsList = ownerPutModel.getAdditionalClaims(); + if (CollectionUtils.isNotEmpty(additionalClaimsList)) { + tenant.setClaimsMap(createClaimsMapping(additionalClaimsList)); + } else { + // Avoid updating the claims map if the request does not contain any additional claims. + tenant.setClaimsMap(new HashMap<>()); + } + } + + private void validateTenantOwnerId(Tenant tenant, String ownerID) { + + if (tenant.getAdminUserId() == null || !tenant.getAdminUserId().equals(ownerID)) { + throw handleException(Response.Status.BAD_REQUEST, TenantManagementConstants.ErrorMessage. + ERROR_CODE_OWNER_NOT_FOUND, tenant.getTenantUniqueID()); + } + } + + private OwnerInfoResponse createOwnerInfoResponse(Tenant tenant, String[] claimsList) throws TenantMgtException { + + RealmService realmService = TenantManagementServiceHolder.getRealmService(); + OwnerInfoResponse ownerInfoResponse = new OwnerInfoResponse(); + ownerInfoResponse.setId(tenant.getAdminUserId()); + ownerInfoResponse.setUsername(tenant.getAdminName()); + ownerInfoResponse.setEmail(tenant.getEmail()); + + try { + ownerInfoResponse.setFirstname(ClaimsMgtUtil.getFirstNamefromUserStoreManager( + realmService, tenant.getId())); + ownerInfoResponse.setLastname(ClaimsMgtUtil.getLastNamefromUserStoreManager( + realmService, tenant.getId())); + } catch (UserStoreException e) { + if (e.getMessage().startsWith(TenantManagementConstants.NON_EXISTING_USER_CODE)) { + throw handleException(Response.Status.NOT_FOUND, TenantManagementConstants.ErrorMessage. + ERROR_CODE_OWNER_NOT_FOUND, tenant.getTenantUniqueID()); + } + throw new TenantMgtException(e.getMessage()); + } + + if (claimsList != null) { + for (String claim : claimsList) { + try { + String claimValue = ClaimsMgtUtil.getClaimfromUserStoreManager(realmService, tenant.getId(), claim); + if (StringUtils.isNotBlank(claimValue)) { + ownerInfoResponse.addAdditionalClaimsItem( + new AdditionalClaims().claim(claim).value(claimValue)); + } + } catch (org.wso2.carbon.user.core.UserStoreException e) { + if (log.isDebugEnabled()) { + log.debug("Error while retrieving claim: " + claim + " for tenant: " + tenant.getId(), e); + } + } + } + } + return ownerInfoResponse; + } + private TenantResponseModel createTenantResponse(Tenant tenant) { TenantResponseModel tenantResponseModel = new TenantResponseModel(); @@ -430,6 +533,9 @@ private APIError handleTenantManagementException(TenantMgtException e, if (ERROR_CODE_RESOURCE_LIMIT_REACHED.equals(e.getErrorCode())) { return handleResourceLimitReached(); } + if (ERROR_CODE_PARTIALLY_CREATED_OR_UPDATED.getCode().equals(e.getErrorCode())) { + return handleResourcePartiallyCreated(e); + } errorResponse = getErrorBuilder(errorEnum, data).build(log, e.getMessage()); if (e.getErrorCode() != null) { String errorCode = e.getErrorCode(); @@ -461,6 +567,14 @@ private APIError handleResourceLimitReached() { return new APIError(status, errorResponse); } + private APIError handleResourcePartiallyCreated(TenantMgtException e) { + + String errorMessage = e.getCause().getMessage(); + ErrorResponse errorResponse = getErrorBuilder(ERROR_CODE_PARTIALLY_CREATED_OR_UPDATED, errorMessage) + .build(log, errorMessage); + return new APIError(Response.Status.PARTIAL_CONTENT, errorResponse); + } + /** * Return error builder. * diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/impl/TenantsApiServiceImpl.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/impl/TenantsApiServiceImpl.java index 5175cf8290..542bd0140f 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/impl/TenantsApiServiceImpl.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/impl/TenantsApiServiceImpl.java @@ -1,18 +1,21 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2020-2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.wso2.carbon.identity.api.server.tenant.management.v1.impl; import org.springframework.beans.factory.annotation.Autowired; @@ -21,6 +24,7 @@ import org.wso2.carbon.identity.api.server.tenant.management.common.TenantManagementConstants; import org.wso2.carbon.identity.api.server.tenant.management.v1.TenantsApiService; import org.wso2.carbon.identity.api.server.tenant.management.v1.core.ServerTenantManagementService; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerPutModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantPutModel; @@ -50,6 +54,12 @@ public Response deleteTenantMetadata(String tenantId) { return Response.noContent().build(); } + @Override + public Response getOwner(String tenantId, String ownerId, String additionalClaims) { + + return Response.ok().entity(tenantManagementService.getOwner(tenantId, ownerId, additionalClaims)).build(); + } + @Override public Response getOwners(String tenantUniqueIdentifier) { @@ -69,6 +79,13 @@ public Response retrieveTenants(Integer limit, Integer offset, String sortOrder, build(); } + @Override + public Response updateOwner(String tenantId, String ownerId, OwnerPutModel ownerPutModel) { + + tenantManagementService.updateOwner(tenantId, ownerId, ownerPutModel); + return Response.ok().build(); + } + @Override public Response updateTenantStatus(String tenantId, TenantPutModel tenantPutModel) { diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/META-INF/cxf/tenant-management-server-v1-cxf.xml b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/META-INF/cxf/tenant-management-server-v1-cxf.xml index 9c5677860a..23eabc8c31 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/META-INF/cxf/tenant-management-server-v1-cxf.xml +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/META-INF/cxf/tenant-management-server-v1-cxf.xml @@ -25,6 +25,13 @@ class="org.wso2.carbon.identity.api.server.tenant.management.common.TenantManagementServiceHolder"> + + + + + diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/tenant-management.yaml b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/tenant-management.yaml index 5419baf114..42e23745c8 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/tenant-management.yaml +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/tenant-management.yaml @@ -85,6 +85,8 @@ paths: description: Location of the newly created tenant schema: type: string + '206': + $ref: '#/components/responses/PartialContent' '400': $ref: '#/components/responses/InvalidInput' '401': @@ -311,6 +313,79 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + '/tenants/{tenant-id}/owners/{owner-id}': + get: + tags: + - Tenants + summary: Retrieve tenant owner. + operationId: getOwner + description: | + Retrieve the tenant owner identified by the provided tenant id and owner id. + + Permission required: + * /permission/protected/manage/monitor/tenants/list + + scope required: + * internal_list_tenants + parameters: + - $ref: '#/components/parameters/tenantIdPathParam' + - $ref: '#/components/parameters/ownerIdPathParam' + - $ref: '#/components/parameters/additionalClaimsQueryParam' + responses: + '200': + description: OK + content: + 'application/json': + schema: + $ref: '#/components/schemas/OwnerInfoResponse' + '400': + $ref: '#/components/responses/InvalidInput' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/ServerError' + put: + tags: + - Tenants + summary: Update tenant owner. + operationId: updateOwner + description: | + This API provides the capability to update the tenant owner. + + Permission required: + * /permission/protected/manage/modify/tenants + + scope required: + * internal_modify_tenants + parameters: + - $ref: '#/components/parameters/tenantIdPathParam' + - $ref: '#/components/parameters/ownerIdPathParam' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OwnerPutModel' + description: This represents the tenant owner to be updated. + required: true + responses: + '200': + $ref: '#/components/responses/Updated' + '206': + $ref: '#/components/responses/PartialContent' + '400': + $ref: '#/components/responses/InvalidInput' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/ServerError' '/tenants/{tenant-id}/metadata': delete: tags: @@ -365,6 +440,13 @@ components: description: tenant id schema: type: string + ownerIdPathParam: + in: path + name: owner-id + required: true + description: owner id + schema: + type: string tenantDomainPathParam: in: path name: tenant-domain @@ -421,6 +503,15 @@ components: option is not yet supported._ schema: type: string + additionalClaimsQueryParam: + in: query + name: additionalClaims + required: false + description: >- + Define set of additional user claims (as comma separated) to be returned. + schema: + type: string + example: http://wso2.org/claims/telephone responses: NotFound: description: The specified resource is not found @@ -440,6 +531,12 @@ components: 'application/json': schema: $ref: '#/components/schemas/Error' + PartialContent: + description: Partial Content + content: + 'application/json': + schema: + $ref: '#/components/schemas/Error' InvalidInput: description: Invalid Input Request content: @@ -638,6 +735,62 @@ components: items: $ref: '#/components/schemas/AdditionalClaims' + OwnerPutModel: + type: object + required: + - email + - firstname + - lastname + properties: + email: + type: string + example: kim@wso2.com + description: Email address of the owner. + password: + type: string + example: kim123 + description: Password of the owner. + firstname: + type: string + example: kim + description: First name of the owner. + lastname: + type: string + example: kim + description: Last name of the owner. + additionalClaims: + type: array + items: + $ref: '#/components/schemas/AdditionalClaims' + + OwnerInfoResponse: + type: object + properties: + id: + type: string + example: "4875-jhgr-454hb" + description: id of the tenant owner. + username: + type: string + example: kim + description: Username for the tenant owner. + email: + type: string + example: kim@wso2.com + description: Email address of the owner. + firstname: + type: string + example: kim + description: First name of the owner. + lastname: + type: string + example: kim + description: Last name of the owner. + additionalClaims: + type: array + items: + $ref: '#/components/schemas/AdditionalClaims' + OwnerResponse: type: object properties: diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/pom.xml b/components/org.wso2.carbon.identity.api.server.tenant.management/pom.xml index 790b75ede1..9fc4b93763 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/pom.xml @@ -18,7 +18,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.common/pom.xml b/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.common/pom.xml index 0b6603b4b0..760e778e56 100644 --- a/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.common/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.common/pom.xml @@ -18,7 +18,7 @@ org.wso2.carbon.identity.api.server.userstore org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 diff --git a/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.v1/pom.xml b/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.v1/pom.xml index 917c34e065..ef997a8115 100644 --- a/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.v1/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.userstore/org.wso2.carbon.identity.api.server.userstore.v1/pom.xml @@ -20,7 +20,7 @@ org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.userstore ../pom.xml - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT 4.0.0 org.wso2.carbon.identity.api.server.userstore.v1 diff --git a/components/org.wso2.carbon.identity.api.server.userstore/pom.xml b/components/org.wso2.carbon.identity.api.server.userstore/pom.xml index f8915457d9..61b49a0b88 100644 --- a/components/org.wso2.carbon.identity.api.server.userstore/pom.xml +++ b/components/org.wso2.carbon.identity.api.server.userstore/pom.xml @@ -21,7 +21,7 @@ identity-api-server org.wso2.carbon.identity.server.api - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index 3ab3f15bbc..3a54be5c99 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 4.0.0 identity-api-server pom - 1.2.236-SNAPSHOT + 1.2.241-SNAPSHOT WSO2 Identity Server - Server API Module @@ -287,12 +287,6 @@ provided ${project.version} - - org.wso2.carbon.identity.server.api - org.wso2.carbon.identity.api.server.notification.template.common - provided - ${project.version} - org.wso2.carbon.identity.server.api org.wso2.carbon.identity.api.server.application.management.common @@ -808,18 +802,18 @@ 2.3.1.wso2v1 1.4 1.2.4 - 1.11.9-SNAPSHOT - 7.5.67-SNAPSHOT + 1.10.6 + 7.5.71 3.0.5 1.12.0 **/gen/**/* - 1.9.12-SNAPSHOT + 1.8.19 7.0.162 5.11.41 1.9.4 findbugs-exclude-filter.xml 4.9.17 - 4.9.10 + 4.11.27 0.7.12 2.5.15 4.10.11 @@ -865,7 +859,6 @@ components/org.wso2.carbon.identity.api.server.tenant.management components/org.wso2.carbon.identity.api.server.cors components/org.wso2.carbon.identity.api.server.notification.sender - components/org.wso2.carbon.identity.api.server.notification.template components/org.wso2.carbon.identity.api.server.authenticators components/org.wso2.carbon.identity.api.server.secret.management components/org.wso2.carbon.identity.api.server.branding.preference.management