Skip to content

Add support for extended values#7774

Merged
bhagyasakalanka merged 3 commits intowso2:masterfrom
bhagyasakalanka:support-large-attributes
Mar 3, 2026
Merged

Add support for extended values#7774
bhagyasakalanka merged 3 commits intowso2:masterfrom
bhagyasakalanka:support-large-attributes

Conversation

@bhagyasakalanka
Copy link
Contributor

Proposed changes in this pull request

note $subject

Copilot AI review requested due to automatic review settings February 25, 2026 08:01
Copy link
Contributor

@wso2-engineering wso2-engineering bot left a comment

Choose a reason for hiding this comment

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

AI Agent Log Improvement Checklist

⚠️ Warning: AI-Generated Review Comments

  • The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
  • Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.

✅ Before merging this pull request:

  • Review all AI-generated comments for accuracy and relevance.
  • Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
Comment Accepted (Y/N) Reason
#### Log Improvement Suggestion No: 1

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

Warning

Rate limit exceeded

@bhagyasakalanka has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 41 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 6ffcaad and 88b24bb.

📒 Files selected for processing (1)
  • components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/test/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtilsTest.java
📝 Walkthrough

Walkthrough

Added a Maven dependency and bumped Carbon Kernel version; introduced a new constant EXTENDED_VALUED_PROPERTY; updated conversion logic to parse and set the extendedValued boolean on Claim mappings; extended unit tests to cover the new property (with a test data construction bug introduced).

Changes

Cohort / File(s) Summary
Build configuration
pom.xml, components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/pom.xml
Bumped carbon.kernel.version from 4.10.121 to 4.12.6 in root POM; added dependency org.wso2.carbon:org.wso2.carbon.user.api to the claim-mgt module POM.
Claim metadata constants
components/claim-mgt/.../util/ClaimConstants.java
Added public constant EXTENDED_VALUED_PROPERTY = "extendedValued".
Claim conversion logic
components/claim-mgt/.../util/ClaimMetadataUtils.java
Added presence check and boolean parsing for extendedValued, calling setExtendedValued on the Claim during local-claim-to-ClaimMapping conversion.
Unit tests
components/claim-mgt/.../util/ClaimMetadataUtilsTest.java
Extended test cases to include two new LocalClaim instances with extendedValued true/false and added assertions for the property; added an import (com.beust.ah.A). Note: one test data map is populated into the wrong variable, potentially causing an incorrect/empty property set for one test case.
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is largely incomplete, containing only a placeholder note and missing all required template sections including Purpose, Goals, Approach, User stories, Release notes, Documentation, and other critical information. Complete the PR description by filling out all required template sections: Purpose (with issue links), Goals, Approach, User stories, Release notes, Documentation, Testing details, Security checks, and other applicable sections.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add support for extended values' is clear and directly related to the main changes, which add support for an extended-valued claim property throughout the codebase.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for an extendedValued claim property by surfacing it through the claim-metadata-to-user-core mapping, and wires the module dependencies needed for user API types.

Changes:

  • Introduce a new claim property key (extendedValued) in ClaimConstants.
  • Map the extendedValued claim property into the user-core Claim in ClaimMetadataUtils#convertLocalClaimToClaimMapping.
  • Add an explicit Maven dependency on org.wso2.carbon.user.api.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtils.java Reads extendedValued from local claim properties and sets it on the user-core Claim.
components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimConstants.java Adds a constant for the new extendedValued property key.
components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/pom.xml Adds explicit dependency on org.wso2.carbon.user.api.

Comment on lines +292 to +294
if (claimProperties.containsKey(ClaimConstants.EXTENDED_VALUE_PROPERTY)) {
claim.setExtendedValued(Boolean.parseBoolean(claimProperties.get(ClaimConstants.EXTENDED_VALUE_PROPERTY)));
}
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

This new behavior (mapping the extendedValued claim property into the user-core Claim) isn’t covered by the existing ClaimMetadataUtilsTest#testConvertLocalClaimToClaimMapping assertions. Please add/extend a test case that sets ClaimConstants.EXTENDED_VALUE_PROPERTY in claimProperties and verifies claimMapping.getClaim().isExtendedValued() matches.

