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 8623e22ea3..89431e3e7a 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.oauth
provided
+
+ org.wso2.carbon.identity.framework
+ org.wso2.carbon.identity.api.resource.collection.mgt
+ 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 01042f8d08..005b76a655 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
@@ -18,6 +18,7 @@
package org.wso2.carbon.identity.api.server.api.resource.common;
+import org.wso2.carbon.identity.api.resource.collection.mgt.APIResourceCollectionManager;
import org.wso2.carbon.identity.api.resource.mgt.APIResourceManager;
import org.wso2.carbon.identity.oauth.OAuthAdminServiceImpl;
@@ -27,6 +28,7 @@
public class APIResourceManagementServiceHolder {
private static APIResourceManager apiResourceManager;
+ private static APIResourceCollectionManager apiResourceCollectionManager;
private static OAuthAdminServiceImpl oAuthAdminServiceImpl;
/**
@@ -49,6 +51,26 @@ public static void setApiResourceManager(APIResourceManager apiResourceManager)
APIResourceManagementServiceHolder.apiResourceManager = apiResourceManager;
}
+ /**
+ * Get APIResourceCollectionManager osgi service.
+ *
+ * @return APIResourceCollectionManager.
+ */
+ public static APIResourceCollectionManager getApiResourceCollectionManager() {
+
+ return apiResourceCollectionManager;
+ }
+
+ /**
+ * Set APIResourceCollectionManager osgi service.
+ *
+ * @param apiResourceCollectionManager APIResourceCollectionManager.
+ */
+ public static void setApiResourceCollectionManager(APIResourceCollectionManager apiResourceCollectionManager) {
+
+ APIResourceManagementServiceHolder.apiResourceCollectionManager = apiResourceCollectionManager;
+ }
+
/**
* Get OAuthAdminServiceImpl instance.
*
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 5539be6746..a946279e16 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
@@ -97,6 +97,11 @@
org.wso2.carbon.identity.api.resource.mgt
provided
+
+ org.wso2.carbon.identity.framework
+ org.wso2.carbon.identity.api.resource.collection.mgt
+ provided
+
org.wso2.carbon.identity.server.api
org.wso2.carbon.identity.api.server.common
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/APIResourceCollectionItem.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/APIResourceCollectionItem.java
new file mode 100644
index 0000000000..e06a9f54f3
--- /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/APIResourceCollectionItem.java
@@ -0,0 +1,237 @@
+/*
+ * Copyright (c) 2023, 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 io.swagger.annotations.ApiModelProperty;
+import java.util.ArrayList;
+import java.util.List;
+import javax.validation.constraints.*;
+
+
+import java.util.Objects;
+import javax.validation.Valid;
+
+public class APIResourceCollectionItem {
+
+ private String id;
+ private String name;
+ private String description;
+ private String identifier;
+ private String type;
+ private List scopes = null;
+
+ private String self;
+
+ /**
+ **/
+ public APIResourceCollectionItem id(String id) {
+
+ this.id = id;
+ return this;
+ }
+
+ @ApiModelProperty(example = "gh43-jk34-vb34-df67", required = true, value = "")
+ @JsonProperty("id")
+ @Valid
+ @NotNull(message = "Property id cannot be null.")
+
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionItem name(String name) {
+
+ this.name = name;
+ return this;
+ }
+
+ @ApiModelProperty(example = "Greetings API", required = true, value = "")
+ @JsonProperty("name")
+ @Valid
+ @NotNull(message = "Property name cannot be null.")
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionItem description(String description) {
+
+ this.description = description;
+ return this;
+ }
+
+ @ApiModelProperty(example = "Greeting API representation", value = "")
+ @JsonProperty("description")
+ @Valid
+ public String getDescription() {
+ return description;
+ }
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionItem identifier(String identifier) {
+
+ this.identifier = identifier;
+ return this;
+ }
+
+ @ApiModelProperty(example = "greetings_api", value = "")
+ @JsonProperty("identifier")
+ @Valid
+ public String getIdentifier() {
+ return identifier;
+ }
+ public void setIdentifier(String identifier) {
+ this.identifier = identifier;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionItem type(String type) {
+
+ this.type = type;
+ return this;
+ }
+
+ @ApiModelProperty(example = "SYSTEM", value = "")
+ @JsonProperty("type")
+ @Valid
+ public String getType() {
+ return type;
+ }
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionItem scopes(List scopes) {
+
+ this.scopes = scopes;
+ return this;
+ }
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("scopes")
+ @Valid
+ public List getScopes() {
+ return scopes;
+ }
+ public void setScopes(List scopes) {
+ this.scopes = scopes;
+ }
+
+ public APIResourceCollectionItem addScopesItem(ScopeGetModel scopesItem) {
+ if (this.scopes == null) {
+ this.scopes = new ArrayList();
+ }
+ this.scopes.add(scopesItem);
+ return this;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionItem self(String self) {
+
+ this.self = self;
+ return this;
+ }
+
+ @ApiModelProperty(example = "/t/carbon.super/api/server/v1/api-resources/eDUwOUNlcnRpZmljYXRlQXV0aGVudGljYXRvcg", required = true, value = "")
+ @JsonProperty("self")
+ @Valid
+ @NotNull(message = "Property self cannot be null.")
+
+ public String getSelf() {
+ return self;
+ }
+ public void setSelf(String self) {
+ this.self = self;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ APIResourceCollectionItem apIResourceCollectionItem = (APIResourceCollectionItem) o;
+ return Objects.equals(this.id, apIResourceCollectionItem.id) &&
+ Objects.equals(this.name, apIResourceCollectionItem.name) &&
+ Objects.equals(this.description, apIResourceCollectionItem.description) &&
+ Objects.equals(this.identifier, apIResourceCollectionItem.identifier) &&
+ Objects.equals(this.type, apIResourceCollectionItem.type) &&
+ Objects.equals(this.scopes, apIResourceCollectionItem.scopes) &&
+ Objects.equals(this.self, apIResourceCollectionItem.self);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, name, description, identifier, type, scopes, self);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class APIResourceCollectionItem {\n");
+
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" description: ").append(toIndentedString(description)).append("\n");
+ sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n");
+ sb.append(" self: ").append(toIndentedString(self)).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/APIResourceCollectionListItem.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/APIResourceCollectionListItem.java
new file mode 100644
index 0000000000..0ca53459b6
--- /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/APIResourceCollectionListItem.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2023, 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 APIResourceCollectionListItem {
+
+ private String id;
+ private String name;
+ private String displayName;
+ private String type;
+ private APIResourceMap apiResources;
+ private String self;
+
+ /**
+ **/
+ public APIResourceCollectionListItem id(String id) {
+
+ this.id = id;
+ return this;
+ }
+
+ @ApiModelProperty(example = "gh43-jk34-vb34-df67", required = true, value = "")
+ @JsonProperty("id")
+ @Valid
+ @NotNull(message = "Property id cannot be null.")
+
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionListItem name(String name) {
+
+ this.name = name;
+ return this;
+ }
+
+ @ApiModelProperty(example = "bulkUserImport", required = true, value = "")
+ @JsonProperty("name")
+ @Valid
+ @NotNull(message = "Property name cannot be null.")
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionListItem displayName(String displayName) {
+
+ this.displayName = displayName;
+ return this;
+ }
+
+ @ApiModelProperty(example = "Bulk User Import", required = true, value = "")
+ @JsonProperty("displayName")
+ @Valid
+ @NotNull(message = "Property displayName cannot be null.")
+
+ public String getDisplayName() {
+ return displayName;
+ }
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionListItem type(String type) {
+
+ this.type = type;
+ return this;
+ }
+
+ @ApiModelProperty(example = "SYSTEM", value = "")
+ @JsonProperty("type")
+ @Valid
+ public String getType() {
+ return type;
+ }
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionListItem apiResources(APIResourceMap apiResources) {
+
+ this.apiResources = apiResources;
+ return this;
+ }
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("apiResources")
+ @Valid
+ public APIResourceMap getApiResources() {
+ return apiResources;
+ }
+ public void setApiResources(APIResourceMap apiResources) {
+ this.apiResources = apiResources;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionListItem self(String self) {
+
+ this.self = self;
+ return this;
+ }
+
+ @ApiModelProperty(example = "/t/carbon.super/api/server/v1/api-resource-collections/eDUwOUNlcnRpZmljYXRlQXV0aGVudGljYXRvcg", required = true, value = "")
+ @JsonProperty("self")
+ @Valid
+ @NotNull(message = "Property self cannot be null.")
+
+ public String getSelf() {
+ return self;
+ }
+ public void setSelf(String self) {
+ this.self = self;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ APIResourceCollectionListItem apIResourceCollectionListItem = (APIResourceCollectionListItem) o;
+ return Objects.equals(this.id, apIResourceCollectionListItem.id) &&
+ Objects.equals(this.name, apIResourceCollectionListItem.name) &&
+ Objects.equals(this.displayName, apIResourceCollectionListItem.displayName) &&
+ Objects.equals(this.type, apIResourceCollectionListItem.type) &&
+ Objects.equals(this.apiResources, apIResourceCollectionListItem.apiResources) &&
+ Objects.equals(this.self, apIResourceCollectionListItem.self);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, name, displayName, type, apiResources, self);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class APIResourceCollectionListItem {\n");
+
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" apiResources: ").append(toIndentedString(apiResources)).append("\n");
+ sb.append(" self: ").append(toIndentedString(self)).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/APIResourceCollectionListItemApiResources.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/APIResourceCollectionListItemApiResources.java
new file mode 100644
index 0000000000..2fa7e00cda
--- /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/APIResourceCollectionListItemApiResources.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2023, 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.ArrayList;
+import java.util.List;
+import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceCollectionItem;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class APIResourceCollectionListItemApiResources {
+
+ private List read = null;
+
+ private List write = null;
+
+
+ /**
+ **/
+ public APIResourceCollectionListItemApiResources read(List read) {
+
+ this.read = read;
+ return this;
+ }
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("read")
+ @Valid
+ public List getRead() {
+ return read;
+ }
+ public void setRead(List read) {
+ this.read = read;
+ }
+
+ public APIResourceCollectionListItemApiResources addReadItem(APIResourceCollectionItem readItem) {
+ if (this.read == null) {
+ this.read = new ArrayList();
+ }
+ this.read.add(readItem);
+ return this;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionListItemApiResources write(List write) {
+
+ this.write = write;
+ return this;
+ }
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("write")
+ @Valid
+ public List getWrite() {
+ return write;
+ }
+ public void setWrite(List write) {
+ this.write = write;
+ }
+
+ public APIResourceCollectionListItemApiResources addWriteItem(APIResourceCollectionItem writeItem) {
+ if (this.write == null) {
+ this.write = new ArrayList();
+ }
+ this.write.add(writeItem);
+ return this;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ APIResourceCollectionListItemApiResources apIResourceCollectionListItemApiResources = (APIResourceCollectionListItemApiResources) o;
+ return Objects.equals(this.read, apIResourceCollectionListItemApiResources.read) &&
+ Objects.equals(this.write, apIResourceCollectionListItemApiResources.write);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(read, write);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class APIResourceCollectionListItemApiResources {\n");
+
+ sb.append(" read: ").append(toIndentedString(read)).append("\n");
+ sb.append(" write: ").append(toIndentedString(write)).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/APIResourceCollectionListResponse.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/APIResourceCollectionListResponse.java
new file mode 100644
index 0000000000..0d6675d214
--- /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/APIResourceCollectionListResponse.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2023, 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.ArrayList;
+import java.util.List;
+import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceCollectionListItem;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class APIResourceCollectionListResponse {
+
+ private Integer totalResults;
+ private List apiResourceCollections = null;
+
+
+ /**
+ **/
+ public APIResourceCollectionListResponse totalResults(Integer totalResults) {
+
+ this.totalResults = totalResults;
+ return this;
+ }
+
+ @ApiModelProperty(example = "1", value = "")
+ @JsonProperty("totalResults")
+ @Valid
+ public Integer getTotalResults() {
+ return totalResults;
+ }
+ public void setTotalResults(Integer totalResults) {
+ this.totalResults = totalResults;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionListResponse apiResourceCollections(List apiResourceCollections) {
+
+ this.apiResourceCollections = apiResourceCollections;
+ return this;
+ }
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("apiResourceCollections")
+ @Valid
+ public List getApiResourceCollections() {
+ return apiResourceCollections;
+ }
+ public void setApiResourceCollections(List apiResourceCollections) {
+ this.apiResourceCollections = apiResourceCollections;
+ }
+
+ public APIResourceCollectionListResponse addApiResourceCollectionsItem(APIResourceCollectionListItem apiResourceCollectionsItem) {
+ if (this.apiResourceCollections == null) {
+ this.apiResourceCollections = new ArrayList();
+ }
+ this.apiResourceCollections.add(apiResourceCollectionsItem);
+ return this;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ APIResourceCollectionListResponse apIResourceCollectionListResponse = (APIResourceCollectionListResponse) o;
+ return Objects.equals(this.totalResults, apIResourceCollectionListResponse.totalResults) &&
+ Objects.equals(this.apiResourceCollections, apIResourceCollectionListResponse.apiResourceCollections);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(totalResults, apiResourceCollections);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class APIResourceCollectionListResponse {\n");
+
+ sb.append(" totalResults: ").append(toIndentedString(totalResults)).append("\n");
+ sb.append(" apiResourceCollections: ").append(toIndentedString(apiResourceCollections)).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/APIResourceCollectionResponse.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/APIResourceCollectionResponse.java
new file mode 100644
index 0000000000..b24206decb
--- /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/APIResourceCollectionResponse.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2023, 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 org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceCollectionResponseApiResources;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class APIResourceCollectionResponse {
+
+ private String id;
+ private String name;
+ private String displayName;
+ private String type;
+ private APIResourceMap apiResources;
+
+ /**
+ **/
+ public APIResourceCollectionResponse id(String id) {
+
+ this.id = id;
+ return this;
+ }
+
+ @ApiModelProperty(example = "gh43-jk34-vb34-df67", required = true, value = "")
+ @JsonProperty("id")
+ @Valid
+ @NotNull(message = "Property id cannot be null.")
+
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionResponse name(String name) {
+
+ this.name = name;
+ return this;
+ }
+
+ @ApiModelProperty(example = "bulkUserImport", required = true, value = "")
+ @JsonProperty("name")
+ @Valid
+ @NotNull(message = "Property name cannot be null.")
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionResponse displayName(String displayName) {
+
+ this.displayName = displayName;
+ return this;
+ }
+
+ @ApiModelProperty(example = "Bulk User Import", required = true, value = "")
+ @JsonProperty("displayName")
+ @Valid
+ @NotNull(message = "Property displayName cannot be null.")
+
+ public String getDisplayName() {
+ return displayName;
+ }
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionResponse type(String type) {
+
+ this.type = type;
+ return this;
+ }
+
+ @ApiModelProperty(example = "SYSTEM", value = "")
+ @JsonProperty("type")
+ @Valid
+ public String getType() {
+ return type;
+ }
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionResponse apiResources(APIResourceMap apiResources) {
+
+ this.apiResources = apiResources;
+ return this;
+ }
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("apiResources")
+ @Valid
+ public APIResourceMap getApiResources() {
+ return apiResources;
+ }
+ public void setApiResources(APIResourceMap apiResources) {
+ this.apiResources = apiResources;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ APIResourceCollectionResponse apIResourceCollectionResponse = (APIResourceCollectionResponse) o;
+ return Objects.equals(this.id, apIResourceCollectionResponse.id) &&
+ Objects.equals(this.name, apIResourceCollectionResponse.name) &&
+ Objects.equals(this.displayName, apIResourceCollectionResponse.displayName) &&
+ Objects.equals(this.type, apIResourceCollectionResponse.type) &&
+ Objects.equals(this.apiResources, apIResourceCollectionResponse.apiResources);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, name, displayName, type, apiResources);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class APIResourceCollectionResponse {\n");
+
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" apiResources: ").append(toIndentedString(apiResources)).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/APIResourceCollectionResponseApiResources.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/APIResourceCollectionResponseApiResources.java
new file mode 100644
index 0000000000..f6c6ba5215
--- /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/APIResourceCollectionResponseApiResources.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2023, 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.ArrayList;
+import java.util.List;
+import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceCollectionItem;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class APIResourceCollectionResponseApiResources {
+
+ private List read = null;
+
+ private List write = null;
+
+
+ /**
+ **/
+ public APIResourceCollectionResponseApiResources read(List read) {
+
+ this.read = read;
+ return this;
+ }
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("read")
+ @Valid
+ public List getRead() {
+ return read;
+ }
+ public void setRead(List read) {
+ this.read = read;
+ }
+
+ public APIResourceCollectionResponseApiResources addReadItem(APIResourceCollectionItem readItem) {
+ if (this.read == null) {
+ this.read = new ArrayList();
+ }
+ this.read.add(readItem);
+ return this;
+ }
+
+ /**
+ **/
+ public APIResourceCollectionResponseApiResources write(List write) {
+
+ this.write = write;
+ return this;
+ }
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("write")
+ @Valid
+ public List getWrite() {
+ return write;
+ }
+ public void setWrite(List write) {
+ this.write = write;
+ }
+
+ public APIResourceCollectionResponseApiResources addWriteItem(APIResourceCollectionItem writeItem) {
+ if (this.write == null) {
+ this.write = new ArrayList();
+ }
+ this.write.add(writeItem);
+ return this;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ APIResourceCollectionResponseApiResources apIResourceCollectionResponseApiResources = (APIResourceCollectionResponseApiResources) o;
+ return Objects.equals(this.read, apIResourceCollectionResponseApiResources.read) &&
+ Objects.equals(this.write, apIResourceCollectionResponseApiResources.write);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(read, write);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class APIResourceCollectionResponseApiResources {\n");
+
+ sb.append(" read: ").append(toIndentedString(read)).append("\n");
+ sb.append(" write: ").append(toIndentedString(write)).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/APIResourceMap.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/APIResourceMap.java
new file mode 100644
index 0000000000..3562b7d33a
--- /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/APIResourceMap.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2023, 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.ArrayList;
+import java.util.List;
+import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceCollectionItem;
+import javax.validation.constraints.*;
+
+
+import io.swagger.annotations.*;
+import java.util.Objects;
+import javax.validation.Valid;
+import javax.xml.bind.annotation.*;
+
+public class APIResourceMap {
+
+ private List read = null;
+
+ private List write = null;
+
+
+ /**
+ **/
+ public APIResourceMap read(List read) {
+
+ this.read = read;
+ return this;
+ }
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("read")
+ @Valid
+ public List getRead() {
+ return read;
+ }
+ public void setRead(List read) {
+ this.read = read;
+ }
+
+ public APIResourceMap addReadItem(APIResourceCollectionItem readItem) {
+ if (this.read == null) {
+ this.read = new ArrayList();
+ }
+ this.read.add(readItem);
+ return this;
+ }
+
+ /**
+ **/
+ public APIResourceMap write(List write) {
+
+ this.write = write;
+ return this;
+ }
+
+ @ApiModelProperty(value = "")
+ @JsonProperty("write")
+ @Valid
+ public List getWrite() {
+ return write;
+ }
+ public void setWrite(List write) {
+ this.write = write;
+ }
+
+ public APIResourceMap addWriteItem(APIResourceCollectionItem writeItem) {
+ if (this.write == null) {
+ this.write = new ArrayList();
+ }
+ this.write.add(writeItem);
+ return this;
+ }
+
+
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ APIResourceMap apIResourceMap = (APIResourceMap) o;
+ return Objects.equals(this.read, apIResourceMap.read) &&
+ Objects.equals(this.write, apIResourceMap.write);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(read, write);
+ }
+
+ @Override
+ public String toString() {
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("class APIResourceMap {\n");
+
+ sb.append(" read: ").append(toIndentedString(read)).append("\n");
+ sb.append(" write: ").append(toIndentedString(write)).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/MetaApi.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/MetaApi.java
new file mode 100644
index 0000000000..f1239cc27a
--- /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/MetaApi.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2023, 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 io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import io.swagger.annotations.Authorization;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.validation.Valid;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+
+@Path("/meta")
+@Api(description = "The meta API")
+
+public class MetaApi {
+
+ @Autowired
+ private MetaApiService delegate;
+
+ @Valid
+ @GET
+ @Path("/api-resource-collections/{collectionId}")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "Get API resource collection specified by the id", notes = "Get API resource collection specified by the id Permission required:
* /permission/admin/manage/identity/apiresourcemgt/view
Scope required:
* internal_api_resource_view ", response = APIResourceCollectionResponse.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "API Resource Collections", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "OK", response = APIResourceCollectionResponse.class),
+ @ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden", response = Void.class),
+ @ApiResponse(code = 500, message = "Server Error", response = Error.class)
+ })
+ public Response getAPIResourceCollectionByCollectionId(@ApiParam(value = "ID of the API Resource Collection.",required=true) @PathParam("collectionId") String collectionId) {
+
+ return delegate.getAPIResourceCollectionByCollectionId(collectionId );
+ }
+
+ @Valid
+ @GET
+ @Path("/api-resource-collections")
+
+ @Produces({ "application/json" })
+ @ApiOperation(value = "List all API resource collections in the server", notes = "List all API resource collections in the server Permission required:
* /permission/admin/manage/identity/apiresourcemgt/view
Scope required:
* internal_api_resource_view ", response = APIResourceCollectionListResponse.class, authorizations = {
+ @Authorization(value = "BasicAuth"),
+ @Authorization(value = "OAuth2", scopes = {
+
+ })
+ }, tags={ "API Resource Collections" })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "OK", response = APIResourceCollectionListResponse.class),
+ @ApiResponse(code = 401, message = "Unauthorized", response = Void.class),
+ @ApiResponse(code = 403, message = "Forbidden", response = Void.class),
+ @ApiResponse(code = 500, message = "Server Error", response = Error.class)
+ })
+ public Response getAPIResourceCollections( @Valid@ApiParam(value = "Condition to filter the retrieval of records. Supports 'sw', 'co', 'ew' and 'eq' operations. ") @QueryParam("filter") String filter, @Valid@ApiParam(value = "Specifies the required attributes in the response. Only 'apiResources' attribute is currently supported.") @QueryParam("attributes") String attributes) {
+
+ return delegate.getAPIResourceCollections(filter, attributes );
+ }
+
+}
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/MetaApiService.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/MetaApiService.java
new file mode 100644
index 0000000000..30d39658bb
--- /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/MetaApiService.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2023, 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 javax.ws.rs.core.Response;
+
+public interface MetaApiService {
+
+ public Response getAPIResourceCollectionByCollectionId(String collectionId);
+
+ public Response getAPIResourceCollections(String filter, String attributes);
+}
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/PaginationLink.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/PaginationLink.java
index 3403c2f707..92099b2caf 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/PaginationLink.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/PaginationLink.java
@@ -61,7 +61,7 @@ public PaginationLink href(String href) {
return this;
}
- @ApiModelProperty(example = "/o/orgName/api-resources?after=NDoy", value = "")
+ @ApiModelProperty(example = "/t/carbon.super/api/server/v1/api-resources?after=NDoy", value = "")
@JsonProperty("href")
@Valid
public String getHref() {
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/MetaApiServiceFactory.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/MetaApiServiceFactory.java
new file mode 100644
index 0000000000..c2b23f5274
--- /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/MetaApiServiceFactory.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2023, 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.MetaApiService;
+import org.wso2.carbon.identity.api.server.api.resource.v1.impl.MetaApiServiceImpl;
+
+/**
+ * Factory class for MetaApiService.
+ */
+public class MetaApiServiceFactory {
+
+ private final static MetaApiService service = new MetaApiServiceImpl();
+
+ public static MetaApiService getMetaApi()
+ {
+ 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 ac88b391de..70b83a89e9 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
@@ -34,6 +34,7 @@ private APIResourceMgtEndpointConstants() {
public static final String SYSTEM_API_RESOURCE_TYPE = "SYSTEM";
public static final String API_RESOURCE_MANAGEMENT_PREFIX = "API-RESOURCE-";
public static final String API_RESOURCE_PATH_COMPONENT = "/api-resources";
+ public static final String API_RESOURCE_COLLECTION_PATH_COMPONENT = "/api-resource-collections";
private static final List allowedAttributeList = new ArrayList<>();
public static final List ALLOWED_SEARCH_ATTRIBUTES = Collections.unmodifiableList(allowedAttributeList);
@@ -42,10 +43,15 @@ private APIResourceMgtEndpointConstants() {
public static final List SUPPORTED_REQUIRED_ATTRIBUTES = Collections
.unmodifiableList(supportedRequiredAttributeList);
+ private static final List supportedRequiredAttributeListCollectionsAPI = new ArrayList<>();
+ public static final List SUPPORTED_REQUIRED_ATTRIBUTES_COLLECTIONS_API = Collections
+ .unmodifiableList(supportedRequiredAttributeListCollectionsAPI);
+
public static final String RESTRICTED_OAUTH2_SCOPES = "OAuth.RestrictedScopes.RestrictedScope";
public static final Integer DEFAULT_LIMIT = 10;
public static final String ASC_SORT_ORDER = "ASC";
public static final String DESC_SORT_ORDER = "DESC";
+ public static final String ATTRIBUTES_DELIMITER = ",";
static {
allowedAttributeList.add("description");
@@ -54,6 +60,7 @@ private APIResourceMgtEndpointConstants() {
allowedAttributeList.add("scopes");
supportedRequiredAttributeList.add("properties");
+ supportedRequiredAttributeListCollectionsAPI.add("apiResources");
}
/**
@@ -92,6 +99,9 @@ public enum ErrorMessage {
"Cannot modify or delete the read-only System APIs."),
ERROR_CODE_INVALID_REQ_ATTRIBUTES("60013", "Invalid attribute name.",
"Invalid attribute name provided as required attribute."),
+ 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."),
// Server errors.
ERROR_CODE_ADD_API_RESOURCE("65001", "Error while adding api resource.", "Server encountered an error while " +
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/ServerAPIResourceCollectionManagementService.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/ServerAPIResourceCollectionManagementService.java
new file mode 100644
index 0000000000..4fd5753615
--- /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/ServerAPIResourceCollectionManagementService.java
@@ -0,0 +1,238 @@
+/*
+ * Copyright (c) 2023, 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.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
+import org.wso2.carbon.context.CarbonContext;
+import org.wso2.carbon.identity.api.resource.collection.mgt.constant.APIResourceCollectionManagementConstants;
+import org.wso2.carbon.identity.api.resource.collection.mgt.exception.APIResourceCollectionMgtException;
+import org.wso2.carbon.identity.api.resource.collection.mgt.model.APIResourceCollection;
+import org.wso2.carbon.identity.api.resource.collection.mgt.model.APIResourceCollectionSearchResult;
+import org.wso2.carbon.identity.api.server.api.resource.common.APIResourceManagementServiceHolder;
+import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceCollectionItem;
+import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceCollectionListItem;
+import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceCollectionListResponse;
+import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceCollectionResponse;
+import org.wso2.carbon.identity.api.server.api.resource.v1.APIResourceMap;
+import org.wso2.carbon.identity.api.server.api.resource.v1.ScopeGetModel;
+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.common.error.APIError;
+import org.wso2.carbon.identity.application.common.model.APIResource;
+import org.wso2.carbon.identity.application.common.model.Scope;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import javax.ws.rs.core.Response;
+
+import static org.wso2.carbon.identity.api.server.common.Constants.V1_API_PATH_COMPONENT;
+
+/**
+ * Server API Resource Collection Management Service.
+ */
+public class ServerAPIResourceCollectionManagementService {
+
+ /**
+ * Get API Resource Collections List.
+ *
+ * @param filter filter string.
+ * @param requiredAttributes Required attributes.
+ * @return API Resource Collections List.
+ */
+ public APIResourceCollectionListResponse getAPIResourceCollections(String filter, String requiredAttributes) {
+
+ APIResourceCollectionListResponse apiResourceCollectionListResponse = new APIResourceCollectionListResponse();
+ try {
+ List requestedAttributeList = StringUtils.isNotEmpty(requiredAttributes) ?
+ Arrays.asList(requiredAttributes.split(APIResourceMgtEndpointConstants.ATTRIBUTES_DELIMITER)) :
+ Collections.emptyList();
+ if (!requestedAttributeList.isEmpty()) {
+ validateRequiredAttributes(requestedAttributeList);
+ }
+
+ APIResourceCollectionSearchResult apiResourceCollectionSearchResult =
+ APIResourceManagementServiceHolder.getApiResourceCollectionManager()
+ .getAPIResourceCollections(filter, requestedAttributeList,
+ CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ List apiResourceCollections =
+ apiResourceCollectionSearchResult.getAPIResourceCollections();
+ if (CollectionUtils.isEmpty(apiResourceCollections)) {
+ apiResourceCollectionListResponse.setTotalResults(0);
+ apiResourceCollectionListResponse.setApiResourceCollections(new ArrayList<>());
+ return apiResourceCollectionListResponse;
+ }
+ apiResourceCollectionListResponse.setTotalResults(apiResourceCollectionSearchResult.getTotalCount());
+ apiResourceCollectionListResponse.setApiResourceCollections(apiResourceCollections.stream()
+ .map(apiResourceCollection -> buildAPIResourceCollectionListItem(apiResourceCollection,
+ CollectionUtils.isNotEmpty(requestedAttributeList))).collect(Collectors.toList()));
+ } catch (APIResourceCollectionMgtException e) {
+ throw APIResourceMgtEndpointUtil.handleAPIResourceCollectionMgtException(e);
+ }
+ return apiResourceCollectionListResponse;
+ }
+
+ /**
+ * Get API Resource Collection by collection id.
+ *
+ * @param collectionId API Resource Collection id.
+ * @return API Resource Collection.
+ */
+ public APIResourceCollectionResponse getAPIResourceCollectionByCollectionId(String collectionId) {
+
+ APIResourceCollectionResponse apiResourceCollectionResponse = new APIResourceCollectionResponse();
+
+ try {
+ APIResourceCollection apiResourceCollection = APIResourceManagementServiceHolder
+ .getApiResourceCollectionManager().getAPIResourceCollectionById(collectionId,
+ CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ if (apiResourceCollection == null) {
+ throw APIResourceMgtEndpointUtil.handleException(Response.Status.NOT_FOUND,
+ APIResourceMgtEndpointConstants.ErrorMessage.ERROR_CODE_API_RESOURCE_COLLECTION_NOT_FOUND,
+ collectionId);
+ }
+ apiResourceCollectionResponse.setId(apiResourceCollection.getId());
+ apiResourceCollectionResponse.setName(apiResourceCollection.getName());
+ apiResourceCollectionResponse.setDisplayName(apiResourceCollection.getDisplayName());
+ apiResourceCollectionResponse.setType(apiResourceCollection.getType());
+ apiResourceCollectionResponse.setApiResources(buildAPIResourceMap(apiResourceCollection));
+ } catch (APIResourceCollectionMgtException e) {
+ throw APIResourceMgtEndpointUtil.handleAPIResourceCollectionMgtException(e);
+ }
+ return apiResourceCollectionResponse;
+ }
+
+ /**
+ * Build API Resource Collection List Item from API Resource Collection.
+ *
+ * @param apiResourceCollection API Resource Collection.
+ * @return API Resource Collection List Item.
+ */
+ private APIResourceCollectionListItem buildAPIResourceCollectionListItem(
+ APIResourceCollection apiResourceCollection, boolean includeAPIResources) {
+
+ APIResourceCollectionListItem item = new APIResourceCollectionListItem()
+ .id(apiResourceCollection.getId())
+ .name(apiResourceCollection.getName())
+ .displayName(apiResourceCollection.getDisplayName())
+ .type(apiResourceCollection.getType())
+ .self(V1_API_PATH_COMPONENT + APIResourceMgtEndpointConstants.API_RESOURCE_COLLECTION_PATH_COMPONENT +
+ "/" + apiResourceCollection.getId());
+
+ if (includeAPIResources) {
+ item.setApiResources(buildAPIResourceMap(apiResourceCollection));
+ }
+ return item;
+ }
+
+ /**
+ * Build ScopeGetModel from Scope.
+ *
+ * @param scope Scope object.
+ * @return ScopeGetModel object.
+ */
+ private ScopeGetModel buildScopeGetResponse(Scope scope) {
+
+ return new ScopeGetModel()
+ .id(scope.getId())
+ .name(scope.getName())
+ .displayName(scope.getDisplayName())
+ .description(scope.getDescription());
+ }
+
+ /**
+ * Get API Resource Collection Items.
+ *
+ * @param apiResourceCollection API Resource Collection.
+ * @param resourceType Resource type.
+ * @return API Resource Collection Items.
+ */
+ private List getAPIResourceCollectionItems(APIResourceCollection apiResourceCollection,
+ String resourceType) {
+
+ if (apiResourceCollection.getApiResources() == null || apiResourceCollection.getApiResources()
+ .get(resourceType) == null) {
+ return Collections.emptyList();
+ }
+ return apiResourceCollection.getApiResources().get(resourceType).stream()
+ .map(this::buildAPIResourceCollectionItem).collect(Collectors.toList());
+ }
+
+ /**
+ * Build API Resource List Item from API Resource.
+ *
+ * @param apiResource API Resource.
+ * @return API Resource List Item.
+ */
+ private APIResourceCollectionItem buildAPIResourceCollectionItem(APIResource apiResource) {
+
+ List scopesList = (apiResource.getScopes() != null)
+ ? apiResource.getScopes().stream().map(this::buildScopeGetResponse).collect(Collectors.toList())
+ : Collections.emptyList();
+
+ return new APIResourceCollectionItem()
+ .id(apiResource.getId())
+ .name(apiResource.getName())
+ .description(apiResource.getDescription())
+ .type(apiResource.getType())
+ .scopes(scopesList)
+ .self(V1_API_PATH_COMPONENT + APIResourceMgtEndpointConstants.API_RESOURCE_PATH_COMPONENT
+ + "/" + apiResource.getId());
+ }
+
+ /**
+ * Validate required attributes.
+ *
+ * @param requiredAttributeList Requested attribute list.
+ * @throws APIError if the requested attributes are invalid.
+ */
+ private void validateRequiredAttributes(List requiredAttributeList) throws APIError {
+
+ for (String attribute : requiredAttributeList) {
+ if (!(APIResourceMgtEndpointConstants.SUPPORTED_REQUIRED_ATTRIBUTES_COLLECTIONS_API.contains(attribute))) {
+ throw APIResourceMgtEndpointUtil.handleException(Response.Status.BAD_REQUEST,
+ APIResourceMgtEndpointConstants.ErrorMessage.ERROR_CODE_INVALID_REQ_ATTRIBUTES);
+ }
+ }
+ }
+
+ /**
+ * Build API Resource read write map.
+ *
+ * @param apiResourceCollection API Resource Collection.
+ * @return API Resource read write map.
+ */
+ private APIResourceMap buildAPIResourceMap(APIResourceCollection apiResourceCollection) {
+
+ List readAPIResourceCollectionItems = getAPIResourceCollectionItems(
+ apiResourceCollection, APIResourceCollectionManagementConstants.READ);
+ List writeAPIResourceCollectionItems = getAPIResourceCollectionItems(
+ apiResourceCollection, APIResourceCollectionManagementConstants.WRITE);
+
+ APIResourceMap apiResourceCollectionResponseApiResources =
+ new APIResourceMap();
+ apiResourceCollectionResponseApiResources.setRead(readAPIResourceCollectionItems);
+ apiResourceCollectionResponseApiResources.setWrite(writeAPIResourceCollectionItems);
+ return apiResourceCollectionResponseApiResources;
+ }
+}
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/MetaApiServiceImpl.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/MetaApiServiceImpl.java
new file mode 100644
index 0000000000..feb5bcf864
--- /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/MetaApiServiceImpl.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2023, 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.springframework.beans.factory.annotation.Autowired;
+import org.wso2.carbon.identity.api.server.api.resource.v1.MetaApiService;
+import org.wso2.carbon.identity.api.server.api.resource.v1.core.ServerAPIResourceCollectionManagementService;
+
+import javax.ws.rs.core.Response;
+
+/**
+ * Implementation of the API resource collections meta REST API.
+ */
+public class MetaApiServiceImpl implements MetaApiService {
+
+ @Autowired
+ ServerAPIResourceCollectionManagementService serverAPIResourceManagementService;
+
+ @Override
+ public Response getAPIResourceCollectionByCollectionId(String collectionId) {
+
+ return Response.ok().entity(
+ serverAPIResourceManagementService.getAPIResourceCollectionByCollectionId(collectionId)).build();
+ }
+
+ @Override
+ public Response getAPIResourceCollections(String filter, String attributes) {
+
+ return Response.ok().entity(serverAPIResourceManagementService.getAPIResourceCollections(filter, attributes))
+ .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/APIResourceMgtEndpointUtil.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/APIResourceMgtEndpointUtil.java
index e039b5b17c..c5814d3eee 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/util/APIResourceMgtEndpointUtil.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/APIResourceMgtEndpointUtil.java
@@ -21,6 +21,8 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.identity.api.resource.collection.mgt.exception.APIResourceCollectionMgtClientException;
+import org.wso2.carbon.identity.api.resource.collection.mgt.exception.APIResourceCollectionMgtException;
import org.wso2.carbon.identity.api.resource.mgt.APIResourceMgtClientException;
import org.wso2.carbon.identity.api.resource.mgt.APIResourceMgtException;
import org.wso2.carbon.identity.api.server.api.resource.common.APIResourceManagementServiceHolder;
@@ -166,6 +168,21 @@ public static APIError handleAPIResourceMgtException(APIResourceMgtException e)
return handleException(status, errorCode, e.getMessage(), e.getDescription());
}
+ public static APIError handleAPIResourceCollectionMgtException(APIResourceCollectionMgtException e) {
+
+ Response.Status status = Response.Status.INTERNAL_SERVER_ERROR;
+ if (e instanceof APIResourceCollectionMgtClientException) {
+ LOG.debug(e.getMessage(), e);
+ status = Response.Status.BAD_REQUEST;
+ } else {
+ LOG.error(e.getMessage(), e);
+ }
+ String errorCode = e.getErrorCode();
+ errorCode = errorCode.contains(ERROR_CODE_DELIMITER) ? errorCode :
+ APIResourceMgtEndpointConstants.API_RESOURCE_MANAGEMENT_PREFIX + errorCode;
+ return handleException(status, errorCode, e.getMessage(), e.getDescription());
+ }
+
/**
* Returns a generic error object.
*
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 71022af4da..51d72cca8b 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
@@ -33,7 +33,7 @@ paths:
- API Resources
operationId: addAPIResource
summary: Add a new API resource
- description: >
+ description: >
Add a new API resource
Permission required:
* /permission/admin/manage/identity/apiresourcemgt/create
@@ -88,7 +88,7 @@ paths:
tags:
- API Resources
summary: List all API resources in the server
- description: >
+ description: >
List all API resources in the server
Permission required:
* /permission/admin/manage/identity/apiresourcemgt/view
@@ -124,7 +124,7 @@ paths:
tags:
- API Resources
summary: Get API resource specified by the id
- description: >
+ description: >
Get API resource specified by the id
Permission required:
* /permission/admin/manage/identity/apiresourcemgt/view
@@ -154,7 +154,7 @@ paths:
tags:
- API Resources
summary: Patch API resource specified by the id
- description: >
+ description: >
Patch API resource specified by the id. Patch operation only supports "name", "description" updating and "addedScopes" fields at the moment.
Permission required:
* /permission/admin/manage/identity/apiresourcemgt/update
@@ -214,7 +214,7 @@ paths:
tags:
- API Resources
summary: Delete API resource specified by the id
- description: >
+ description: >
Delete API resource specified by the id
Permission required:
* /permission/admin/manage/identity/apiresourcemgt/delete
@@ -241,7 +241,7 @@ paths:
tags:
- API Resource Scopes
summary: Get API resource scopes
- description: >
+ description: >
Get API resource scopes specified by the id
Permission required:
* /permission/admin/manage/identity/apiresourcemgt/view
@@ -279,7 +279,7 @@ paths:
tags:
- API Resource Scopes
summary: Add scopes to API resource
- description: >
+ description: >
Put scopes API resource specified by the id
Permission required:
* /permission/admin/manage/identity/apiresourcemgt/update
@@ -337,7 +337,7 @@ paths:
tags:
- API Resource Scopes
summary: Delete API scope specified by the name
- description: >
+ description: >
Delete API scope specified by the name
Permission required:
* /permission/admin/manage/identity/apiresourcemgt/delete
@@ -363,7 +363,7 @@ paths:
tags:
- API Resource Scopes
summary: Get all scopes in the tenant
- description: >
+ description: >
Get all scopes in the tenant
Permission required:
* /permission/admin/manage/identity/apiresourcemgt/view
@@ -397,6 +397,71 @@ paths:
schema:
$ref: '#/components/schemas/Error'
+ /meta/api-resource-collections:
+ get:
+ tags:
+ - API Resource Collections
+ summary: List all API resource collections in the server
+ description: >
+ List all API resource collections in the server
+ Permission required:
+ * /permission/admin/manage/identity/apiresourcemgt/view
+ Scope required:
+ * internal_api_resource_view
+ operationId: getAPIResourceCollections
+ parameters:
+ - $ref: '#/components/parameters/collectionFilter'
+ - $ref: '#/components/parameters/collectionAttributes'
+ responses:
+ 200:
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIResourceCollectionListResponse'
+ 401:
+ description: Unauthorized
+ 403:
+ description: Forbidden
+ 500:
+ description: Server Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+
+ /meta/api-resource-collections/{collectionId}:
+ get:
+ tags:
+ - API Resource Collections
+ summary: Get API resource collection specified by the id
+ description: >
+ Get API resource collection specified by the id
+ Permission required:
+ * /permission/admin/manage/identity/apiresourcemgt/view
+ Scope required:
+ * internal_api_resource_view
+ operationId: getAPIResourceCollectionByCollectionId
+ parameters:
+ - $ref: '#/components/parameters/collectionId'
+ responses:
+ 200:
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIResourceCollectionResponse'
+ 401:
+ description: Unauthorized
+ 403:
+ description: Forbidden
+ 500:
+ description: Server Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+
components:
parameters:
organizationId:
@@ -417,6 +482,15 @@ components:
type: string
example: er34-gf23-bv54-vb90
+ collectionId:
+ name: collectionId
+ in: path
+ description: ID of the API Resource Collection.
+ required: true
+ schema:
+ type: string
+ example: er34-gf23-bv54-vb90
+
scopeName:
name: scopeName
in: path
@@ -471,6 +545,16 @@ components:
type: string
example: identifier+eq+greetings
+ collectionFilter:
+ 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+tenant
+
limit:
name: limit
in: query
@@ -489,6 +573,14 @@ components:
schema:
type: string
+ collectionAttributes:
+ name: attributes
+ in: query
+ required: false
+ description: Specifies the required attributes in the response. Only 'apiResources' attribute is currently supported.
+ schema:
+ type: string
+
schemas:
Error:
type: object
@@ -629,7 +721,7 @@ components:
example: before
href:
type: string
- example: /o/orgName/api-resources?after=NDoy
+ example: /api/server/v1/api-resources?after=NDoy
APIResourceListResponse:
type: object
@@ -648,6 +740,110 @@ components:
items:
$ref: '#/components/schemas/APIResourceListItem'
+ APIResourceMap:
+ type: object
+ properties:
+ read:
+ type: array
+ items:
+ $ref: '#/components/schemas/APIResourceCollectionItem'
+ write:
+ type: array
+ items:
+ $ref: '#/components/schemas/APIResourceCollectionItem'
+
+ APIResourceCollectionListItem:
+ type: object
+ required:
+ - id
+ - name
+ - displayName
+ - self
+ properties:
+ id:
+ type: string
+ example: gh43-jk34-vb34-df67
+ name:
+ type: string
+ example: bulkUserImport
+ displayName:
+ type: string
+ example: Bulk User Import
+ type:
+ type: string
+ example: SYSTEM
+ apiResources:
+ $ref: '#/components/schemas/APIResourceMap'
+ self:
+ type: string
+ example: /t/carbon.super/api/server/v1/api-resource-collections/eDUwOUNlcnRpZmljYXRlQXV0aGVudGljYXRvcg
+
+ APIResourceCollectionListResponse:
+ type: object
+ required:
+ - links
+ properties:
+ totalResults:
+ type: integer
+ example: 1
+ apiResourceCollections:
+ type: array
+ items:
+ $ref: '#/components/schemas/APIResourceCollectionListItem'
+
+ APIResourceCollectionItem:
+ type: object
+ required:
+ - id
+ - name
+ - displayName
+ - self
+ properties:
+ id:
+ type: string
+ example: gh43-jk34-vb34-df67
+ name:
+ type: string
+ example: Greetings API
+ description:
+ type: string
+ example: Greeting API representation
+ identifier:
+ type: string
+ example: greetings_api
+ type:
+ type: string
+ example: SYSTEM
+ scopes:
+ type: array
+ items:
+ $ref: '#/components/schemas/ScopeGetModel'
+ self:
+ type: string
+ example: /t/carbon.super/api/server/v1/api-resources/eDUwOUNlcnRpZmljYXRlQXV0aGVudGljYXRvcg
+
+ APIResourceCollectionResponse:
+ type: object
+ required:
+ - id
+ - name
+ - displayName
+ properties:
+ id:
+ type: string
+ example: gh43-jk34-vb34-df67
+ name:
+ type: string
+ example: bulkUserImport
+ displayName:
+ type: string
+ example: Bulk User Import
+ type:
+ type: string
+ example: SYSTEM
+ apiResources:
+ $ref: '#/components/schemas/APIResourceMap'
+
ScopeGetModel:
type: object
required:
diff --git a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/resources/META-INF/cxf/api-resource-server-v1-cxf.xml b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/resources/META-INF/cxf/api-resource-server-v1-cxf.xml
index d0e3e969ba..d977454b72 100644
--- a/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/resources/META-INF/cxf/api-resource-server-v1-cxf.xml
+++ b/components/org.wso2.carbon.identity.api.server.api.resource/org.wso2.carbon.identity.api.server.api.resource.v1/src/main/resources/META-INF/cxf/api-resource-server-v1-cxf.xml
@@ -21,13 +21,16 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index ea9fd8645c..cf6b3d9d8d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -197,6 +197,12 @@
${carbon.identity.framework.version}
provided
+
+ org.wso2.carbon.identity.framework
+ org.wso2.carbon.identity.api.resource.collection.mgt
+ ${carbon.identity.framework.version}
+ provided
+
org.wso2.carbon.identity.framework
org.wso2.carbon.identity.application.mgt
@@ -760,7 +766,7 @@
1.4
1.2.4
1.8.62
- 5.25.506
+ 5.25.528
3.0.5
5.2.0
**/gen/**/*