-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for claim-wise uniqueness validation #6113
base: master
Are you sure you want to change the base?
Add support for claim-wise uniqueness validation #6113
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6113 +/- ##
============================================
+ Coverage 40.98% 41.05% +0.07%
- Complexity 14698 14736 +38
============================================
Files 1764 1772 +8
Lines 119164 120530 +1366
Branches 20860 21422 +562
============================================
+ Hits 48836 49486 +650
- Misses 63008 63678 +670
- Partials 7320 7366 +46
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
5a4769a
to
89624e0
Compare
89624e0
to
5f716bc
Compare
5f716bc
to
8116bea
Compare
8116bea
to
d37616b
Compare
b7d6d37
to
3476baf
Compare
3476baf
to
257ab9b
Compare
Quality Gate passedIssues Measures |
String query = SQLConstants.DELETE_CLAIM_PROPERTY_BY_NAME; | ||
try (PreparedStatement prepStmt = connection.prepareStatement(query)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String query = SQLConstants.DELETE_CLAIM_PROPERTY_BY_NAME; | |
try (PreparedStatement prepStmt = connection.prepareStatement(query)) { | |
try (PreparedStatement prepStmt = connection.prepareStatement(SQLConstants.DELETE_CLAIM_PROPERTY_BY_NAME)) { |
protected void updateClaimPropertiesAtomically(Connection connection, int claimId, | ||
Map<String, String> newClaimProperties, | ||
Set<String> claimPropertiesToDelete, | ||
int tenantId) throws ClaimMetadataException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this formatting intentional?
if (claimPropertiesToDelete != null && !claimPropertiesToDelete.isEmpty()) { | ||
deleteClaimProperties(connection, claimId, claimPropertiesToDelete, tenantId); | ||
} | ||
|
||
if (newClaimProperties != null && !newClaimProperties.isEmpty()) { | ||
addClaimProperties(connection, claimId, newClaimProperties, tenantId); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we directly update instead of deleting and adding claim properties?
Proposed changes in this pull request
This PR enables flexible attribute uniqueness validation with per-claim configuration of validation scope.
Key Changes
UniquenessScope
Property: Introduces aUniquenessScope
property (enum values:NONE
,WITHIN_USERSTORE
,ACROSS_USERSTORES
) to specify the validation scope within or across user stores.isUnique
is no longer required but is retained for backward compatibility.UniquenessScope
to claims withisUnique
through these endpoints:GET & POST /api/server/v1/claim-dialects/local/claims
GET & PUT /api/server/v1/claim-dialects/local/claims/{claim-id}
UniquenessScope
; ifisUnique
is present butUniquenessScope
is missing, it defaults to the server-level setting.Related issue
Checklist (for reviewing)
General
Functionality
Code
Tests
Security
Documentation