Copilot uses AI. Check for mistakes.
public static final String SUB_ATTRIBUTES_PROPERTY = "subAttributes";
public static final String SUB_ATTRIBUTE_PREFIX = "subAttribute.";
public static final String CANONICAL_VALUE_PREFIX = "canonicalValue.";
public static final String EXTENDED_VALUE_PROPERTY = "extendedValued";
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The Java license header in this file still ends at 2025, but this change is being made in 2026. Please update the header year range to end in 2026 (and align to the repo’s standard WSO2 Apache 2.0 header text).

Copilot uses AI. Check for mistakes.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtils.java (1)

2-2: ⚠️ Potential issue | 🟡 Minor

Update copyright year to 2026.

The copyright header reads 2016-2025 but the current year is 2026.

📄 Proposed fix
- * Copyright (c) 2016-2025, WSO2 LLC. (http://www.wso2.com).
+ * Copyright (c) 2016-2026, WSO2 LLC. (http://www.wso2.com).

As per coding guidelines, the license header must have a copyright year as the current year or a range ending in the current year.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtils.java`
at line 2, Update the copyright header in ClaimMetadataUtils.java from
"2016-2025" to end in the current year "2016-2026"; open the top-of-file license
comment in ClaimMetadataUtils.java and replace the year range so the header ends
with 2026 to comply with the project's licensing header convention.
components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimConstants.java (1)

2-2: ⚠️ Potential issue | 🟡 Minor

Update copyright year to 2026.

The copyright header reads 2016-2025; it should end with the current year, 2026.

📄 Proposed fix
- * Copyright (c) 2016-2025, WSO2 LLC. (http://www.wso2.com).
+ * Copyright (c) 2016-2026, WSO2 LLC. (http://www.wso2.com).

As per coding guidelines, the license header must have a copyright year as the current year or a range ending in the current year.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimConstants.java`
at line 2, Update the license header year range in the file containing the
ClaimConstants class so the ending year is 2026 (e.g., change "2016-2025" to
"2016-2026"); locate the header at the top of the ClaimConstants.java file
(class ClaimConstants) and modify the copyright line accordingly to comply with
the coding guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtils.java`:
- Around line 292-294: The code calls a non-existent method
claim.setExtendedValued(...) (with symbols claimProperties and
ClaimConstants.EXTENDED_VALUE_PROPERTY) which will fail; find the correct API on
org.wso2.carbon.user.core.claim.Claim (open that class) and either replace the
call with the correct setter name (e.g., setExtendedValue or the actual method
provided) or, if Claim has no such field, persist the flag into the claim's
properties map (e.g.,
claim.getProperties().put(ClaimConstants.EXTENDED_VALUE_PROPERTY,
String.valueOf(...))). Update the code in ClaimMetadataUtils to use the resolved
approach so no call to setExtendedValued remains.

---

Outside diff comments:
In
`@components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimConstants.java`:
- Line 2: Update the license header year range in the file containing the
ClaimConstants class so the ending year is 2026 (e.g., change "2016-2025" to
"2016-2026"); locate the header at the top of the ClaimConstants.java file
(class ClaimConstants) and modify the copyright line accordingly to comply with
the coding guidelines.

In
`@components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtils.java`:
- Line 2: Update the copyright header in ClaimMetadataUtils.java from
"2016-2025" to end in the current year "2016-2026"; open the top-of-file license
comment in ClaimMetadataUtils.java and replace the year range so the header ends
with 2026 to comply with the project's licensing header convention.

ℹ️ Review info

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0f8c1b and fb799b9.

📒 Files selected for processing (3)
  • components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/pom.xml
  • components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimConstants.java
  • components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtils.java

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.28%. Comparing base (a86aa90) to head (88b24bb).
⚠️ Report is 251 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7774      +/-   ##
============================================
+ Coverage     51.03%   51.28%   +0.25%     
- Complexity    19650    20681    +1031     
============================================
  Files          2155     2167      +12     
  Lines        125745   134272    +8527     
  Branches      25665    27890    +2225     
============================================
+ Hits          64176    68866    +4690     
- Misses        53403    56754    +3351     
- Partials       8166     8652     +486     
Flag Coverage Δ
unit 37.06% <100.00%> (+0.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.

@bhagyasakalanka bhagyasakalanka force-pushed the support-large-attributes branch from 91070b5 to 826b055 Compare March 3, 2026 07:20
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtils.java (1)

2-2: ⚠️ Potential issue | 🟡 Minor

Update the Java license header year range to include 2026.

Line 2 still ends at 2025; this file is modified in 2026.

As per coding guidelines, **/*.java: Ensure that all Java files contain the appropriate license header at the top with copyright year as the current year or a range ending in the current year (e.g., 2018-2026).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtils.java`
at line 2, Update the Java file header in ClaimMetadataUtils.java to extend the
copyright year range to include 2026 (e.g., change "2016-2025" to "2016-2026")
so the license header is current; locate the header at the top of the file above
the class declaration for ClaimMetadataUtils and modify only the year range
text.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtils.java`:
- Line 2: Update the Java file header in ClaimMetadataUtils.java to extend the
copyright year range to include 2026 (e.g., change "2016-2025" to "2016-2026")
so the license header is current; locate the header at the top of the file above
the class declaration for ClaimMetadataUtils and modify only the year range
text.

ℹ️ Review info

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 91070b5 and 826b055.

📒 Files selected for processing (3)
  • components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimConstants.java
  • components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtils.java
  • pom.xml
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/main/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimConstants.java

@jenkins-is-staging
Copy link

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/test/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtilsTest.java`:
- Around line 434-445: The test initializes claimPropertiesMap4 but mistakenly
calls put(...) on claimPropertiesMap3, corrupting other fixtures and leaving
localClaim6 with empty properties; update the map population lines so that all
property put calls use claimPropertiesMap4 (the map passed into the LocalClaim
constructor for localClaim6) to ensure localClaim6 gets its own properties and
localClaim5 remains unchanged.
- Around line 550-553: The assertion for ClaimConstants.EXTENDED_VALUED_PROPERTY
is never reached because claimProperties refers to localClaim2 which doesn't
contain that key; update the test so it asserts against the correct properties
source: either switch claimProperties to the map from the claim that actually
contains EXTENDED_VALUED_PROPERTY (e.g., localClaim1's properties) or add
EXTENDED_VALUED_PROPERTY into localClaim2 before the check, and then verify that
claimMapping.getClaim().isExtendedValued() equals
Boolean.parseBoolean(claimProperties.get(ClaimConstants.EXTENDED_VALUED_PROPERTY)).
- Line 18: Remove the unused stray import com.beust.ah.A from
ClaimMetadataUtilsTest and fix the test-data bug where claimPropertiesMap4 is
created but values are mistakenly added to claimPropertiesMap3; change those
assignments to add properties to claimPropertiesMap4 so that localClaim6 (which
is initialized with claimPropertiesMap4) gets the intended entries (verify
references to claimPropertiesMap4, claimPropertiesMap3, and localClaim6 in the
test and ensure no other unused imports remain).

ℹ️ Review info

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 826b055 and 6ffcaad.

📒 Files selected for processing (1)
  • components/claim-mgt/org.wso2.carbon.identity.claim.metadata.mgt/src/test/java/org/wso2/carbon/identity/claim/metadata/mgt/util/ClaimMetadataUtilsTest.java

@bhagyasakalanka bhagyasakalanka force-pushed the support-large-attributes branch 2 times, most recently from 12cb2c2 to 1aa2d95 Compare March 3, 2026 07:40
@bhagyasakalanka bhagyasakalanka force-pushed the support-large-attributes branch from 1aa2d95 to 88b24bb Compare March 3, 2026 07:41
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

1 similar comment
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

@jenkins-is-staging
Copy link

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

Copy link

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

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/22612889295

@bhagyasakalanka bhagyasakalanka merged commit 35f667e into wso2:master Mar 3, 2026
6 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