Repository: wso2/carbon-identity-framework
Pull request #6756: Add API resources and access control for Async Operation Management API.
Author: login: roshanemoraes
Created: 2025-05-19T05:38:47Z | Merged: 2025-05-19T14:41:12Z

### Purpose
$subject

### Related pr
- https://github.com/wso2/identity-api-server/pull/879
### Related issue
- https://github.com/wso2/product-is/issues/23903


Diff:
diff --git a/features/api-resource-mgt/org.wso2.carbon.identity.api.resource.mgt.server.feature/resources/system-api-resource.xml b/features/api-resource-mgt/org.wso2.carbon.identity.api.resource.mgt.server.feature/resources/system-api-resource.xml
index 6dd6a22251f9..c64816519600 100644
--- a/features/api-resource-mgt/org.wso2.carbon.identity.api.resource.mgt.server.feature/resources/system-api-resource.xml
+++ b/features/api-resource-mgt/org.wso2.carbon.identity.api.resource.mgt.server.feature/resources/system-api-resource.xml
@@ -1556,4 +1556,20 @@
                    description="Update registration flow in the organization (root)"/>
         </Scopes>
     </APIResource>
+    <APIResource name="Asynchronous Operation Status API" identifier="/api/server/v1/async-operations"
+                 requiresAuthorization="true"
+                 description="API representation of the Asynchronous Operation Status API" type="TENANT">
+        <Scopes>
+            <Scope displayName="View Async Operation status" name="internal_async_operation_status_view"
+                   description="View Asynchronous Operation Status"/>
+        </Scopes>
+    </APIResource>
+    <APIResource name="Asynchronous Operation Status API" identifier="/o/api/server/v1/async-operations"
+                 requiresAuthorization="true"
+                 description="API representation of the Asynchronous Operation Status API" type="ORGANIZATION">
+        <Scopes>
+            <Scope displayName="View Async Operation status" name="internal_org_async_operation_status_view"
+                   description="View Asynchronous Operation Status in the organization"/>
+        </Scopes>
+    </APIResource>
 </APIResources>
diff --git a/features/api-resource-mgt/org.wso2.carbon.identity.api.resource.mgt.server.feature/resources/system-api-resource.xml.j2 b/features/api-resource-mgt/org.wso2.carbon.identity.api.resource.mgt.server.feature/resources/system-api-resource.xml.j2
index 8319f2230c9f..c44f221e518e 100644
--- a/features/api-resource-mgt/org.wso2.carbon.identity.api.resource.mgt.server.feature/resources/system-api-resource.xml.j2
+++ b/features/api-resource-mgt/org.wso2.carbon.identity.api.resource.mgt.server.feature/resources/system-api-resource.xml.j2
@@ -1573,4 +1573,20 @@
                    description="Update registration flow in the organization (root)"/>
         </Scopes>
     </APIResource>
+    <APIResource name="Asynchronous Operation Status API" identifier="/api/server/v1/async-operations"
+                 requiresAuthorization="true"
+                 description="API representation of the Asynchronous Operation Status API" type="TENANT">
+        <Scopes>
+            <Scope displayName="View Async Operation status" name="internal_async_operation_status_view"
+                   description="View Asynchronous Operation Status"/>
+        </Scopes>
+    </APIResource>
+    <APIResource name="Asynchronous Operation Status API" identifier="/o/api/server/v1/async-operations"
+                 requiresAuthorization="true"
+                 description="API representation of the Asynchronous Operation Status API" type="ORGANIZATION">
+        <Scopes>
+            <Scope displayName="View Async Operation status" name="internal_org_async_operation_status_view"
+                   description="View Asynchronous Operation Status in the organization"/>
+        </Scopes>
+    </APIResource>
 </APIResources>
diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml
index 085dc520e806..ce8e4ac3f35f 100644
--- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml
+++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml
@@ -1423,6 +1423,16 @@
         <Scopes>internal_user_shared_access_view</Scopes>
     </Resource>
 
