Skip to content

Add push device update endpoints to allowed endpoints#8086

Open
VihangaMunasinghe wants to merge 1 commit into
wso2:masterfrom
VihangaMunasinghe:push-auth-device-update
Open

Add push device update endpoints to allowed endpoints#8086
VihangaMunasinghe wants to merge 1 commit into
wso2:masterfrom
VihangaMunasinghe:push-auth-device-update

Conversation

@VihangaMunasinghe

Copy link
Copy Markdown

Purpose

The new push device update endpoint (POST /devices/{deviceId}/update) added in identity-api-user needs to be registered in the resource access control configuration. Without this, the endpoint would be blocked by the framework's access control layer.

Related Issue

Related PRs

Goals

  • Allow the new push device update endpoint to be accessible from both tenant and organization contexts without authentication (same as the existing registration and removal endpoints), since the request itself is authenticated via a signed JWT token.

Approach

  • Added two new <Resource> entries in resource-access-control-v2.xml.j2:
    • Organization context: (.*)/o/api/users/v1/me/push/devices/(.*)/update with secured="false" for POST.
    • Tenant context: (.*)/api/users/v1/me/push/devices/(.*)/update with secured="false" for POST.
  • Follows the same pattern as the existing /remove endpoint entries.

User stories

As a mobile app user, I want the device update endpoint to be accessible so that I can update my device's push notification token or device name.

Release note

Added the push device update endpoint (/devices/{deviceId}/update) to the allowed endpoints in the resource access control configuration.

Documentation

N/A - Internal framework configuration change. No user-facing documentation impact.

Training

N/A

Certification

N/A - Configuration change with no impact on certification content.

Marketing

N/A

Automation tests

  • Unit tests
    N/A - Configuration file change only.
  • Integration tests
    N/A

Security checks

Samples

N/A

Migrations (if applicable)

No migrations required. Existing deployments will pick up the new resource access control entries on upgrade.

Learning

Followed the existing pattern used by the /remove endpoint for registering unsecured push device endpoints in both organization and tenant contexts.

@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 3530249c-f897-4ca3-8e5a-865ff1cab75b

📥 Commits

Reviewing files that changed from the base of the PR and between 66b5a3d and 8dade4e.

📒 Files selected for processing (1)
  • features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml.j2

📝 Walkthrough

Walkthrough

A Jinja2 XML template for resource access control is updated to extend the copyright year to 2026 and reorganize Push Device Management API resource mappings. The organization-scoped PUT endpoint is moved to group with non-organization POST and remove endpoints, and a corresponding non-organization POST endpoint is added.

Changes

Resource Access Control Configuration

Layer / File(s) Summary
Template Metadata
features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml.j2
Copyright year range extended from 2023-2025 to 2023-2026.
Push Device Management API Resources
features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/resource-access-control-v2.xml.j2
Organization /o/api/.../push/devices/(.*)/update PUT resource is repositioned into the non-organization Push Device Management block; new /api/.../push/devices/(.*)/update POST resource is added to non-organization section alongside existing remove entries.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding push device update endpoints to allowed endpoints in the resource access control configuration.
Description check ✅ Passed The description covers all required sections from the template with sufficient detail, including Purpose, Goals, Approach, User stories, Release note, and relevant N/A entries for non-applicable sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

sonarqubecloud Bot commented May 7, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented May 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.14%. Comparing base (ff0a7a6) to head (8dade4e).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #8086      +/-   ##
============================================
- Coverage     53.15%   53.14%   -0.01%     
+ Complexity    20527    20517      -10     
============================================
  Files          2147     2147              
  Lines        125919   125904      -15     
  Branches      18044    17972      -72     
============================================
- Hits          66930    66910      -20     
- Misses        50781    50792      +11     
+ Partials       8208     8202       -6     
Flag Coverage Δ
unit 37.77% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant