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 d9fd756fc1..b815486f5f 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 @@ -68,5 +68,10 @@ org.wso2.carbon.identity.api.resource.collection.mgt provided + + org.wso2.carbon.identity.inbound.auth.oauth2 + org.wso2.carbon.identity.oauth.rar + provided + diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.common/src/main/java/org/wso2/carbon/identity/api/server/api/resource/common/APIResourceManagementServiceHolder.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.common/src/main/java/org/wso2/carbon/identity/api/server/api/resource/common/APIResourceManagementServiceHolder.java index a86403c69e..24bb33ffe5 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.common/src/main/java/org/wso2/carbon/identity/api/server/api/resource/common/APIResourceManagementServiceHolder.java +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.common/src/main/java/org/wso2/carbon/identity/api/server/api/resource/common/APIResourceManagementServiceHolder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2023-2025, 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 @@ -21,7 +21,9 @@ import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.identity.api.resource.collection.mgt.APIResourceCollectionManager; import org.wso2.carbon.identity.api.resource.mgt.APIResourceManager; +import org.wso2.carbon.identity.api.resource.mgt.AuthorizationDetailsTypeManager; import org.wso2.carbon.identity.oauth.OAuthAdminServiceImpl; +import org.wso2.carbon.identity.oauth.rar.core.AuthorizationDetailsSchemaValidator; /** * Service holder class for api resource management. @@ -48,6 +50,19 @@ private static class OAuthAdminServiceImplHolder { .getThreadLocalCarbonContext().getOSGiService(OAuthAdminServiceImpl.class, null); } + private static class AuthorizationDetailsTypeManagerHolder { + + static final AuthorizationDetailsTypeManager SERVICE = (AuthorizationDetailsTypeManager) PrivilegedCarbonContext + .getThreadLocalCarbonContext().getOSGiService(AuthorizationDetailsTypeManager.class, null); + } + + private static class AuthorizationDetailsSchemaValidatorHolder { + + static final AuthorizationDetailsSchemaValidator SERVICE = + (AuthorizationDetailsSchemaValidator) PrivilegedCarbonContext.getThreadLocalCarbonContext() + .getOSGiService(AuthorizationDetailsSchemaValidator.class, null); + } + /** * Get APIResourceManager osgi service. * @@ -77,4 +92,24 @@ public static OAuthAdminServiceImpl getOAuthAdminServiceImpl() { return OAuthAdminServiceImplHolder.SERVICE; } + + /** + * Set {@link AuthorizationDetailsTypeManager} instance. + * + * @return AuthorizationDetailsTypeManager instance. + */ + public static AuthorizationDetailsTypeManager getAuthorizationDetailsTypeManager() { + + return AuthorizationDetailsTypeManagerHolder.SERVICE; + } + + /** + * Set {@link AuthorizationDetailsSchemaValidator} instance. + * + * @return AuthorizationDetailsSchemaValidator instance. + */ + public static AuthorizationDetailsSchemaValidator getAuthorizationDetailsSchemaValidator() { + + return AuthorizationDetailsSchemaValidatorHolder.SERVICE; + } } 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 0a41af5bad..591bea9648 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 @@ -120,6 +120,11 @@ org.wso2.carbon.identity.oauth provided + + org.wso2.carbon.identity.inbound.auth.oauth2 + org.wso2.carbon.identity.oauth.rar + provided + diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/APIResourceCreationModel.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/APIResourceCreationModel.java index 3e60430092..812e1dbe86 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/APIResourceCreationModel.java +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/APIResourceCreationModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, 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 @@ -24,6 +24,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesCreationModel; import org.wso2.carbon.identity.api.server.api.resource.v1.ScopeCreationModel; import javax.validation.constraints.*; @@ -41,6 +42,8 @@ public class APIResourceCreationModel { private Boolean requiresAuthorization; private List scopes = null; + private List authorizationDetailsTypes = null; + /** **/ @@ -144,6 +147,32 @@ public APIResourceCreationModel addScopesItem(ScopeCreationModel scopesItem) { return this; } + /** + **/ + public APIResourceCreationModel authorizationDetailsTypes(List authorizationDetailsTypes) { + + this.authorizationDetailsTypes = authorizationDetailsTypes; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("authorizationDetailsTypes") + @Valid + public List getAuthorizationDetailsTypes() { + return authorizationDetailsTypes; + } + public void setAuthorizationDetailsTypes(List authorizationDetailsTypes) { + this.authorizationDetailsTypes = authorizationDetailsTypes; + } + + public APIResourceCreationModel addAuthorizationDetailsTypesItem(AuthorizationDetailsTypesCreationModel authorizationDetailsTypesItem) { + if (this.authorizationDetailsTypes == null) { + this.authorizationDetailsTypes = new ArrayList(); + } + this.authorizationDetailsTypes.add(authorizationDetailsTypesItem); + return this; + } + @Override @@ -160,12 +189,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.identifier, apIResourceCreationModel.identifier) && Objects.equals(this.description, apIResourceCreationModel.description) && Objects.equals(this.requiresAuthorization, apIResourceCreationModel.requiresAuthorization) && - Objects.equals(this.scopes, apIResourceCreationModel.scopes); + Objects.equals(this.scopes, apIResourceCreationModel.scopes) && + Objects.equals(this.authorizationDetailsTypes, apIResourceCreationModel.authorizationDetailsTypes); } @Override public int hashCode() { - return Objects.hash(name, identifier, description, requiresAuthorization, scopes); + return Objects.hash(name, identifier, description, requiresAuthorization, scopes, authorizationDetailsTypes); } @Override @@ -179,6 +209,7 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" requiresAuthorization: ").append(toIndentedString(requiresAuthorization)).append("\n"); sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); + sb.append(" authorizationDetailsTypes: ").append(toIndentedString(authorizationDetailsTypes)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/APIResourcePatchModel.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/APIResourcePatchModel.java index ba00307b2e..b5d5a2ee53 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/APIResourcePatchModel.java +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/APIResourcePatchModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, 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 @@ -24,6 +24,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesCreationModel; import org.wso2.carbon.identity.api.server.api.resource.v1.ScopeCreationModel; import javax.validation.constraints.*; @@ -41,6 +42,10 @@ public class APIResourcePatchModel { private List removedScopes = null; + private List addedAuthorizationDetailsTypes = null; + + private List removedAuthorizationDetailsTypes = null; + /** **/ @@ -131,6 +136,58 @@ public APIResourcePatchModel addRemovedScopesItem(String removedScopesItem) { return this; } + /** + **/ + public APIResourcePatchModel addedAuthorizationDetailsTypes(List addedAuthorizationDetailsTypes) { + + this.addedAuthorizationDetailsTypes = addedAuthorizationDetailsTypes; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("addedAuthorizationDetailsTypes") + @Valid + public List getAddedAuthorizationDetailsTypes() { + return addedAuthorizationDetailsTypes; + } + public void setAddedAuthorizationDetailsTypes(List addedAuthorizationDetailsTypes) { + this.addedAuthorizationDetailsTypes = addedAuthorizationDetailsTypes; + } + + public APIResourcePatchModel addAddedAuthorizationDetailsTypesItem(AuthorizationDetailsTypesCreationModel addedAuthorizationDetailsTypesItem) { + if (this.addedAuthorizationDetailsTypes == null) { + this.addedAuthorizationDetailsTypes = new ArrayList(); + } + this.addedAuthorizationDetailsTypes.add(addedAuthorizationDetailsTypesItem); + return this; + } + + /** + **/ + public APIResourcePatchModel removedAuthorizationDetailsTypes(List removedAuthorizationDetailsTypes) { + + this.removedAuthorizationDetailsTypes = removedAuthorizationDetailsTypes; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("removedAuthorizationDetailsTypes") + @Valid + public List getRemovedAuthorizationDetailsTypes() { + return removedAuthorizationDetailsTypes; + } + public void setRemovedAuthorizationDetailsTypes(List removedAuthorizationDetailsTypes) { + this.removedAuthorizationDetailsTypes = removedAuthorizationDetailsTypes; + } + + public APIResourcePatchModel addRemovedAuthorizationDetailsTypesItem(String removedAuthorizationDetailsTypesItem) { + if (this.removedAuthorizationDetailsTypes == null) { + this.removedAuthorizationDetailsTypes = new ArrayList(); + } + this.removedAuthorizationDetailsTypes.add(removedAuthorizationDetailsTypesItem); + return this; + } + @Override @@ -146,12 +203,14 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.name, apIResourcePatchModel.name) && Objects.equals(this.description, apIResourcePatchModel.description) && Objects.equals(this.addedScopes, apIResourcePatchModel.addedScopes) && - Objects.equals(this.removedScopes, apIResourcePatchModel.removedScopes); + Objects.equals(this.removedScopes, apIResourcePatchModel.removedScopes) && + Objects.equals(this.addedAuthorizationDetailsTypes, apIResourcePatchModel.addedAuthorizationDetailsTypes) && + Objects.equals(this.removedAuthorizationDetailsTypes, apIResourcePatchModel.removedAuthorizationDetailsTypes); } @Override public int hashCode() { - return Objects.hash(name, description, addedScopes, removedScopes); + return Objects.hash(name, description, addedScopes, removedScopes, addedAuthorizationDetailsTypes, removedAuthorizationDetailsTypes); } @Override @@ -164,6 +223,8 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" addedScopes: ").append(toIndentedString(addedScopes)).append("\n"); sb.append(" removedScopes: ").append(toIndentedString(removedScopes)).append("\n"); + sb.append(" addedAuthorizationDetailsTypes: ").append(toIndentedString(addedAuthorizationDetailsTypes)).append("\n"); + sb.append(" removedAuthorizationDetailsTypes: ").append(toIndentedString(removedAuthorizationDetailsTypes)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/APIResourceResponse.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/APIResourceResponse.java index a2c360f259..4658a30120 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/APIResourceResponse.java +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/APIResourceResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, 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 @@ -24,6 +24,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesGetModel; import org.wso2.carbon.identity.api.server.api.resource.v1.Property; import org.wso2.carbon.identity.api.server.api.resource.v1.ScopeGetModel; import org.wso2.carbon.identity.api.server.api.resource.v1.SubscribedApplicationGetModel; @@ -45,6 +46,8 @@ public class APIResourceResponse { private Boolean requiresAuthorization; private List scopes = null; + private List authorizationDetailsTypes = null; + private List subscribedApplications = null; private List properties = null; @@ -193,6 +196,32 @@ public APIResourceResponse addScopesItem(ScopeGetModel scopesItem) { /** **/ + public APIResourceResponse authorizationDetailsTypes(List authorizationDetailsTypes) { + + this.authorizationDetailsTypes = authorizationDetailsTypes; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("authorizationDetailsTypes") + @Valid + public List getAuthorizationDetailsTypes() { + return authorizationDetailsTypes; + } + public void setAuthorizationDetailsTypes(List authorizationDetailsTypes) { + this.authorizationDetailsTypes = authorizationDetailsTypes; + } + + public APIResourceResponse addAuthorizationDetailsTypesItem(AuthorizationDetailsTypesGetModel authorizationDetailsTypesItem) { + if (this.authorizationDetailsTypes == null) { + this.authorizationDetailsTypes = new ArrayList(); + } + this.authorizationDetailsTypes.add(authorizationDetailsTypesItem); + return this; + } + + /** + **/ public APIResourceResponse subscribedApplications(List subscribedApplications) { this.subscribedApplications = subscribedApplications; @@ -282,6 +311,7 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.type, apIResourceResponse.type) && Objects.equals(this.requiresAuthorization, apIResourceResponse.requiresAuthorization) && Objects.equals(this.scopes, apIResourceResponse.scopes) && + Objects.equals(this.authorizationDetailsTypes, apIResourceResponse.authorizationDetailsTypes) && Objects.equals(this.subscribedApplications, apIResourceResponse.subscribedApplications) && Objects.equals(this.properties, apIResourceResponse.properties) && Objects.equals(this.self, apIResourceResponse.self); @@ -289,7 +319,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(id, name, description, identifier, type, requiresAuthorization, scopes, subscribedApplications, properties, self); + return Objects.hash(id, name, description, identifier, type, requiresAuthorization, scopes, authorizationDetailsTypes, subscribedApplications, properties, self); } @Override @@ -305,6 +335,7 @@ public String toString() { sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" requiresAuthorization: ").append(toIndentedString(requiresAuthorization)).append("\n"); sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); + sb.append(" authorizationDetailsTypes: ").append(toIndentedString(authorizationDetailsTypes)).append("\n"); sb.append(" subscribedApplications: ").append(toIndentedString(subscribedApplications)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); sb.append(" self: ").append(toIndentedString(self)).append("\n"); diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/ApiResourcesApi.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/ApiResourcesApi.java index d488fbf1c0..540c35185e 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/ApiResourcesApi.java +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/ApiResourcesApi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, 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 @@ -27,10 +27,13 @@ import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceListResponse; import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourcePatchModel; import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceResponse; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesCreationModel; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesGetModel; import org.wso2.carbon.identity.api.server.api.resource.v1.Error; import java.util.List; import org.wso2.carbon.identity.api.server.api.resource.v1.ScopeCreationModel; import org.wso2.carbon.identity.api.server.api.resource.v1.ScopeGetModel; +import org.wso2.carbon.identity.api.server.api.resource.v1.ScopePatchModel; import org.wso2.carbon.identity.api.server.api.resource.v1.ApiResourcesApiService; import javax.validation.Valid; @@ -78,6 +81,28 @@ public Response addAPIResource(@ApiParam(value = "This represents the API resour return delegate.addAPIResource(apIResourceCreationModel ); } + @Valid + @PUT + @Path("/{apiResourceId}/authorization-details-types") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "Adds new authorization details types to the API resource", notes = "This API is used to add a new authorization details type to API resource. Permission required: * /permission/admin/manage/identity/apiresourcemgt/update Scope required: * internal_api_resource_update ", response = AuthorizationDetailsTypesGetModel.class, responseContainer = "List", authorizations = { + @Authorization(value = "BasicAuth"), + @Authorization(value = "OAuth2", scopes = { + + }) + }, tags={ "API Resource Authorization Details Types", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Successfully added a list of authorization details types", response = AuthorizationDetailsTypesGetModel.class, responseContainer = "List"), + @ApiResponse(code = 401, message = "Unauthorized request", response = Error.class), + @ApiResponse(code = 404, message = "Requested resource is not found", response = Error.class), + @ApiResponse(code = 500, message = "Encountered a server error", response = Error.class) + }) + public Response addAuthorizationDetailsTypes(@ApiParam(value = "ID of the API Resource.",required=true) @PathParam("apiResourceId") String apiResourceId, @ApiParam(value = "" ) @Valid List authorizationDetailsTypesCreationModel) { + + return delegate.addAuthorizationDetailsTypes(apiResourceId, authorizationDetailsTypesCreationModel ); + } + @Valid @DELETE @Path("/{apiResourceId}") @@ -242,6 +267,27 @@ public Response apiResourcesApiResourceIdScopesScopeNamePatch(@ApiParam(value = return delegate.apiResourcesApiResourceIdScopesScopeNamePatch(apiResourceId, scopeName, scopePatchModel); } + @Valid + @DELETE + @Path("/{apiResourceId}/authorization-details-types/{authorizationDetailsTypeId}") + + @Produces({ "application/json" }) + @ApiOperation(value = "Deletes a registered authorization details type by type ID", notes = "This API is used to delete a registered authorization details type by a given type ID. Permission required: * /permission/admin/manage/identity/apiresourcemgt/delete Scope required: * internal_api_resource_delete ", response = Void.class, authorizations = { + @Authorization(value = "BasicAuth"), + @Authorization(value = "OAuth2", scopes = { + + }) + }, tags={ "API Resource Authorization Details Types", }) + @ApiResponses(value = { + @ApiResponse(code = 204, message = "Successfully deleted an authorization details type by type ID", response = Void.class), + @ApiResponse(code = 401, message = "Unauthorized request", response = Error.class), + @ApiResponse(code = 500, message = "Encountered a server error", response = Error.class) + }) + public Response deleteAuthorizationDetailsType(@ApiParam(value = "ID of the API Resource.",required=true) @PathParam("apiResourceId") String apiResourceId, @ApiParam(value = "The ID of the authorization details type that is to be retrieved",required=true) @PathParam("authorizationDetailsTypeId") String authorizationDetailsTypeId) { + + return delegate.deleteAuthorizationDetailsType(apiResourceId, authorizationDetailsTypeId ); + } + @Valid @GET @@ -264,4 +310,70 @@ public Response getAPIResources( @Valid@ApiParam(value = "Base64 encoded curs return delegate.getAPIResources(before, after, filter, limit, attributes ); } + @Valid + @GET + @Path("/{apiResourceId}/authorization-details-types/{authorizationDetailsTypeId}") + + @Produces({ "application/json" }) + @ApiOperation(value = "Returns a registered authorization details type by type ID", notes = "This API is used to retrieve details of a registered authorization details type by a given type ID. Permission required: * /permission/admin/manage/identity/apiresourcemgt/view Scope required: * internal_api_resource_view ", response = AuthorizationDetailsTypesGetModel.class, authorizations = { + @Authorization(value = "BasicAuth"), + @Authorization(value = "OAuth2", scopes = { + + }) + }, tags={ "API Resource Authorization Details Types", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Successfully retrieved an authorization details type by type ID", response = AuthorizationDetailsTypesGetModel.class), + @ApiResponse(code = 401, message = "Unauthorized request", response = Error.class), + @ApiResponse(code = 404, message = "Requested resource is not found", response = Error.class), + @ApiResponse(code = 500, message = "Encountered a server error", response = Error.class) + }) + public Response getAuthorizationDetailsType(@ApiParam(value = "ID of the API Resource.",required=true) @PathParam("apiResourceId") String apiResourceId, @ApiParam(value = "The ID of the authorization details type that is to be retrieved",required=true) @PathParam("authorizationDetailsTypeId") String authorizationDetailsTypeId) { + + return delegate.getAuthorizationDetailsType(apiResourceId, authorizationDetailsTypeId ); + } + + @Valid + @GET + @Path("/{apiResourceId}/authorization-details-types") + + @Produces({ "application/json" }) + @ApiOperation(value = "Lists all registered authorization details types", notes = "This API is used to get all registered authorization details types. Permission required: * /permission/admin/manage/identity/apiresourcemgt/view Scope required: * internal_api_resource_view ", response = AuthorizationDetailsTypesGetModel.class, responseContainer = "List", authorizations = { + @Authorization(value = "BasicAuth"), + @Authorization(value = "OAuth2", scopes = { + + }) + }, tags={ "API Resource Authorization Details Types", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Successfully retrieved a list of authorization details types", response = AuthorizationDetailsTypesGetModel.class, responseContainer = "List"), + @ApiResponse(code = 401, message = "Unauthorized request", response = Error.class), + @ApiResponse(code = 404, message = "Requested resource is not found", response = Error.class), + @ApiResponse(code = 500, message = "Encountered a server error", response = Error.class) + }) + public Response getAuthorizationDetailsTypes(@ApiParam(value = "ID of the API Resource.",required=true) @PathParam("apiResourceId") String apiResourceId) { + + return delegate.getAuthorizationDetailsTypes(apiResourceId ); + } + + @Valid + @PATCH + @Path("/{apiResourceId}/authorization-details-types/{authorizationDetailsTypeId}") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "Updates a registered authorization details type by type ID", notes = "This API is used to update a registered authorization details type by a given type ID. Permission required: * /permission/admin/manage/identity/apiresourcemgt/update Scope required: * internal_api_resource_update ", response = Void.class, authorizations = { + @Authorization(value = "BasicAuth"), + @Authorization(value = "OAuth2", scopes = { + + }) + }, tags={ "API Resource Authorization Details Types" }) + @ApiResponses(value = { + @ApiResponse(code = 204, message = "No Content", response = Void.class), + @ApiResponse(code = 401, message = "Unauthorized request", response = Error.class), + @ApiResponse(code = 404, message = "Requested resource is not found", response = Error.class), + @ApiResponse(code = 500, message = "Encountered a server error", response = Error.class) + }) + public Response updateAuthorizationDetailsType(@ApiParam(value = "ID of the API Resource.",required=true) @PathParam("apiResourceId") String apiResourceId, @ApiParam(value = "The ID of the authorization details type that is to be retrieved",required=true) @PathParam("authorizationDetailsTypeId") String authorizationDetailsTypeId, @ApiParam(value = "" ) @Valid AuthorizationDetailsTypesCreationModel authorizationDetailsTypesCreationModel) { + + return delegate.updateAuthorizationDetailsType(apiResourceId, authorizationDetailsTypeId, authorizationDetailsTypesCreationModel ); + } + } diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/ApiResourcesApiService.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/ApiResourcesApiService.java index 0e6e0e817b..267f65c9e1 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/ApiResourcesApiService.java +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/ApiResourcesApiService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, 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 @@ -28,10 +28,13 @@ import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceListResponse; import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourcePatchModel; import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceResponse; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesCreationModel; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesGetModel; import org.wso2.carbon.identity.api.server.api.resource.v1.Error; import java.util.List; import org.wso2.carbon.identity.api.server.api.resource.v1.ScopeCreationModel; import org.wso2.carbon.identity.api.server.api.resource.v1.ScopeGetModel; +import org.wso2.carbon.identity.api.server.api.resource.v1.ScopePatchModel; import javax.ws.rs.core.Response; @@ -39,6 +42,8 @@ public interface ApiResourcesApiService { public Response addAPIResource(APIResourceCreationModel apIResourceCreationModel); + public Response addAuthorizationDetailsTypes(String apiResourceId, List authorizationDetailsTypesCreationModel); + public Response apiResourcesApiResourceIdDelete(String apiResourceId); public Response apiResourcesApiResourceIdGet(String apiResourceId); @@ -53,5 +58,13 @@ public interface ApiResourcesApiService { public Response apiResourcesApiResourceIdScopesScopeNamePatch(String apiResourceId, String scopeName, ScopePatchModel scopePatchModel); + public Response deleteAuthorizationDetailsType(String apiResourceId, String authorizationDetailsTypeId); + public Response getAPIResources(String before, String after, String filter, Integer limit, String attributes); + + public Response getAuthorizationDetailsType(String apiResourceId, String authorizationDetailsTypeId); + + public Response getAuthorizationDetailsTypes(String apiResourceId); + + public Response updateAuthorizationDetailsType(String apiResourceId, String authorizationDetailsTypeId, AuthorizationDetailsTypesCreationModel authorizationDetailsTypesCreationModel); } diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesApi.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesApi.java new file mode 100644 index 0000000000..f7a164c74c --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesApi.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2025, 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.api.resource.v1; + +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.api.resource.v1.AuthorizationDetailsTypesGetModel; +import org.wso2.carbon.identity.api.server.api.resource.v1.Error; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesApiService; + +import javax.validation.Valid; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import io.swagger.annotations.*; +import org.wso2.carbon.identity.api.server.api.resource.v1.factories.AuthorizationDetailsTypesApiServiceFactory; + +import javax.validation.constraints.*; + +@Path("/authorization-details-types") +@Api(description = "The authorization-details-types API") + +public class AuthorizationDetailsTypesApi { + + private final AuthorizationDetailsTypesApiService delegate; + + public AuthorizationDetailsTypesApi() { + + this.delegate = AuthorizationDetailsTypesApiServiceFactory.getAuthorizationDetailsTypesApi(); + } + + @Valid + @GET + + + @Produces({ "application/json" }) + @ApiOperation(value = "Gets all authorization details types in the tenant", notes = "Get all authorization details types in the tenant Permission required:
* /permission/admin/manage/identity/apiresourcemgt/view
Scope required:
* internal_api_resource_view ", response = AuthorizationDetailsTypesGetModel.class, responseContainer = "List", authorizations = { + @Authorization(value = "BasicAuth"), + @Authorization(value = "OAuth2", scopes = { + + }) + }, tags={ "API Resource Authorization Details Types", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = AuthorizationDetailsTypesGetModel.class, responseContainer = "List"), + @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + @ApiResponse(code = 403, message = "Forbidden", response = Void.class), + @ApiResponse(code = 404, message = "Not Found", response = Error.class), + @ApiResponse(code = 500, message = "Server Error", response = Error.class) + }) + public Response authorizationDetailsTypesGet( @Valid@ApiParam(value = "Condition to filter the retrieval of records. Supports 'sw', 'co', 'ew' and 'eq' operations. ") @QueryParam("filter") String filter) { + + return delegate.authorizationDetailsTypesGet(filter ); + } + + @Valid + @HEAD + + + + @ApiOperation(value = "Checks an authorization details type existence by type in the tenant", notes = "This API is used to check a registered authorization details type's existence using a given type in the tenant. Permission required: * /permission/admin/manage/identity/apiresourcemgt/view Scope required: * internal_api_resource_view ", response = Void.class, authorizations = { + @Authorization(value = "BasicAuth"), + @Authorization(value = "OAuth2", scopes = { + + }) + }, tags={ "API Resource Authorization Details Types" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Provided authorization details type exists", response = Void.class), + @ApiResponse(code = 401, message = "Unauthorized request", response = Void.class), + @ApiResponse(code = 404, message = "Requested resource is not found", response = Void.class), + @ApiResponse(code = 500, message = "Encountered a server error", response = Void.class) + }) + public Response isAuthorizationDetailsTypeExists( @Valid @NotNull(message = "Property cannot be null.") @ApiParam(value = "Condition to filter the retrieval of records. Supports 'sw', 'co', 'ew' and 'eq' operations. ",required=true) @QueryParam("filter") String filter) { + + return delegate.isAuthorizationDetailsTypeExists(filter ); + } + +} diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesApiService.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesApiService.java new file mode 100644 index 0000000000..1fa8cda8db --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesApiService.java @@ -0,0 +1,37 @@ +/* + * 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.api.resource.v1; + +import org.wso2.carbon.identity.api.server.api.resource.v1.*; +import org.wso2.carbon.identity.api.server.api.resource.v1.*; +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.api.resource.v1.AuthorizationDetailsTypesGetModel; +import org.wso2.carbon.identity.api.server.api.resource.v1.Error; +import javax.ws.rs.core.Response; + + +public interface AuthorizationDetailsTypesApiService { + + public Response authorizationDetailsTypesGet(String filter); + + public Response isAuthorizationDetailsTypeExists(String filter); +} diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesCreationModel.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesCreationModel.java new file mode 100644 index 0000000000..2e8514f7fe --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesCreationModel.java @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2025, 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.api.resource.v1; + +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.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; +import javax.validation.Valid; +import javax.xml.bind.annotation.*; + +public class AuthorizationDetailsTypesCreationModel { + + private String type; + private String name; + private String description; + private Map schema = new HashMap(); + + + /** + * an unique type of the authorization details type + **/ + public AuthorizationDetailsTypesCreationModel type(String type) { + + this.type = type; + return this; + } + + @ApiModelProperty(example = "payment_initiation", required = true, value = "an unique type of the authorization details type") + @JsonProperty("type") + @Valid + @NotNull(message = "Property type cannot be null.") + @Size(min=1,max=255) + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + * display name of the authorization details type + **/ + public AuthorizationDetailsTypesCreationModel name(String name) { + + this.name = name; + return this; + } + + @ApiModelProperty(example = "Payment Initiation", required = true, value = "display name of the authorization details type") + @JsonProperty("name") + @Valid + @NotNull(message = "Property name cannot be null.") + @Size(min=3,max=255) + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + * description of the authorization details type + **/ + public AuthorizationDetailsTypesCreationModel description(String description) { + + this.description = description; + return this; + } + + @ApiModelProperty(example = "Payment initiation authorization details type", required = true, value = "description of the authorization details type") + @JsonProperty("description") + @Valid + @NotNull(message = "Property description cannot be null.") + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + /** + * Accepts the [JSON Schema document](https://json-schema.org/draft/2020-12/json-schema-core#name-json-schema-documents) of the authorization details type + **/ + public AuthorizationDetailsTypesCreationModel schema(Map schema) { + + this.schema = schema; + return this; + } + + @ApiModelProperty(example = "{\"type\":\"object\",\"required\":[\"type\",\"actions\",\"locations\",\"instructedAmount\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"payment_initiation\"]},\"actions\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"enum\":[\"initiate\",\"cancel\"]}},\"locations\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"uri\"}},\"instructedAmount\":{\"type\":\"object\",\"properties\":{\"currency\":{\"type\":\"string\",\"minLength\":3},\"amount\":{\"type\":\"string\"}}},\"creditorName\":\"string\",\"creditorAccount\":{\"type\":\"object\"}}}", required = true, value = "Accepts the [JSON Schema document](https://json-schema.org/draft/2020-12/json-schema-core#name-json-schema-documents) of the authorization details type") + @JsonProperty("schema") + @Valid + @NotNull(message = "Property schema cannot be null.") + + public Map getSchema() { + return schema; + } + public void setSchema(Map schema) { + this.schema = schema; + } + + + public AuthorizationDetailsTypesCreationModel putSchemaItem(String key, Object schemaItem) { + this.schema.put(key, schemaItem); + return this; + } + + + + @Override + public boolean equals(java.lang.Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthorizationDetailsTypesCreationModel authorizationDetailsTypesCreationModel = (AuthorizationDetailsTypesCreationModel) o; + return Objects.equals(this.type, authorizationDetailsTypesCreationModel.type) && + Objects.equals(this.name, authorizationDetailsTypesCreationModel.name) && + Objects.equals(this.description, authorizationDetailsTypesCreationModel.description) && + Objects.equals(this.schema, authorizationDetailsTypesCreationModel.schema); + } + + @Override + public int hashCode() { + return Objects.hash(type, name, description, schema); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class AuthorizationDetailsTypesCreationModel {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).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.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesCreationModelAllOf.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesCreationModelAllOf.java new file mode 100644 index 0000000000..624d85e241 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesCreationModelAllOf.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2025, 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.api.resource.v1; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; +import javax.validation.Valid; +import javax.xml.bind.annotation.*; + +public class AuthorizationDetailsTypesCreationModelAllOf { + + private String type; + + /** + * an unique type of the authorization details type + **/ + public AuthorizationDetailsTypesCreationModelAllOf type(String type) { + + this.type = type; + return this; + } + + @ApiModelProperty(example = "payment_initiation", required = true, value = "an unique type of the authorization details type") + @JsonProperty("type") + @Valid + @NotNull(message = "Property type cannot be null.") + @Size(min=1,max=255) + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + + + @Override + public boolean equals(java.lang.Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthorizationDetailsTypesCreationModelAllOf authorizationDetailsTypesCreationModelAllOf = (AuthorizationDetailsTypesCreationModelAllOf) o; + return Objects.equals(this.type, authorizationDetailsTypesCreationModelAllOf.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class AuthorizationDetailsTypesCreationModelAllOf {\n"); + + sb.append(" type: ").append(toIndentedString(type)).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.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesGetModel.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesGetModel.java new file mode 100644 index 0000000000..727fb0bf8f --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesGetModel.java @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2025, 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.api.resource.v1; + +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.HashMap; +import java.util.List; +import java.util.Map; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesCreationModel; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesGetModelAllOf; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; +import javax.validation.Valid; +import javax.xml.bind.annotation.*; + +public class AuthorizationDetailsTypesGetModel { + + private String id; + private String type; + private String name; + private String description; + private Map schema = new HashMap(); + + + /** + * an unique id of the registered authorization details type + **/ + public AuthorizationDetailsTypesGetModel id(String id) { + + this.id = id; + return this; + } + + @ApiModelProperty(example = "a9403470-dd11-46b4-8db9-aaa31f1d4423", required = true, value = "an unique id of the registered authorization details type") + @JsonProperty("id") + @Valid + @NotNull(message = "Property id cannot be null.") + @Size(min=36,max=36) + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + /** + * an unique type of the authorization details type + **/ + public AuthorizationDetailsTypesGetModel type(String type) { + + this.type = type; + return this; + } + + @ApiModelProperty(example = "payment_initiation", required = true, value = "an unique type of the authorization details type") + @JsonProperty("type") + @Valid + @NotNull(message = "Property type cannot be null.") + @Size(min=1,max=255) + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + * display name of the authorization details type + **/ + public AuthorizationDetailsTypesGetModel name(String name) { + + this.name = name; + return this; + } + + @ApiModelProperty(example = "Payment Initiation", required = true, value = "display name of the authorization details type") + @JsonProperty("name") + @Valid + @NotNull(message = "Property name cannot be null.") + @Size(min=3,max=255) + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + * description of the authorization details type + **/ + public AuthorizationDetailsTypesGetModel description(String description) { + + this.description = description; + return this; + } + + @ApiModelProperty(example = "Payment initiation authorization details type", required = true, value = "description of the authorization details type") + @JsonProperty("description") + @Valid + @NotNull(message = "Property description cannot be null.") + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + /** + * Accepts the [JSON Schema document](https://json-schema.org/draft/2020-12/json-schema-core#name-json-schema-documents) of the authorization details type + **/ + public AuthorizationDetailsTypesGetModel schema(Map schema) { + + this.schema = schema; + return this; + } + + @ApiModelProperty(example = "{\"type\":\"object\",\"required\":[\"type\",\"actions\",\"locations\",\"instructedAmount\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"payment_initiation\"]},\"actions\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"enum\":[\"initiate\",\"cancel\"]}},\"locations\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"uri\"}},\"instructedAmount\":{\"type\":\"object\",\"properties\":{\"currency\":{\"type\":\"string\",\"minLength\":3},\"amount\":{\"type\":\"string\"}}},\"creditorName\":\"string\",\"creditorAccount\":{\"type\":\"object\"}}}", required = true, value = "Accepts the [JSON Schema document](https://json-schema.org/draft/2020-12/json-schema-core#name-json-schema-documents) of the authorization details type") + @JsonProperty("schema") + @Valid + @NotNull(message = "Property schema cannot be null.") + + public Map getSchema() { + return schema; + } + public void setSchema(Map schema) { + this.schema = schema; + } + + + public AuthorizationDetailsTypesGetModel putSchemaItem(String key, Object schemaItem) { + this.schema.put(key, schemaItem); + return this; + } + + + + @Override + public boolean equals(java.lang.Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthorizationDetailsTypesGetModel authorizationDetailsTypesGetModel = (AuthorizationDetailsTypesGetModel) o; + return Objects.equals(this.id, authorizationDetailsTypesGetModel.id) && + Objects.equals(this.type, authorizationDetailsTypesGetModel.type) && + Objects.equals(this.name, authorizationDetailsTypesGetModel.name) && + Objects.equals(this.description, authorizationDetailsTypesGetModel.description) && + Objects.equals(this.schema, authorizationDetailsTypesGetModel.schema); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, name, description, schema); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class AuthorizationDetailsTypesGetModel {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).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.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesGetModelAllOf.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesGetModelAllOf.java new file mode 100644 index 0000000000..39a3f6526e --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesGetModelAllOf.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2025, 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.api.resource.v1; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; +import javax.validation.Valid; +import javax.xml.bind.annotation.*; + +public class AuthorizationDetailsTypesGetModelAllOf { + + private String id; + + /** + * an unique id of the registered authorization details type + **/ + public AuthorizationDetailsTypesGetModelAllOf id(String id) { + + this.id = id; + return this; + } + + @ApiModelProperty(example = "a9403470-dd11-46b4-8db9-aaa31f1d4423", required = true, value = "an unique id of the registered authorization details type") + @JsonProperty("id") + @Valid + @NotNull(message = "Property id cannot be null.") + @Size(min=36,max=36) + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + + + @Override + public boolean equals(java.lang.Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthorizationDetailsTypesGetModelAllOf authorizationDetailsTypesGetModelAllOf = (AuthorizationDetailsTypesGetModelAllOf) o; + return Objects.equals(this.id, authorizationDetailsTypesGetModelAllOf.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class AuthorizationDetailsTypesGetModelAllOf {\n"); + + sb.append(" id: ").append(toIndentedString(id)).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.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesPatchModel.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesPatchModel.java new file mode 100644 index 0000000000..e403d3ca63 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/AuthorizationDetailsTypesPatchModel.java @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2025, 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.api.resource.v1; + +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.HashMap; +import java.util.List; +import java.util.Map; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; +import javax.validation.Valid; +import javax.xml.bind.annotation.*; + +public class AuthorizationDetailsTypesPatchModel { + + private String name; + private String description; + private Map schema = new HashMap(); + + + /** + * display name of the authorization details type + **/ + public AuthorizationDetailsTypesPatchModel name(String name) { + + this.name = name; + return this; + } + + @ApiModelProperty(example = "Payment Initiation", required = true, value = "display name of the authorization details type") + @JsonProperty("name") + @Valid + @NotNull(message = "Property name cannot be null.") + @Size(min=3,max=255) + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + /** + * description of the authorization details type + **/ + public AuthorizationDetailsTypesPatchModel description(String description) { + + this.description = description; + return this; + } + + @ApiModelProperty(example = "Payment initiation authorization details type", required = true, value = "description of the authorization details type") + @JsonProperty("description") + @Valid + @NotNull(message = "Property description cannot be null.") + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + /** + * Accepts the [JSON Schema document](https://json-schema.org/draft/2020-12/json-schema-core#name-json-schema-documents) of the authorization details type + **/ + public AuthorizationDetailsTypesPatchModel schema(Map schema) { + + this.schema = schema; + return this; + } + + @ApiModelProperty(example = "{\"type\":\"object\",\"required\":[\"type\",\"actions\",\"locations\",\"instructedAmount\"],\"properties\":{\"type\":{\"type\":\"string\",\"enum\":[\"payment_initiation\"]},\"actions\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"enum\":[\"initiate\",\"cancel\"]}},\"locations\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"format\":\"uri\"}},\"instructedAmount\":{\"type\":\"object\",\"properties\":{\"currency\":{\"type\":\"string\",\"minLength\":3},\"amount\":{\"type\":\"string\"}}},\"creditorName\":\"string\",\"creditorAccount\":{\"type\":\"object\"}}}", required = true, value = "Accepts the [JSON Schema document](https://json-schema.org/draft/2020-12/json-schema-core#name-json-schema-documents) of the authorization details type") + @JsonProperty("schema") + @Valid + @NotNull(message = "Property schema cannot be null.") + + public Map getSchema() { + return schema; + } + public void setSchema(Map schema) { + this.schema = schema; + } + + + public AuthorizationDetailsTypesPatchModel putSchemaItem(String key, Object schemaItem) { + this.schema.put(key, schemaItem); + return this; + } + + + + @Override + public boolean equals(java.lang.Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthorizationDetailsTypesPatchModel authorizationDetailsTypesPatchModel = (AuthorizationDetailsTypesPatchModel) o; + return Objects.equals(this.name, authorizationDetailsTypesPatchModel.name) && + Objects.equals(this.description, authorizationDetailsTypesPatchModel.description) && + Objects.equals(this.schema, authorizationDetailsTypesPatchModel.schema); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, schema); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class AuthorizationDetailsTypesPatchModel {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).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.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/factories/AuthorizationDetailsTypesApiServiceFactory.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/factories/AuthorizationDetailsTypesApiServiceFactory.java new file mode 100644 index 0000000000..c90233f9a1 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/gen/java/org/wso2/carbon/identity/api/server/api/resource/v1/factories/AuthorizationDetailsTypesApiServiceFactory.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2025, 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.api.resource.v1.factories; + +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesApiService; +import org.wso2.carbon.identity.api.server.api.resource.v1.impl.AuthorizationDetailsTypesApiServiceImpl; + +/** + * Factory class for {@link AuthorizationDetailsTypesApiService}. + */ +public class AuthorizationDetailsTypesApiServiceFactory { + + private final static AuthorizationDetailsTypesApiService service = new AuthorizationDetailsTypesApiServiceImpl(); + + public static AuthorizationDetailsTypesApiService getAuthorizationDetailsTypesApi() { + return service; + } +} diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/constants/APIResourceMgtEndpointConstants.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/constants/APIResourceMgtEndpointConstants.java index af0c9b4cd7..0fcc772d19 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/constants/APIResourceMgtEndpointConstants.java +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/constants/APIResourceMgtEndpointConstants.java @@ -101,7 +101,12 @@ public enum ErrorMessage { ERROR_CODE_API_RESOURCE_COLLECTION_NOT_FOUND("60014", "Unable to find the API resource collection.", "Unable to find the API resource collection with the id: %s in the tenant domain."), - + ERROR_CODE_AUTHORIZATION_DETAILS_TYPE_NOT_FOUND("60015", + "Unable to find the authorization details type.", + "Authorization details types for resource id '%s' could not be found in the tenant domain."), + ERROR_CODE_INVALID_AUTHORIZATION_DETAILS_SCHEMA("60016", + "Authorization details schema contains errors.", + "The provided input schema does not comply with the 2020-12 JSON Schema specification: %s"), // Server errors. ERROR_CODE_ADD_API_RESOURCE("65001", "Error while adding api resource.", "Server encountered an error while " + "adding the api resource."), diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/core/AuthorizationDetailsTypeManagementService.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/core/AuthorizationDetailsTypeManagementService.java new file mode 100644 index 0000000000..cf57ed97ce --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/core/AuthorizationDetailsTypeManagementService.java @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2025, 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.api.resource.v1.core; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.identity.api.resource.mgt.APIResourceManager; +import org.wso2.carbon.identity.api.resource.mgt.APIResourceMgtException; +import org.wso2.carbon.identity.api.resource.mgt.AuthorizationDetailsTypeManager; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesCreationModel; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesGetModel; +import org.wso2.carbon.identity.api.server.api.resource.v1.constants.APIResourceMgtEndpointConstants; +import org.wso2.carbon.identity.api.server.api.resource.v1.util.APIResourceMgtEndpointUtil; +import org.wso2.carbon.identity.api.server.api.resource.v1.util.AuthorizationDetailsTypeMgtUtil; +import org.wso2.carbon.identity.application.common.model.APIResource; +import org.wso2.carbon.identity.application.common.model.AuthorizationDetailsType; + +import java.util.List; + +import javax.ws.rs.core.Response; + +import static org.wso2.carbon.context.CarbonContext.getThreadLocalCarbonContext; +import static org.wso2.carbon.identity.api.server.api.resource.v1.util.AuthorizationDetailsTypeMgtUtil.toAuthorizationDetailsGetModels; +import static org.wso2.carbon.identity.api.server.api.resource.v1.util.AuthorizationDetailsTypeMgtUtil.toAuthorizationDetailsType; + +/** + * Authorization Details Type Management Service. + */ +public class AuthorizationDetailsTypeManagementService { + + private static final Log LOG = LogFactory.getLog(AuthorizationDetailsTypeManagementService.class); + private final AuthorizationDetailsTypeManager authorizationDetailsTypeManager; + private final APIResourceManager apiResourceManager; + + public AuthorizationDetailsTypeManagementService(APIResourceManager apiResourceManager, + AuthorizationDetailsTypeManager authorizationDetailsTypeManager) { + + this.apiResourceManager = apiResourceManager; + this.authorizationDetailsTypeManager = authorizationDetailsTypeManager; + } + + /** + * Adds a list of authorization details types to a specified API resource. + * + * @param apiResourceId The ID of the API resource. + * @param creationModels List of models containing the authorization details types to be added. + * @return A list of added {@link AuthorizationDetailsType} instances. + */ + public List addAuthorizationDetailsTypes( + final String apiResourceId, final List creationModels) { + + if (LOG.isDebugEnabled()) { + LOG.debug("Adding authorization details types to resource with id: " + apiResourceId); + } + + try { + this.assertApiResourceIdExistence(apiResourceId); + + return this.authorizationDetailsTypeManager.addAuthorizationDetailsTypes( + apiResourceId, + AuthorizationDetailsTypeMgtUtil.toAuthorizationDetailsTypes(creationModels), + getThreadLocalCarbonContext().getTenantDomain() + ); + } catch (APIResourceMgtException e) { + throw APIResourceMgtEndpointUtil.handleAPIResourceMgtException(e); + } + } + + /** + * Deletes a specific authorization details type by its ID for a given API resource ID. + * + * @param apiResourceId The ID of the API resource. + * @param authorizationDetailsTypeId The ID of the authorization details type to be deleted. + */ + public void deleteAuthorizationDetailsTypeById(String apiResourceId, String authorizationDetailsTypeId) { + + if (LOG.isDebugEnabled()) { + LOG.debug(String.format("Deleting authorization details type against resource ID: %s and type ID: %s ", + apiResourceId, authorizationDetailsTypeId)); + } + try { + this.authorizationDetailsTypeManager.deleteAuthorizationDetailsTypeByApiIdAndTypeId( + apiResourceId, + authorizationDetailsTypeId, + getThreadLocalCarbonContext().getTenantDomain() + ); + } catch (APIResourceMgtException e) { + throw APIResourceMgtEndpointUtil.handleAPIResourceMgtException(e); + } + } + + /** + * Retrieves a specific authorization details type by its ID for a given API resource ID. + * + * @param apiResourceId The ID of the API resource. + * @param authorizationDetailsTypeId The ID of the authorization details type to retrieve. + * @return An {@link AuthorizationDetailsTypesGetModel} containing the authorization details type. + */ + public AuthorizationDetailsTypesGetModel getAuthorizationDetailsTypeById(String apiResourceId, + String authorizationDetailsTypeId) { + + if (LOG.isDebugEnabled()) { + LOG.debug(String.format("Retrieving authorization details type against resource ID: %s and type ID: %s ", + apiResourceId, authorizationDetailsTypeId)); + } + try { + AuthorizationDetailsType authorizationDetailsType = this.authorizationDetailsTypeManager + .getAuthorizationDetailsTypeByApiIdAndTypeId( + apiResourceId, + authorizationDetailsTypeId, + getThreadLocalCarbonContext().getTenantDomain() + ); + if (authorizationDetailsType == null) { + throw APIResourceMgtEndpointUtil.handleException( + Response.Status.NOT_FOUND, + APIResourceMgtEndpointConstants.ErrorMessage.ERROR_CODE_AUTHORIZATION_DETAILS_TYPE_NOT_FOUND, + apiResourceId + ); + } + return AuthorizationDetailsTypeMgtUtil.toAuthorizationDetailsGetModel(authorizationDetailsType); + } catch (APIResourceMgtException e) { + throw APIResourceMgtEndpointUtil.handleAPIResourceMgtException(e); + } + } + + /** + * Retrieves a list of authorization details types by a given API resource ID. + * + * @param apiResourceId The ID of the API resource. + * @return A list of {@link AuthorizationDetailsTypesGetModel} containing the authorization details types. + */ + public List getAuthorizationDetailsTypes(String apiResourceId) { + + if (LOG.isDebugEnabled()) { + LOG.debug("Retrieving authorization details type against resource id: " + apiResourceId); + } + try { + final APIResource apiResource = this.apiResourceManager + .getAPIResourceById(apiResourceId, getThreadLocalCarbonContext().getTenantDomain()); + + if (apiResource == null) { + throw APIResourceMgtEndpointUtil.handleException(Response.Status.NOT_FOUND, + APIResourceMgtEndpointConstants.ErrorMessage.ERROR_CODE_API_RESOURCE_NOT_FOUND, apiResourceId); + } + + return toAuthorizationDetailsGetModels(apiResource.getAuthorizationDetailsTypes()); + } catch (APIResourceMgtException e) { + throw APIResourceMgtEndpointUtil.handleAPIResourceMgtException(e); + } + } + + /** + * Updates the authorization details type for a specified API resource. + * + * @param apiResourceId The ID of the API resource. + * @param authorizationDetailsTypeId The ID of the authorization details type to update. + * @param creationModel The authorization details types to be updated. + */ + public void updateAuthorizationDetailsTypes(String apiResourceId, String authorizationDetailsTypeId, + AuthorizationDetailsTypesCreationModel creationModel) { + + if (LOG.isDebugEnabled()) { + LOG.debug(String.format("Updating authorization details type against resource ID: %s and type ID: %s ", + apiResourceId, authorizationDetailsTypeId)); + } + try { + this.assertApiResourceIdExistence(apiResourceId); + + if (!this.isAuthorizationDetailsTypeIdExists(apiResourceId, authorizationDetailsTypeId)) { + throw APIResourceMgtEndpointUtil.handleException( + Response.Status.NOT_FOUND, + APIResourceMgtEndpointConstants.ErrorMessage.ERROR_CODE_AUTHORIZATION_DETAILS_TYPE_NOT_FOUND, + apiResourceId + ); + } + + this.authorizationDetailsTypeManager.updateAuthorizationDetailsType( + apiResourceId, + toAuthorizationDetailsType(authorizationDetailsTypeId, creationModel), + getThreadLocalCarbonContext().getTenantDomain() + ); + } catch (APIResourceMgtException e) { + throw APIResourceMgtEndpointUtil.handleAPIResourceMgtException(e); + } + } + + /** + * Checks if the specified authorization details type exists for a given type ID and API resource ID. + * + * @param apiResourceId The ID of the API resource. + * @param authorizationDetailsTypeId The ID of the authorization details type to check. + * @return {@code true} if the authorization details type exists, {@code false} otherwise. + */ + public boolean isAuthorizationDetailsTypeIdExists(String apiResourceId, String authorizationDetailsTypeId) { + + try { + return this.authorizationDetailsTypeManager.getAuthorizationDetailsTypeByApiIdAndTypeId( + apiResourceId, + authorizationDetailsTypeId, + getThreadLocalCarbonContext().getTenantDomain() + ) != null; + } catch (APIResourceMgtException e) { + throw APIResourceMgtEndpointUtil.handleAPIResourceMgtException(e); + } + } + + /** + * Checks if an authorization details type exists based on a filter. + * + * @param filter The filter string to match authorization details types. + * @return {@code true} if at least one authorization details type matches the filter, {@code false} otherwise. + */ + public boolean isAuthorizationDetailsTypeExists(String filter) { + + if (LOG.isDebugEnabled()) { + LOG.debug("Checking authorization details type exists against filter: " + filter); + } + try { + return this.authorizationDetailsTypeManager + .isAuthorizationDetailsTypeExists( + filter, getThreadLocalCarbonContext().getTenantDomain() + ); + } catch (APIResourceMgtException e) { + throw APIResourceMgtEndpointUtil.handleAPIResourceMgtException(e); + } + } + + /** + * Retrieves all authorization details types that match a specific filter. + * + * @param filter The filter string to retrieve matching authorization details types. + * @return A list of {@link AuthorizationDetailsTypesGetModel} objects that match the filter. + */ + public List getAllAuthorizationDetailsTypes(final String filter) { + + if (LOG.isDebugEnabled()) { + LOG.debug("Retrieving all authorization details type against filter: " + filter); + } + try { + final List authorizationDetailsTypes = this.authorizationDetailsTypeManager + .getAuthorizationDetailsTypes(filter, getThreadLocalCarbonContext().getTenantDomain()); + + return toAuthorizationDetailsGetModels(authorizationDetailsTypes); + } catch (APIResourceMgtException e) { + throw APIResourceMgtEndpointUtil.handleAPIResourceMgtException(e); + } + } + + private void assertApiResourceIdExistence(final String apiResourceId) throws APIResourceMgtException { + + final APIResource apiResource = this.apiResourceManager + .getAPIResourceById(apiResourceId, getThreadLocalCarbonContext().getTenantDomain()); + + if (apiResource == null) { + throw APIResourceMgtEndpointUtil.handleException(Response.Status.NOT_FOUND, + APIResourceMgtEndpointConstants.ErrorMessage.ERROR_CODE_API_RESOURCE_NOT_FOUND, apiResourceId); + } + } +} diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/core/ServerAPIResourceManagementService.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/core/ServerAPIResourceManagementService.java index 803233332d..7e254774fd 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/core/ServerAPIResourceManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/core/ServerAPIResourceManagementService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2023-2025, 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 @@ -26,6 +26,7 @@ import org.wso2.carbon.identity.api.resource.mgt.APIResourceManager; import org.wso2.carbon.identity.api.resource.mgt.APIResourceMgtException; import org.wso2.carbon.identity.api.resource.mgt.model.APIResourceSearchResult; +import org.wso2.carbon.identity.api.server.api.resource.common.APIResourceManagementServiceHolder; import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceCreationModel; import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceListItem; import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceListResponse; @@ -60,6 +61,8 @@ import static org.wso2.carbon.identity.api.server.api.resource.v1.constants.APIResourceMgtEndpointConstants.ASC_SORT_ORDER; import static org.wso2.carbon.identity.api.server.api.resource.v1.constants.APIResourceMgtEndpointConstants.DEFAULT_LIMIT; import static org.wso2.carbon.identity.api.server.api.resource.v1.constants.APIResourceMgtEndpointConstants.DESC_SORT_ORDER; +import static org.wso2.carbon.identity.api.server.api.resource.v1.util.AuthorizationDetailsTypeMgtUtil.toAuthorizationDetailsGetModels; +import static org.wso2.carbon.identity.api.server.api.resource.v1.util.AuthorizationDetailsTypeMgtUtil.toAuthorizationDetailsTypes; import static org.wso2.carbon.identity.api.server.common.Constants.V1_API_PATH_COMPONENT; /** @@ -254,6 +257,13 @@ public void patchAPIResourceById(String apiResourceID, APIResourcePatchModel api APIResource apiResource = apiResourceBuilder.build(); apiResourceManager.updateAPIResource(apiResource, addedScopes, removedScopeNames, CarbonContext.getThreadLocalCarbonContext().getTenantDomain()); + // Replacing Authorization Details Types + APIResourceManagementServiceHolder.getAuthorizationDetailsTypeManager() + .updateAuthorizationDetailsTypes(apiResourceID, + apiResourcePatchModel.getRemovedAuthorizationDetailsTypes(), + toAuthorizationDetailsTypes(apiResourcePatchModel.getAddedAuthorizationDetailsTypes()), + CarbonContext.getThreadLocalCarbonContext().getTenantDomain() + ); } catch (APIResourceMgtException e) { throw APIResourceMgtEndpointUtil.handleAPIResourceMgtException(e); } @@ -431,6 +441,7 @@ private APIResourceResponse buildAPIResourceResponse(APIResource apiResource) { .scopes(apiResource.getScopes().stream().map(this::buildScopeGetResponse) .collect(Collectors.toList())) .requiresAuthorization(apiResource.isAuthorizationRequired()) + .authorizationDetailsTypes(toAuthorizationDetailsGetModels(apiResource.getAuthorizationDetailsTypes())) .properties(apiResource.getProperties().stream().map(this::buildAPIResourceProperty) .collect(Collectors.toList())); } @@ -480,6 +491,8 @@ private APIResource createAPIResource(APIResourceCreationModel apIResourceCreati .scopes(createScopes(apIResourceCreationModel.getScopes())) .requiresAuthorization(apIResourceCreationModel.getRequiresAuthorization() != null ? apIResourceCreationModel.getRequiresAuthorization() : true) + .authorizationDetailsTypes( + toAuthorizationDetailsTypes(apIResourceCreationModel.getAuthorizationDetailsTypes())) .type(APIResourceMgtEndpointConstants.BUSINESS_API_RESOURCE_TYPE); return apiResourceBuilder.build(); } diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/factories/AuthorizationDetailsTypeManagementServiceFactory.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/factories/AuthorizationDetailsTypeManagementServiceFactory.java new file mode 100644 index 0000000000..09e1ee2ed3 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/factories/AuthorizationDetailsTypeManagementServiceFactory.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2025, 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.api.resource.v1.factories; + +import org.wso2.carbon.identity.api.resource.mgt.APIResourceManager; +import org.wso2.carbon.identity.api.resource.mgt.AuthorizationDetailsTypeManager; +import org.wso2.carbon.identity.api.server.api.resource.common.APIResourceManagementServiceHolder; +import org.wso2.carbon.identity.api.server.api.resource.v1.core.AuthorizationDetailsTypeManagementService; + +/** + * Factory class for AuthorizationDetailsTypeManagementService. + */ +public class AuthorizationDetailsTypeManagementServiceFactory { + + private static final AuthorizationDetailsTypeManagementService SERVICE; + + static { + + final AuthorizationDetailsTypeManager authorizationDetailsTypeManager = + APIResourceManagementServiceHolder.getAuthorizationDetailsTypeManager(); + + if (authorizationDetailsTypeManager == null) { + throw new IllegalStateException("AuthorizationDetailsTypeManager is not available from OSGi context."); + } + + final APIResourceManager apiResourceManager = APIResourceManagementServiceHolder.getApiResourceManager(); + + if (apiResourceManager == null) { + throw new IllegalStateException("APIResourceManager is not available from OSGi context."); + } + + SERVICE = new AuthorizationDetailsTypeManagementService(apiResourceManager, authorizationDetailsTypeManager); + } + + /** + * Get AuthorizationDetailsTypeManagementService instance. + * + * @return AuthorizationDetailsTypeManagementService. + */ + public static AuthorizationDetailsTypeManagementService getAuthorizationDetailsTypeManagementService() { + + return SERVICE; + } + +} diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/impl/ApiResourcesApiServiceImpl.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/impl/ApiResourcesApiServiceImpl.java index 7fcc6a78bd..9b6b58d013 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/impl/ApiResourcesApiServiceImpl.java +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/impl/ApiResourcesApiServiceImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2023-2025, 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 @@ -22,12 +22,16 @@ import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourcePatchModel; import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceResponse; import org.wso2.carbon.identity.api.server.api.resource.v1.ApiResourcesApiService; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesCreationModel; import org.wso2.carbon.identity.api.server.api.resource.v1.ScopeCreationModel; import org.wso2.carbon.identity.api.server.api.resource.v1.ScopePatchModel; import org.wso2.carbon.identity.api.server.api.resource.v1.constants.APIResourceMgtEndpointConstants; +import org.wso2.carbon.identity.api.server.api.resource.v1.core.AuthorizationDetailsTypeManagementService; import org.wso2.carbon.identity.api.server.api.resource.v1.core.ServerAPIResourceManagementService; +import org.wso2.carbon.identity.api.server.api.resource.v1.factories.AuthorizationDetailsTypeManagementServiceFactory; import org.wso2.carbon.identity.api.server.api.resource.v1.factories.ServerAPIResourceManagementServiceFactory; import org.wso2.carbon.identity.api.server.common.ContextLoader; +import org.wso2.carbon.identity.application.common.model.AuthorizationDetailsType; import java.net.URI; import java.util.List; @@ -42,12 +46,15 @@ public class ApiResourcesApiServiceImpl implements ApiResourcesApiService { private final ServerAPIResourceManagementService serverAPIResourceManagementService; + private final AuthorizationDetailsTypeManagementService typeMgtService; public ApiResourcesApiServiceImpl() { try { this.serverAPIResourceManagementService = ServerAPIResourceManagementServiceFactory .getServerAPIResourceManagementService(); + this.typeMgtService = AuthorizationDetailsTypeManagementServiceFactory + .getAuthorizationDetailsTypeManagementService(); } catch (IllegalStateException e) { throw new RuntimeException("Error occurred while initiating API resource management service.", e); } @@ -63,6 +70,15 @@ public Response addAPIResource(APIResourceCreationModel apIResourceCreationModel return Response.created(location).entity(apiResourceResponse).build(); } + @Override + public Response addAuthorizationDetailsTypes( + String apiResourceId, List authorizationDetailsTypesCreationModel) { + + List authorizationDetailsTypes = + typeMgtService.addAuthorizationDetailsTypes(apiResourceId, authorizationDetailsTypesCreationModel); + return Response.ok().entity(authorizationDetailsTypes).build(); + } + @Override public Response apiResourcesApiResourceIdDelete(String apiResourceId) { @@ -113,10 +129,38 @@ public Response apiResourcesApiResourceIdScopesScopeNamePatch(String apiResource return Response.noContent().build(); } + @Override + public Response deleteAuthorizationDetailsType(String apiResourceId, String authorizationDetailsTypeId) { + + typeMgtService.deleteAuthorizationDetailsTypeById(apiResourceId, authorizationDetailsTypeId); + return Response.noContent().build(); + } + @Override public Response getAPIResources(String before, String after, String filter, Integer limit, String attributes) { return Response.ok().entity(serverAPIResourceManagementService.getAPIResources(before, after, filter, limit, attributes)).build(); } + + @Override + public Response getAuthorizationDetailsType(String apiResourceId, String authorizationDetailsTypeId) { + + return Response.ok().entity(typeMgtService + .getAuthorizationDetailsTypeById(apiResourceId, authorizationDetailsTypeId)).build(); + } + + @Override + public Response getAuthorizationDetailsTypes(String apiResourceId) { + + return Response.ok().entity(typeMgtService.getAuthorizationDetailsTypes(apiResourceId)).build(); + } + + @Override + public Response updateAuthorizationDetailsType(String apiResourceId, String authorizationDetailsTypeId, + AuthorizationDetailsTypesCreationModel creationModel) { + + typeMgtService.updateAuthorizationDetailsTypes(apiResourceId, authorizationDetailsTypeId, creationModel); + return Response.noContent().build(); + } } diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/impl/AuthorizationDetailsTypesApiServiceImpl.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/impl/AuthorizationDetailsTypesApiServiceImpl.java new file mode 100644 index 0000000000..ff30b2e6b3 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/impl/AuthorizationDetailsTypesApiServiceImpl.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2025, 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.api.resource.v1.impl; + +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesApiService; +import org.wso2.carbon.identity.api.server.api.resource.v1.core.AuthorizationDetailsTypeManagementService; +import org.wso2.carbon.identity.api.server.api.resource.v1.factories.AuthorizationDetailsTypeManagementServiceFactory; + +import javax.ws.rs.core.Response; + +import static javax.ws.rs.core.Response.Status.NOT_FOUND; + +/** + * Implementation of the Authorization details types REST Api. + */ +public class AuthorizationDetailsTypesApiServiceImpl implements AuthorizationDetailsTypesApiService { + + private final AuthorizationDetailsTypeManagementService typeMgtService; + + public AuthorizationDetailsTypesApiServiceImpl() { + + try { + this.typeMgtService = AuthorizationDetailsTypeManagementServiceFactory + .getAuthorizationDetailsTypeManagementService(); + } catch (IllegalStateException e) { + throw new RuntimeException("Error occurred while initiating AuthorizationDetailsTypeManagementService.", e); + } + } + + @Override + public Response authorizationDetailsTypesGet(String filter) { + + return Response.ok().entity(typeMgtService.getAllAuthorizationDetailsTypes(filter)).build(); + } + + @Override + public Response isAuthorizationDetailsTypeExists(final String filter) { + + return typeMgtService.isAuthorizationDetailsTypeExists(filter) + ? Response.ok().build() + : Response.status(NOT_FOUND).build(); + } +} diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/util/AuthorizationDetailsTypeMgtUtil.java b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/util/AuthorizationDetailsTypeMgtUtil.java new file mode 100644 index 0000000000..00e591a7c1 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/java/org/wso2/carbon/identity/api/server/api/resource/v1/util/AuthorizationDetailsTypeMgtUtil.java @@ -0,0 +1,175 @@ +/* + * 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.api.resource.v1.util; + +import org.apache.commons.collections.MapUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.json.JSONObject; +import org.wso2.carbon.identity.api.resource.mgt.APIResourceMgtClientException; +import org.wso2.carbon.identity.api.server.api.resource.common.APIResourceManagementServiceHolder; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesCreationModel; +import org.wso2.carbon.identity.api.server.api.resource.v1.AuthorizationDetailsTypesGetModel; +import org.wso2.carbon.identity.application.common.model.AuthorizationDetailsType; +import org.wso2.carbon.identity.oauth.rar.exception.AuthorizationDetailsProcessingException; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static org.wso2.carbon.identity.api.server.api.resource.v1.constants.APIResourceMgtEndpointConstants.ErrorMessage.ERROR_CODE_INVALID_AUTHORIZATION_DETAILS_SCHEMA; + +/** + * Utility class containing helper methods to handle authorization details types. + */ +public class AuthorizationDetailsTypeMgtUtil { + + private static final Log log = LogFactory.getLog(AuthorizationDetailsTypeMgtUtil.class); + + /** + * Converts a list of {@link AuthorizationDetailsType} to a list of {@link AuthorizationDetailsTypesGetModel}. + * + * @param authorizationDetailsTypes The list of {@link AuthorizationDetailsType} objects to convert. + * @return A list of {@link AuthorizationDetailsTypesGetModel} objects, or an empty list if the input is null. + */ + public static List toAuthorizationDetailsGetModels( + final List authorizationDetailsTypes) { + + if (authorizationDetailsTypes == null) { + return Collections.emptyList(); + } + return authorizationDetailsTypes.stream().map(AuthorizationDetailsTypeMgtUtil::toAuthorizationDetailsGetModel) + .collect(Collectors.toList()); + } + + /** + * Converts a {@link AuthorizationDetailsType} to a {@link AuthorizationDetailsTypesGetModel}. + * + * @param authorizationDetailsType The {@link AuthorizationDetailsType} object to convert. + * @return A {@link AuthorizationDetailsTypesGetModel} object. + */ + public static AuthorizationDetailsTypesGetModel toAuthorizationDetailsGetModel( + final AuthorizationDetailsType authorizationDetailsType) { + + return new AuthorizationDetailsTypesGetModel() + .id(authorizationDetailsType.getId()) + .name(authorizationDetailsType.getName()) + .description(authorizationDetailsType.getDescription()) + .type(authorizationDetailsType.getType()) + .schema(authorizationDetailsType.getSchema()); + } + + /** + * Converts a list of {@link AuthorizationDetailsTypesCreationModel} to a list of {@link AuthorizationDetailsType}. + * + * @param creationModels The list of {@link AuthorizationDetailsTypesCreationModel} objects to convert. + * @return A list of {@link AuthorizationDetailsType} objects, or an empty list if the input is null. + */ + public static List toAuthorizationDetailsTypes( + final List creationModels) throws APIResourceMgtClientException { + + if (creationModels == null) { + return Collections.emptyList(); + } + + List authorizationDetailsTypes = new ArrayList<>(); + for (AuthorizationDetailsTypesCreationModel creationModel : creationModels) { + authorizationDetailsTypes.add(toAuthorizationDetailsType(creationModel)); + } + return authorizationDetailsTypes; + } + + /** + * Converts a {@link AuthorizationDetailsTypesCreationModel} to a {@link AuthorizationDetailsType}. + * + * @param creationModel The {@link AuthorizationDetailsTypesCreationModel} object to convert. + * @return A {@link AuthorizationDetailsType} object. + */ + public static AuthorizationDetailsType toAuthorizationDetailsType( + final AuthorizationDetailsTypesCreationModel creationModel) throws APIResourceMgtClientException { + + final AuthorizationDetailsType authorizationDetailsType = new AuthorizationDetailsType(); + authorizationDetailsType.setType(creationModel.getType()); + authorizationDetailsType.setName(creationModel.getName()); + authorizationDetailsType.setDescription(creationModel.getDescription()); + + if (isValidSchema(creationModel.getSchema())) { + authorizationDetailsType.setSchema(creationModel.getSchema()); + } + + return authorizationDetailsType; + } + + /** + * Converts a {@link AuthorizationDetailsTypesCreationModel} to a {@link AuthorizationDetailsType}. + * + * @param authorizationDetailsTypeId The authorization details type ID. + * @param creationModel The {@link AuthorizationDetailsTypesCreationModel} object to convert. + * @return A {@link AuthorizationDetailsType} object. + */ + public static AuthorizationDetailsType toAuthorizationDetailsType( + String authorizationDetailsTypeId, AuthorizationDetailsTypesCreationModel creationModel) + throws APIResourceMgtClientException { + + final AuthorizationDetailsType authorizationDetailsType = toAuthorizationDetailsType(creationModel); + authorizationDetailsType.setId(authorizationDetailsTypeId); + return authorizationDetailsType; + } + + /** + * Validates and creates a JSON schema from the given input map. + * + * @param schema A map representing the input schema to be validated. + * @return A JSON string of the validated schema. + * @throws APIResourceMgtClientException if the schema is empty or invalid. + */ + private static boolean isValidSchema(Map schema) throws APIResourceMgtClientException { + + if (MapUtils.isEmpty(schema)) { + throwAPIResourceMgtClientException("Authorization details schema cannot be empty."); + } + + try { + if (APIResourceManagementServiceHolder.getAuthorizationDetailsSchemaValidator() + .isValidSchema(new JSONObject(schema).toString())) { + return true; + } + + throwAPIResourceMgtClientException("Invalid authorization details schema received."); + } catch (AuthorizationDetailsProcessingException e) { + log.debug(ERROR_CODE_INVALID_AUTHORIZATION_DETAILS_SCHEMA.getMessage(), e); + throwAPIResourceMgtClientException(e.getMessage()); + } + return false; + } + + private static void throwAPIResourceMgtClientException(final String message) throws APIResourceMgtClientException { + + throw new APIResourceMgtClientException( + ERROR_CODE_INVALID_AUTHORIZATION_DETAILS_SCHEMA.getMessage(), + String.format(ERROR_CODE_INVALID_AUTHORIZATION_DETAILS_SCHEMA.getDescription(), message), + ERROR_CODE_INVALID_AUTHORIZATION_DETAILS_SCHEMA.getCode()); + } + + private AuthorizationDetailsTypeMgtUtil() { + // Adding a private constructor to hide the implicit public one. + } +} diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/resources/APIResources.yaml b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/resources/APIResources.yaml index 28b8c10e5f..1dcf4eb9d6 100644 --- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/resources/APIResources.yaml +++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/resources/APIResources.yaml @@ -444,6 +444,292 @@ paths: schema: $ref: '#/components/schemas/Error' + /api-resources/{apiResourceId}/authorization-details-types: + get: + tags: + - API Resource Authorization Details Types + description: | + This API is used to get all registered authorization details types. + + Permission required: + * /permission/admin/manage/identity/apiresourcemgt/view + + Scope required: + * internal_api_resource_view + summary: Lists all registered authorization details types + operationId: getAuthorizationDetailsTypes + parameters: + - $ref: '#/components/parameters/apiResourceId' + responses: + 200: + description: Successfully retrieved a list of authorization details types + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/AuthorizationDetailsTypesGetModel" + 401: + description: Unauthorized request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 404: + description: Requested resource is not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 500: + description: Encountered a server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + put: + tags: + - API Resource Authorization Details Types + description: | + This API is used to add a new authorization details type to API resource. + + Permission required: + * /permission/admin/manage/identity/apiresourcemgt/update + + Scope required: + * internal_api_resource_update + summary: Adds new authorization details types to the API resource + operationId: addAuthorizationDetailsTypes + parameters: + - $ref: '#/components/parameters/apiResourceId' + requestBody: + content: + "application/json": + schema: + type: array + items: + $ref: "#/components/schemas/AuthorizationDetailsTypesCreationModel" + responses: + 200: + description: Successfully added a list of authorization details types + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/AuthorizationDetailsTypesGetModel" + 401: + description: Unauthorized request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 404: + description: Requested resource is not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 500: + description: Encountered a server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /api-resources/{apiResourceId}/authorization-details-types/{authorizationDetailsTypeId}: + get: + tags: + - API Resource Authorization Details Types + description: | + This API is used to retrieve details of a registered authorization details type by a given type ID. + + Permission required: + * /permission/admin/manage/identity/apiresourcemgt/view + + Scope required: + * internal_api_resource_view + summary: Returns a registered authorization details type by type ID + operationId: getAuthorizationDetailsType + parameters: + - $ref: '#/components/parameters/apiResourceId' + - $ref: '#/components/parameters/authorizationDetailsTypeId' + responses: + 200: + description: Successfully retrieved an authorization details type by type ID + content: + application/json: + schema: + $ref: "#/components/schemas/AuthorizationDetailsTypesGetModel" + 401: + description: Unauthorized request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 404: + description: Requested resource is not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 500: + description: Encountered a server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + patch: + tags: + - API Resource Authorization Details Types + description: | + This API is used to update a registered authorization details type by a given type ID. + + Permission required: + * /permission/admin/manage/identity/apiresourcemgt/update + + Scope required: + * internal_api_resource_update + summary: Updates a registered authorization details type by type ID + operationId: updateAuthorizationDetailsType + parameters: + - $ref: '#/components/parameters/apiResourceId' + - $ref: '#/components/parameters/authorizationDetailsTypeId' + requestBody: + content: + "application/json": + schema: + $ref: "#/components/schemas/AuthorizationDetailsTypesCreationModel" + responses: + 204: + description: No Content + 401: + description: Unauthorized request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 404: + description: Requested resource is not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 500: + description: Encountered a server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + delete: + tags: + - API Resource Authorization Details Types + description: | + This API is used to delete a registered authorization details type by a given type ID. + + Permission required: + * /permission/admin/manage/identity/apiresourcemgt/delete + + Scope required: + * internal_api_resource_delete + summary: Deletes a registered authorization details type by type ID + operationId: deleteAuthorizationDetailsType + parameters: + - $ref: '#/components/parameters/apiResourceId' + - $ref: '#/components/parameters/authorizationDetailsTypeId' + responses: + 204: + description: Successfully deleted an authorization details type by type ID + 401: + description: Unauthorized request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 500: + description: Encountered a server error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /authorization-details-types: + get: + tags: + - API Resource Authorization Details Types + summary: Gets all authorization details types in the tenant + description: > + Get all authorization details types in the tenant + Permission required:
+ * /permission/admin/manage/identity/apiresourcemgt/view
+ Scope required:
+ * internal_api_resource_view + parameters: + - name: filter + in: query + required: false + description: | + Condition to filter the retrieval of records. Supports 'sw', 'co', 'ew' and 'eq' operations. + schema: + type: string + example: type+eq+payment_initiation + responses: + 200: + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AuthorizationDetailsTypesGetModel' + 401: + description: Unauthorized + 403: + description: Forbidden + 404: + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + 500: + description: Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + head: + tags: + - API Resource Authorization Details Types + description: | + This API is used to check a registered authorization details type's existence using a given type in the tenant. + + Permission required: + * /permission/admin/manage/identity/apiresourcemgt/view + + Scope required: + * internal_api_resource_view + summary: Checks an authorization details type existence by type in the tenant + operationId: isAuthorizationDetailsTypeExists + parameters: + - name: filter + in: query + required: true + description: | + Condition to filter the retrieval of records. Supports 'sw', 'co', 'ew' and 'eq' operations. + schema: + type: string + example: type+eq+payment_initiation + responses: + 200: + description: Provided authorization details type exists + 401: + description: Unauthorized request + 404: + description: Requested resource is not found + 500: + description: Encountered a server error + /meta/api-resource-collections: get: tags: @@ -628,6 +914,15 @@ components: schema: type: string + authorizationDetailsTypeId: + name: authorizationDetailsTypeId + in: path + description: The ID of the authorization details type that is to be retrieved + required: true + schema: + type: string + example: a9403470-dd11-46b4-8db9-aaa31f1d4423 + schemas: Error: type: object @@ -706,6 +1001,10 @@ components: type: array items: $ref: '#/components/schemas/ScopeGetModel' + authorizationDetailsTypes: + type: array + items: + $ref: '#/components/schemas/AuthorizationDetailsTypesGetModel' subscribedApplications: type: array items: @@ -740,6 +1039,10 @@ components: type: array items: $ref: '#/components/schemas/ScopeCreationModel' + authorizationDetailsTypes: + type: array + items: + $ref: '#/components/schemas/AuthorizationDetailsTypesCreationModel' APIResourcePatchModel: type: object @@ -759,6 +1062,14 @@ components: items: type: string description: This field is not supported yet. + addedAuthorizationDetailsTypes: + type: array + items: + $ref: '#/components/schemas/AuthorizationDetailsTypesCreationModel' + removedAuthorizationDetailsTypes: + type: array + items: + type: string PaginationLink: type: object @@ -960,6 +1271,84 @@ components: type: string example: "Internal" + AuthorizationDetailsTypesCreationModel: + type: object + required: + - type + - name + - description + - schema + properties: + type: + type: string + example: payment_initiation + description: an unique type of the authorization details type + minLength: 1 + maxLength: 255 + name: + type: string + minLength: 3 + maxLength: 255 + description: display name of the authorization details type + example: Payment Initiation + description: + type: string + description: description of the authorization details type + example: Payment initiation authorization details type + schema: + type: object + additionalProperties: true + description: Accepts the [JSON Schema document](https://json-schema.org/draft/2020-12/json-schema-core#name-json-schema-documents) of the authorization details type + example: + type: object + required: + - type + - actions + - locations + - instructedAmount + properties: + type: + type: string + enum: + - payment_initiation + actions: + type: array + items: + type: string + enum: + - initiate + - cancel + locations: + type: array + items: + type: string + format: uri + instructedAmount: + type: object + properties: + currency: + type: string + minLength: 3 + amount: + type: string + creditorName: string + creditorAccount: + type: object + + AuthorizationDetailsTypesGetModel: + allOf: + - type: object + required: + - id + properties: + id: + type: string + example: a9403470-dd11-46b4-8db9-aaa31f1d4423 + description: an unique id of the registered authorization details type + minLength: 36 + maxLength: 36 + - $ref: "#/components/schemas/AuthorizationDetailsTypesCreationModel" + responses: BadRequest: description: Bad Request. Invalid request or validation error. diff --git a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.common/src/main/java/org/wso2/carbon/identity/api/server/application/management/common/ApplicationManagementConstants.java b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.common/src/main/java/org/wso2/carbon/identity/api/server/application/management/common/ApplicationManagementConstants.java index 75e9751852..08bc7665ea 100644 --- a/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.common/src/main/java/org/wso2/carbon/identity/api/server/application/management/common/ApplicationManagementConstants.java +++ b/components/org.wso2.carbon.identity.api.server.application.management/org.wso2.carbon.identity.api.server.application.management.common/src/main/java/org/wso2/carbon/identity/api/server/application/management/common/ApplicationManagementConstants.java @@ -179,6 +179,10 @@ public enum ErrorMessage { "Hybrid flow response type is incorrect.", "The response type for the hybrid flow should be either 'code token' or 'code id_token' or " + "'code id_token token'"), + AUTHORIZATION_DETAILS_TYPES_NOT_FOUND("60519", + "API authorization details types not found.", + "One or more authorization detail types in the request were not found for the " + + "API resource with ID '%s' in the tenant domain '%s'."), // Server Errors. ERROR_RETRIEVING_SAML_METADATA("65001", 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/AuthorizedAPICreationModel.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/AuthorizedAPICreationModel.java index f536b29b7a..ef253cd2f9 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/AuthorizedAPICreationModel.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/AuthorizedAPICreationModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, 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 @@ -38,6 +38,8 @@ public class AuthorizedAPICreationModel { private String policyIdentifier; private List scopes = null; + private List authorizationDetailsTypes = null; + /** **/ @@ -101,6 +103,32 @@ public AuthorizedAPICreationModel addScopesItem(String scopesItem) { return this; } + /** + **/ + public AuthorizedAPICreationModel authorizationDetailsTypes(List authorizationDetailsTypes) { + + this.authorizationDetailsTypes = authorizationDetailsTypes; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("authorizationDetailsTypes") + @Valid + public List getAuthorizationDetailsTypes() { + return authorizationDetailsTypes; + } + public void setAuthorizationDetailsTypes(List authorizationDetailsTypes) { + this.authorizationDetailsTypes = authorizationDetailsTypes; + } + + public AuthorizedAPICreationModel addAuthorizationDetailsTypesItem(String authorizationDetailsTypesItem) { + if (this.authorizationDetailsTypes == null) { + this.authorizationDetailsTypes = new ArrayList<>(); + } + this.authorizationDetailsTypes.add(authorizationDetailsTypesItem); + return this; + } + @Override @@ -115,12 +143,13 @@ public boolean equals(java.lang.Object o) { AuthorizedAPICreationModel authorizedAPICreationModel = (AuthorizedAPICreationModel) o; return Objects.equals(this.id, authorizedAPICreationModel.id) && Objects.equals(this.policyIdentifier, authorizedAPICreationModel.policyIdentifier) && - Objects.equals(this.scopes, authorizedAPICreationModel.scopes); + Objects.equals(this.scopes, authorizedAPICreationModel.scopes) && + Objects.equals(this.authorizationDetailsTypes, authorizedAPICreationModel.authorizationDetailsTypes); } @Override public int hashCode() { - return Objects.hash(id, policyIdentifier, scopes); + return Objects.hash(id, policyIdentifier, scopes, authorizationDetailsTypes); } @Override @@ -132,6 +161,7 @@ public String toString() { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" policyIdentifier: ").append(toIndentedString(policyIdentifier)).append("\n"); sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); + sb.append(" authorizationDetailsTypes: ").append(toIndentedString(authorizationDetailsTypes)).append("\n"); sb.append("}"); return sb.toString(); } 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/AuthorizedAPIPatchModel.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/AuthorizedAPIPatchModel.java index 5833456fb2..81d3d7c066 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/AuthorizedAPIPatchModel.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/AuthorizedAPIPatchModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, 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 @@ -38,6 +38,10 @@ public class AuthorizedAPIPatchModel { private List removedScopes = null; + private List addedAuthorizationDetailsTypes = null; + + private List removedAuthorizationDetailsTypes = null; + /** **/ @@ -91,6 +95,58 @@ public AuthorizedAPIPatchModel addRemovedScopesItem(String removedScopesItem) { return this; } + /** + **/ + public AuthorizedAPIPatchModel addedAuthorizationDetailsTypes(List addedAuthorizationDetailsTypes) { + + this.addedAuthorizationDetailsTypes = addedAuthorizationDetailsTypes; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("addedAuthorizationDetailsTypes") + @Valid + public List getAddedAuthorizationDetailsTypes() { + return addedAuthorizationDetailsTypes; + } + public void setAddedAuthorizationDetailsTypes(List addedAuthorizationDetailsTypes) { + this.addedAuthorizationDetailsTypes = addedAuthorizationDetailsTypes; + } + + public AuthorizedAPIPatchModel addAddedAuthorizationDetailsTypesItem(String addedAuthorizationDetailsTypesItem) { + if (this.addedAuthorizationDetailsTypes == null) { + this.addedAuthorizationDetailsTypes = new ArrayList<>(); + } + this.addedAuthorizationDetailsTypes.add(addedAuthorizationDetailsTypesItem); + return this; + } + + /** + **/ + public AuthorizedAPIPatchModel removedAuthorizationDetailsTypes(List removedAuthorizationDetailsTypes) { + + this.removedAuthorizationDetailsTypes = removedAuthorizationDetailsTypes; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("removedAuthorizationDetailsTypes") + @Valid + public List getRemovedAuthorizationDetailsTypes() { + return removedAuthorizationDetailsTypes; + } + public void setRemovedAuthorizationDetailsTypes(List removedAuthorizationDetailsTypes) { + this.removedAuthorizationDetailsTypes = removedAuthorizationDetailsTypes; + } + + public AuthorizedAPIPatchModel addRemovedAuthorizationDetailsTypesItem(String removedAuthorizationDetailsTypesItem) { + if (this.removedAuthorizationDetailsTypes == null) { + this.removedAuthorizationDetailsTypes = new ArrayList<>(); + } + this.removedAuthorizationDetailsTypes.add(removedAuthorizationDetailsTypesItem); + return this; + } + @Override @@ -104,12 +160,14 @@ public boolean equals(java.lang.Object o) { } AuthorizedAPIPatchModel authorizedAPIPatchModel = (AuthorizedAPIPatchModel) o; return Objects.equals(this.addedScopes, authorizedAPIPatchModel.addedScopes) && - Objects.equals(this.removedScopes, authorizedAPIPatchModel.removedScopes); + Objects.equals(this.removedScopes, authorizedAPIPatchModel.removedScopes) && + Objects.equals(this.addedAuthorizationDetailsTypes, authorizedAPIPatchModel.addedAuthorizationDetailsTypes) && + Objects.equals(this.removedAuthorizationDetailsTypes, authorizedAPIPatchModel.removedAuthorizationDetailsTypes); } @Override public int hashCode() { - return Objects.hash(addedScopes, removedScopes); + return Objects.hash(addedScopes, removedScopes, addedAuthorizationDetailsTypes, removedAuthorizationDetailsTypes); } @Override @@ -120,6 +178,8 @@ public String toString() { sb.append(" addedScopes: ").append(toIndentedString(addedScopes)).append("\n"); sb.append(" removedScopes: ").append(toIndentedString(removedScopes)).append("\n"); + sb.append(" addedAuthorizationDetailsTypes: ").append(toIndentedString(addedAuthorizationDetailsTypes)).append("\n"); + sb.append(" removedAuthorizationDetailsTypes: ").append(toIndentedString(removedAuthorizationDetailsTypes)).append("\n"); sb.append("}"); return sb.toString(); } 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/AuthorizedAPIResponse.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/AuthorizedAPIResponse.java index c917280eb5..bfbdf5dc05 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/AuthorizedAPIResponse.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/AuthorizedAPIResponse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2025, 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 @@ -24,6 +24,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; +import org.wso2.carbon.identity.api.server.application.management.v1.AuthorizedAuthorizationDetailsTypes; import org.wso2.carbon.identity.api.server.application.management.v1.AuthorizedScope; import javax.validation.constraints.*; @@ -42,6 +43,8 @@ public class AuthorizedAPIResponse { private String type; private List authorizedScopes = null; + private List authorizedAuthorizationDetailsTypes = null; + /** **/ @@ -159,6 +162,32 @@ public AuthorizedAPIResponse addAuthorizedScopesItem(AuthorizedScope authorizedS return this; } + /** + **/ + public AuthorizedAPIResponse authorizedAuthorizationDetailsTypes(List authorizedAuthorizationDetailsTypes) { + + this.authorizedAuthorizationDetailsTypes = authorizedAuthorizationDetailsTypes; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("authorizedAuthorizationDetailsTypes") + @Valid + public List getAuthorizedAuthorizationDetailsTypes() { + return authorizedAuthorizationDetailsTypes; + } + public void setAuthorizedAuthorizationDetailsTypes(List authorizedAuthorizationDetailsTypes) { + this.authorizedAuthorizationDetailsTypes = authorizedAuthorizationDetailsTypes; + } + + public AuthorizedAPIResponse addAuthorizedAuthorizationDetailsTypesItem(AuthorizedAuthorizationDetailsTypes authorizedAuthorizationDetailsTypesItem) { + if (this.authorizedAuthorizationDetailsTypes == null) { + this.authorizedAuthorizationDetailsTypes = new ArrayList<>(); + } + this.authorizedAuthorizationDetailsTypes.add(authorizedAuthorizationDetailsTypesItem); + return this; + } + @Override @@ -176,12 +205,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(this.displayName, authorizedAPIResponse.displayName) && Objects.equals(this.policyId, authorizedAPIResponse.policyId) && Objects.equals(this.type, authorizedAPIResponse.type) && - Objects.equals(this.authorizedScopes, authorizedAPIResponse.authorizedScopes); + Objects.equals(this.authorizedScopes, authorizedAPIResponse.authorizedScopes) && + Objects.equals(this.authorizedAuthorizationDetailsTypes, authorizedAPIResponse.authorizedAuthorizationDetailsTypes); } @Override public int hashCode() { - return Objects.hash(id, identifier, displayName, policyId, type, authorizedScopes); + return Objects.hash(id, identifier, displayName, policyId, type, authorizedScopes, authorizedAuthorizationDetailsTypes); } @Override @@ -196,6 +226,7 @@ public String toString() { sb.append(" policyId: ").append(toIndentedString(policyId)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" authorizedScopes: ").append(toIndentedString(authorizedScopes)).append("\n"); + sb.append(" authorizedAuthorizationDetailsTypes: ").append(toIndentedString(authorizedAuthorizationDetailsTypes)).append("\n"); sb.append("}"); return sb.toString(); } 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/AuthorizedAuthorizationDetailsTypes.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/AuthorizedAuthorizationDetailsTypes.java new file mode 100644 index 0000000000..6a9bdb2bf3 --- /dev/null +++ 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/AuthorizedAuthorizationDetailsTypes.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2025, 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.application.management.v1; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; +import javax.validation.Valid; +import javax.xml.bind.annotation.*; + +public class AuthorizedAuthorizationDetailsTypes { + + private String id; + private String type; + private String name; + + /** + * an unique id of the registered authorization details type + **/ + public AuthorizedAuthorizationDetailsTypes id(String id) { + + this.id = id; + return this; + } + + @ApiModelProperty(example = "a9403470-dd11-46b4-8db9-aaa31f1d4423", value = "an unique id of the registered authorization details type") + @JsonProperty("id") + @Valid + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + /** + * an unique type of the authorization details type + **/ + public AuthorizedAuthorizationDetailsTypes type(String type) { + + this.type = type; + return this; + } + + @ApiModelProperty(example = "payment_initiation", required = true, value = "an unique type of the authorization details type") + @JsonProperty("type") + @Valid + @NotNull(message = "Property type cannot be null.") + + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + + /** + * display name of the authorization details type + **/ + public AuthorizedAuthorizationDetailsTypes name(String name) { + + this.name = name; + return this; + } + + @ApiModelProperty(example = "Payment Initiation", required = true, value = "display name of the authorization details type") + @JsonProperty("name") + @Valid + @NotNull(message = "Property name cannot be null.") + @Size(min=3,max=255) + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + + @Override + public boolean equals(java.lang.Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthorizedAuthorizationDetailsTypes authorizedAuthorizationDetailsTypes = (AuthorizedAuthorizationDetailsTypes) o; + return Objects.equals(this.id, authorizedAuthorizationDetailsTypes.id) && + Objects.equals(this.type, authorizedAuthorizationDetailsTypes.type) && + Objects.equals(this.name, authorizedAuthorizationDetailsTypes.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, name); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class AuthorizedAuthorizationDetailsTypes {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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.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 716144246f..d9caabb02b 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2024, WSO2 LLC. (http://www.wso2.com). + * Copyright (c) 2019-2025, 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 @@ -51,6 +51,7 @@ import org.wso2.carbon.identity.api.server.application.management.v1.AuthorizedAPICreationModel; import org.wso2.carbon.identity.api.server.application.management.v1.AuthorizedAPIPatchModel; import org.wso2.carbon.identity.api.server.application.management.v1.AuthorizedAPIResponse; +import org.wso2.carbon.identity.api.server.application.management.v1.AuthorizedAuthorizationDetailsTypes; import org.wso2.carbon.identity.api.server.application.management.v1.AuthorizedScope; import org.wso2.carbon.identity.api.server.application.management.v1.ConfiguredAuthenticator; import org.wso2.carbon.identity.api.server.application.management.v1.ConfiguredAuthenticatorsModal; @@ -93,6 +94,7 @@ import org.wso2.carbon.identity.application.common.model.APIResource; import org.wso2.carbon.identity.application.common.model.ApplicationBasicInfo; import org.wso2.carbon.identity.application.common.model.AuthenticationStep; +import org.wso2.carbon.identity.application.common.model.AuthorizationDetailsType; import org.wso2.carbon.identity.application.common.model.AuthorizedAPI; import org.wso2.carbon.identity.application.common.model.FederatedAuthenticatorConfig; import org.wso2.carbon.identity.application.common.model.IdentityProvider; @@ -157,8 +159,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.HashSet; import java.util.List; +import java.util.Optional; import java.util.Set; import java.util.function.BiFunction; import java.util.function.Function; @@ -1452,6 +1456,8 @@ public void addAuthorizedAPI(String applicationId, AuthorizedAPICreationModel au throw buildClientError(ErrorMessage.API_RESOURCE_NOT_FOUND, authorizedAPIId, tenantDomain); } validateAPIResourceScopes(apiResource, authorizedAPICreationModel.getScopes()); + this.validateAPIResourceAuthorizationDetailsTypes(apiResource, + authorizedAPICreationModel.getAuthorizationDetailsTypes()); // Validate policy identifier. String policyIdentifier = validatePolicy(authorizedAPICreationModel.getPolicyIdentifier()); @@ -1468,8 +1474,8 @@ public void addAuthorizedAPI(String applicationId, AuthorizedAPICreationModel au .appId(applicationId) .apiId(authorizedAPIId) .policyId(policyIdentifier) - .scopes(authorizedAPICreationModel.getScopes().stream().map( - scope -> new Scope.ScopeBuilder().name(scope).build()).collect(Collectors.toList())) + .scopes(getScopes(authorizedAPICreationModel)) + .authorizationDetailsTypes(getAuthorizationDetailsTypes(authorizedAPICreationModel)) .build(), tenantDomain); } catch (IdentityApplicationManagementException e) { String msg = "Error adding authorized API with id: " + authorizedAPICreationModel.getId() + @@ -1513,10 +1519,21 @@ public void updateAuthorizedAPI(String applicationId, String apiId, String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); // Validate added scopes and removed scopes sent in the authorized API patch model. - List addedScopes = authorizedAPIPatchModel.getAddedScopes(); - List removedScopes = authorizedAPIPatchModel.getRemovedScopes(); + List addedScopes = Optional.ofNullable(authorizedAPIPatchModel.getAddedScopes()) + .orElse(Collections.emptyList()); + List removedScopes = Optional.ofNullable(authorizedAPIPatchModel.getRemovedScopes()) + .orElse(Collections.emptyList()); addedScopes.removeAll(removedScopes); + // Validate added and removed authorization details types + List addedAuthorizationDetailsTypes = + Optional.ofNullable(authorizedAPIPatchModel.getAddedAuthorizationDetailsTypes()) + .orElse(Collections.emptyList()); + List removedAuthorizationDetailsTypes = + Optional.ofNullable(authorizedAPIPatchModel.getRemovedAuthorizationDetailsTypes()) + .orElse(Collections.emptyList()); + addedAuthorizationDetailsTypes.removeAll(removedAuthorizationDetailsTypes); + // Validate authorized API patch model. APIResource apiResource = ApplicationManagementServiceHolder.getApiResourceManager() .getAPIResourceById(apiId, tenantDomain); @@ -1524,6 +1541,7 @@ public void updateAuthorizedAPI(String applicationId, String apiId, throw buildClientError(ErrorMessage.API_RESOURCE_NOT_FOUND, apiId, tenantDomain); } validateAPIResourceScopes(apiResource, addedScopes); + validateAPIResourceAuthorizationDetailsTypes(apiResource, addedAuthorizationDetailsTypes); // Remove already authorized scopes from the added scopes list. AuthorizedAPI currentAuthorizedAPI = authorizedAPIManagementService.getAuthorizedAPI(applicationId, @@ -1535,9 +1553,15 @@ public void updateAuthorizedAPI(String applicationId, String apiId, addedScopes.removeIf(scopeName -> currentAuthorizedAPI.getScopes().stream().anyMatch(scope -> scope.getName().equals(scopeName))); } + if (CollectionUtils.isNotEmpty(currentAuthorizedAPI.getAuthorizationDetailsTypes())) { + + Set currentTypes = currentAuthorizedAPI.getAuthorizationDetailsTypes().stream() + .map(AuthorizationDetailsType::getType).collect(Collectors.toSet()); + addedAuthorizationDetailsTypes.removeIf(currentTypes::contains); + } authorizedAPIManagementService.patchAuthorizedAPI(applicationId, apiId, addedScopes, removedScopes, - tenantDomain); + addedAuthorizationDetailsTypes, removedAuthorizationDetailsTypes, tenantDomain); } catch (APIResourceMgtException e) { String msg = "Error while fetching API resource with id: " + apiId; throw Utils.buildServerError(msg, e); @@ -1570,6 +1594,9 @@ public List getAuthorizedAPIs(String applicationId) { .displayName(authorizedAPI.getAPIName()) .policyId(authorizedAPI.getPolicyId()) .type(authorizedAPI.getType()) + .authorizedAuthorizationDetailsTypes( + toAuthorizedAuthorizationDetailsTypes(authorizedAPI.getAuthorizationDetailsTypes()) + ) .authorizedScopes(createAuthorizedScope(authorizedAPI.getScopes()))); } return authorizedAPIResponses; @@ -2071,4 +2098,63 @@ private void blockRenameAppsToSystemReservedApps(String newAppName, String oldAp throw buildClientError(BLOCK_RENAME_APP_NAME_TO_RESERVED_APP_NAME, newAppName); } } + + private void validateAPIResourceAuthorizationDetailsTypes(APIResource apiResource, List requestedTypes) { + + if (apiResource == null || CollectionUtils.isEmpty(apiResource.getAuthorizationDetailsTypes()) + || CollectionUtils.isEmpty(requestedTypes)) { + return; + } + + final Set existingTypes = apiResource.getAuthorizationDetailsTypes().stream() + .map(AuthorizationDetailsType::getType) + .collect(Collectors.toSet()); + + for (String requestedType : requestedTypes) { + if (!existingTypes.contains(requestedType)) { + throw buildClientError(ErrorMessage.AUTHORIZATION_DETAILS_TYPES_NOT_FOUND, apiResource.getId(), + CarbonContext.getThreadLocalCarbonContext().getTenantDomain()); + } + } + } + + private List getAuthorizationDetailsTypes(AuthorizedAPICreationModel creationModel) { + + if (CollectionUtils.isEmpty(creationModel.getAuthorizationDetailsTypes())) { + return null; + } + + return creationModel.getAuthorizationDetailsTypes().stream() + .map(type -> new AuthorizationDetailsType.AuthorizationDetailsTypesBuilder().type(type).build()) + .collect(Collectors.toList()); + } + + private AuthorizedAuthorizationDetailsTypes toAuthorizedAuthorizationDetailsType(AuthorizationDetailsType type) { + + return (type == null) ? null + : new AuthorizedAuthorizationDetailsTypes().id(type.getId()).type(type.getType()).name(type.getName()); + } + + private List toAuthorizedAuthorizationDetailsTypes( + List authorizationDetailsTypes) { + + if (CollectionUtils.isEmpty(authorizationDetailsTypes)) { + return null; + } + + return authorizationDetailsTypes.stream() + .map(this::toAuthorizedAuthorizationDetailsType) + .collect(Collectors.toList()); + } + + private List getScopes(AuthorizedAPICreationModel creationModel) { + + if (CollectionUtils.isEmpty(creationModel.getScopes())) { + return null; + } + + return creationModel.getScopes().stream() + .map(scope -> new Scope.ScopeBuilder().name(scope).build()) + .collect(Collectors.toList()); + } } 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 57478ba6b2..7f49b68560 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 @@ -4401,6 +4401,10 @@ components: type: array items: $ref: '#/components/schemas/AuthorizedScope' + authorizedAuthorizationDetailsTypes: + type: array + items: + $ref: '#/components/schemas/AuthorizedAuthorizationDetailsTypes' AuthorizedScope: type: object @@ -4415,6 +4419,27 @@ components: type: string example: Read Bookings + AuthorizedAuthorizationDetailsTypes: + type: object + required: + - type + - name + properties: + id: + type: string + example: a9403470-dd11-46b4-8db9-aaa31f1d4423 + description: an unique id of the registered authorization details type + type: + type: string + example: payment_initiation + description: an unique type of the authorization details type + name: + type: string + minLength: 3 + maxLength: 255 + description: display name of the authorization details type + example: Payment Initiation + AuthorizedAPICreationModel: type: object properties: @@ -4429,6 +4454,11 @@ components: items: type: string example: bookings:read + authorizationDetailsTypes: + type: array + items: + type: string + example: payment_initiation AuthorizedAPIPatchModel: type: object @@ -4443,6 +4473,16 @@ components: items: type: string example: bookings:view + addedAuthorizationDetailsTypes: + type: array + items: + type: string + example: payment_initiation + removedAuthorizationDetailsTypes: + type: array + items: + type: string + example: account_information ApplicationSharePOSTRequest: type: object diff --git a/pom.xml b/pom.xml index 25e7a3dfcd..6b69a0b9a5 100644 --- a/pom.xml +++ b/pom.xml @@ -676,6 +676,12 @@ ${project.version} provided + + org.wso2.carbon.identity.inbound.auth.oauth2 + org.wso2.carbon.identity.oauth.rar + ${identity.inbound.oauth2.version} + provided + org.apache.felix org.apache.felix.scr.ds-annotations @@ -827,12 +833,12 @@ 1.4 1.2.4 1.11.27 - 7.7.95 + 7.7.130 3.0.5 1.12.0 **/gen/**/* 1.9.34 - 7.0.169 + 7.0.224 5.11.44 1.9.4 findbugs-exclude-filter.xml