Skip to content

Revert unused util class and add configuration to configure push device registration context validity period#7893

Merged
ashanthamara merged 2 commits into
wso2:masterfrom
ashanthamara:patch
Mar 23, 2026
Merged

Revert unused util class and add configuration to configure push device registration context validity period#7893
ashanthamara merged 2 commits into
wso2:masterfrom
ashanthamara:patch

Conversation

@ashanthamara

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings March 19, 2026 18:45
@coderabbitai

coderabbitai Bot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Removed unused cache expiration utility class and associated tests. Added push authenticator device registration validity period configuration (180 seconds) to server feature defaults, applying changes across template and resource files.

Changes

Cohort / File(s) Summary
Cache utility removal
components/identity-core/org.wso2.carbon.identity.core/src/main/java/org/wso2/carbon/identity/core/util/IdentityCacheUtil.java, components/identity-core/org.wso2.carbon.identity.core/src/test/java/org/wso2/carbon/identity/core/util/IdentityCacheUtilTest.java, components/identity-core/org.wso2.carbon.identity.core/src/test/resources/testng.xml
Deleted IdentityCacheUtil public static method isCacheEntryExpired(CacheEntry) and corresponding test class. Removed test suite entry from TestNG configuration.
Push authenticator configuration
features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml, features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml.j2, features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/org.wso2.carbon.identity.core.server.feature.default.json
Added <PushAuthenticator> configuration block with <DeviceRegistrationContext><ValidityPeriod> set to 180 seconds across default XML, template, and feature configuration files.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: reverting an unused utility class and adding configuration for push device registration validity period.
Description check ✅ Passed The description covers the essential information: reason for reversion, related PRs and issues, and the configuration addition. While some template sections are empty, the core requirements are met.
Linked Issues check ✅ Passed The PR addresses the linked issue #27176 by adding configuration to manage push device registration context validity period, enabling cross-cluster node support for device registration.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked objectives: reverting an unused utility class and adding configuration for push authenticator device registration context validity period.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can disable the changed files summary in the walkthrough.

Disable the reviews.changed_files_summary setting to disable the changed files summary in the walkthrough.

@jenkins-is-staging

Copy link
Copy Markdown

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/23311295521

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml.j2 (1)

1503-1505: Consider documenting the ValidityPeriod unit inline.

A short comment (for example, “in seconds”) would make this safer to operate and reduce misconfiguration.

✏️ Suggested tweak
+    <!-- Validity period for push device registration context (in seconds). -->
     <PushAuthenticator>
         <DeviceRegistrationContext>
             <ValidityPeriod>{{push_authenticator.device_registration_context.validity_period}}</ValidityPeriod>
         </DeviceRegistrationContext>
     </PushAuthenticator>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml.j2`
around lines 1503 - 1505, The template lacks a unit for
DeviceRegistrationContext.ValidityPeriod which can cause misconfiguration;
update the identity.xml.j2 PushAuthenticator/DeviceRegistrationContext section
to include an inline comment specifying the expected unit (e.g., "in seconds")
next to <ValidityPeriod> and, if applicable, add the same unit note to the Jinja
variable reference
push_authenticator.device_registration_context.validity_period or its
configuration documentation so operators know the unit.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml.j2`:
- Around line 1503-1505: The template lacks a unit for
DeviceRegistrationContext.ValidityPeriod which can cause misconfiguration;
update the identity.xml.j2 PushAuthenticator/DeviceRegistrationContext section
to include an inline comment specifying the expected unit (e.g., "in seconds")
next to <ValidityPeriod> and, if applicable, add the same unit note to the Jinja
variable reference
push_authenticator.device_registration_context.validity_period or its
configuration documentation so operators know the unit.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 2b8024ca-da6c-4bdf-a937-dbf0008d93e0

📥 Commits

Reviewing files that changed from the base of the PR and between 0aff4ea and d2f1814.

📒 Files selected for processing (6)
  • components/identity-core/org.wso2.carbon.identity.core/src/main/java/org/wso2/carbon/identity/core/util/IdentityCacheUtil.java
  • components/identity-core/org.wso2.carbon.identity.core/src/test/java/org/wso2/carbon/identity/core/util/IdentityCacheUtilTest.java
  • components/identity-core/org.wso2.carbon.identity.core/src/test/resources/testng.xml
  • features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml
  • features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml.j2
  • features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/org.wso2.carbon.identity.core.server.feature.default.json
💤 Files with no reviewable changes (3)
  • components/identity-core/org.wso2.carbon.identity.core/src/test/resources/testng.xml
  • components/identity-core/org.wso2.carbon.identity.core/src/main/java/org/wso2/carbon/identity/core/util/IdentityCacheUtil.java
  • components/identity-core/org.wso2.carbon.identity.core/src/test/java/org/wso2/carbon/identity/core/util/IdentityCacheUtilTest.java

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reverts the cache-entry expiry utility introduced in #7646 (and its associated unit test wiring) and adds a new configurable setting for the Push Authenticator device registration context validity period, exposing it via both the default JSON config and the generated/static identity.xml configurations.

Changes:

  • Added push_authenticator.device_registration_context.validity_period to the identity-core server feature default configuration JSON.
  • Exposed the same setting in both identity.xml and identity.xml.j2 under a new <PushAuthenticator> section.
  • Removed IdentityCacheUtil and IdentityCacheUtilTest, and de-registered the test from testng.xml.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/org.wso2.carbon.identity.core.server.feature.default.json Adds the new Push Authenticator validity period config key with a default value.
features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml.j2 Emits the new config as <PushAuthenticator><DeviceRegistrationContext><ValidityPeriod>....
features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/identity.xml Adds the corresponding static default XML configuration block.
components/identity-core/org.wso2.carbon.identity.core/src/test/resources/testng.xml Removes the deleted IdentityCacheUtilTest from the TestNG suite.
components/identity-core/org.wso2.carbon.identity.core/src/test/java/org/wso2/carbon/identity/core/util/IdentityCacheUtilTest.java Deleted as part of reverting the unused util.
components/identity-core/org.wso2.carbon.identity.core/src/main/java/org/wso2/carbon/identity/core/util/IdentityCacheUtil.java Deleted as part of reverting the unused util.

@codecov

codecov Bot commented Mar 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.61%. Comparing base (0aff4ea) to head (d2f1814).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7893      +/-   ##
============================================
+ Coverage     52.28%   52.61%   +0.33%     
+ Complexity    20929    20085     -844     
============================================
  Files          2142     2140       -2     
  Lines        131158   124555    -6603     
  Branches      25865    25389     -476     
============================================
- Hits          68572    65538    -3034     
+ Misses        54088    50962    -3126     
+ Partials       8498     8055     -443     
Flag Coverage Δ
unit 37.31% <ø> (+0.02%) ⬆️

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.

@jenkins-is-staging

Copy link
Copy Markdown

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/23311295521
Status: failure

@jenkins-is-staging

Copy link
Copy Markdown

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/23311295521

@jenkins-is-staging

Copy link
Copy Markdown

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/23311295521
Status: success

@jenkins-is-staging jenkins-is-staging left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/23311295521

@ashanthamara
ashanthamara merged commit 9ec2af3 into wso2:master Mar 23, 2026
10 checks passed
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.

4 participants