+    <!-- [Organization] Async Operation Status API -->
+    <Resource context="(.*)/o/api/server/v1/async-operations(.*)" secured="true" http-method="GET">
+        <Scopes>internal_org_async_operation_status_view</Scopes>
+    </Resource>
+
+    <!-- Async Operation Status API -->
+    <Resource context="(.*)/api/server/v1/async-operations(.*)" secured="true" http-method="GET">
+        <Scopes>internal_async_operation_status_view</Scopes>
+    </Resource>
+
     <Resource context="/carbon(.*)" secured="false" http-method="all"/>
     <Resource context="(.*)/myaccount(.*)" secured="false" http-method="all"/>
     <Resource context="(.*)/console(.*)" secured="false" http-method="all"/>
diff --git a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml.j2 b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml.j2
index fe2219f9452b..65609cb618e5 100644
--- a/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml.j2
+++ b/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml.j2
@@ -1492,6 +1492,16 @@
              <Scopes>internal_user_shared_access_view</Scopes>
          </Resource>
 
+         <!-- [Organization] Async Operation Management API -->
+         <Resource context="(.*)/o/api/server/v1/async-operations(.*)" secured="true" http-method="GET">
+             <Scopes>internal_org_async_operation_status_view</Scopes>
+         </Resource>
+
+         <!-- Async Operation Management API -->
+         <Resource context="(.*)/api/server/v1/async-operations(.*)" secured="true" http-method="GET">
+             <Scopes>internal_async_operation_status_view</Scopes>
+         </Resource>
+
         <Resource context="/carbon(.*)" secured="false" http-method="all"/>
         <Resource context="(.*)/myaccount(.*)" secured="false" http-method="all"/>
         <Resource context="(.*)/console(.*)" secured="false" http-method="all"/>


Reviews:
user: login: SujanSanjula96
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T05:43:01Z
user: login: SujanSanjula96
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T05:43:24Z
user: login: SujanSanjula96
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T05:46:04Z
user: login: roshanemoraes
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T05:59:51Z
user: login: roshanemoraes
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T06:00:00Z
user: login: SujanSanjula96
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-05-19T06:11:54Z
user: login: jenkins-is-staging
body: Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/15112794157
state: APPROVED
author_association: NONE
submitted_at: 2025-05-19T14:17:52Z

Review comments:
diff_hunk: @@ -1573,4 +1573,20 @@
                    description="Update registration flow in the organization (root)"/>
         </Scopes>
     </APIResource>
+    <APIResource name="Asynchronous Operation Status Manager API" identifier="/api/server/v1/async-operations"
path: features/api-resource-mgt/org.wso2.carbon.identity.api.resource.mgt.server.feature/resources/system-api-resource.xml.j2
user: login: SujanSanjula96
body: ```suggestion
    <APIResource name="Asynchronous Operation Status API" identifier="/api/server/v1/async-operations"
```
created_at: 2025-05-19T05:43:01Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1573,4 +1573,20 @@
                    description="Update registration flow in the organization (root)"/>
         </Scopes>
     </APIResource>
+    <APIResource name="Asynchronous Operation Status Manager API" identifier="/api/server/v1/async-operations"
path: features/api-resource-mgt/org.wso2.carbon.identity.api.resource.mgt.server.feature/resources/system-api-resource.xml.j2
user: login: SujanSanjula96
body: Fix other places as well
created_at: 2025-05-19T05:43:24Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1492,6 +1492,16 @@
              <Scopes>internal_user_shared_access_view</Scopes>
          </Resource>
 
+         <!-- [Organization] Async Operation Management API -->
+         <Resource context="(.*)/o/api/server/v1/async-operations/(.*)" secured="true" http-method="GET">
path: features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml.j2
user: login: SujanSanjula96
body: ```suggestion
         <Resource context="(.*)/o/api/server/v1/async-operations(.*)" secured="true" http-method="GET">
```
created_at: 2025-05-19T05:46:04Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1492,6 +1492,16 @@
              <Scopes>internal_user_shared_access_view</Scopes>
          </Resource>
 
+         <!-- [Organization] Async Operation Management API -->
+         <Resource context="(.*)/o/api/server/v1/async-operations/(.*)" secured="true" http-method="GET">
path: features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml.j2
user: login: roshanemoraes
body: Resolved in commit: https://github.com/wso2/carbon-identity-framework/pull/6756/commits/211834f89920143e67f17495d1ab68f04956b59d
created_at: 2025-05-19T05:59:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1573,4 +1573,20 @@
                    description="Update registration flow in the organization (root)"/>
         </Scopes>
     </APIResource>
+    <APIResource name="Asynchronous Operation Status Manager API" identifier="/api/server/v1/async-operations"
path: features/api-resource-mgt/org.wso2.carbon.identity.api.resource.mgt.server.feature/resources/system-api-resource.xml.j2
user: login: roshanemoraes
body: Resolved in commit: https://github.com/wso2/carbon-identity-framework/pull/6756/commits/211834f89920143e67f17495d1ab68f04956b59d
created_at: 2025-05-19T06:00:00Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-05-19T05:57:45Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=wso2_carbon-identity-framework&pullRequest=6756) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=wso2_carbon-identity-framework&pullRequest=6756&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=wso2_carbon-identity-framework&pullRequest=6756&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=wso2_carbon-identity-framework&pullRequest=6756&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=wso2_carbon-identity-framework&pullRequest=6756&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=wso2_carbon-identity-framework&pullRequest=6756&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=wso2_carbon-identity-framework&pullRequest=6756)


author_association: NONE
user: login: codecov[bot]
created_at: 2025-05-19T06:25:40Z
body: ## [Codecov](https://app.codecov.io/gh/wso2/carbon-identity-framework/pull/6756?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wso2) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 48.43%. Comparing base [(`64d2f6b`)](https://app.codecov.io/gh/wso2/carbon-identity-framework/commit/64d2f6bce73967972f1e6e5bc3216d5ac2a92b3e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wso2) to head [(`211834f`)](https://app.codecov.io/gh/wso2/carbon-identity-framework/commit/211834f89920143e67f17495d1ab68f04956b59d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wso2).
> Report is 14 commits behind head on master.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff            @@
##             master    #6756   +/-   ##
=========================================
  Coverage     48.43%   48.43%           
  Complexity    16515    16515           
=========================================
  Files          1865     1865           
  Lines        110091   110091           
  Branches      20831    20831           
=========================================
  Hits          53322    53322           
  Misses        49541    49541           
  Partials       7228     7228           
```

| [Flag](https://app.codecov.io/gh/wso2/carbon-identity-framework/pull/6756/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wso2) | Coverage Δ | |
|---|---|---|
| [unit](https://app.codecov.io/gh/wso2/carbon-identity-framework/pull/6756/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wso2) | `32.51% <ø> (ø)` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wso2#carryforward-flags-in-the-pull-request-comment) to find out more.

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/wso2/carbon-identity-framework/pull/6756?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wso2).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wso2).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
author_association: NONE
user: login: jenkins-is-staging
created_at: 2025-05-19T06:26:18Z
body: PR builder started 
Link: https://github.com/wso2/product-is/actions/runs/15105815760
author_association: NONE
user: login: jenkins-is-staging
created_at: 2025-05-19T06:43:56Z
body: PR builder completed 
Link: https://github.com/wso2/product-is/actions/runs/15105815760 
Status: **failure**
author_association: NONE
user: login: jenkins-is-staging
created_at: 2025-05-19T12:19:36Z
body: PR builder started 
Link: https://github.com/wso2/product-is/actions/runs/15112794157
author_association: NONE
user: login: jenkins-is-staging
created_at: 2025-05-19T14:17:52Z
body: PR builder completed 
Link: https://github.com/wso2/product-is/actions/runs/15112794157 
Status: **success**
author_association: NONE