-
Notifications
You must be signed in to change notification settings - Fork 66
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
Introduce Resource Sharing Policy Management Component #416
base: main
Are you sure you want to change the base?
Introduce Resource Sharing Policy Management Component #416
Conversation
…licy record and shared resource attributes by resource sharing policy id
… attributes rather than deleting it from record id since that way of deletion is not currently needed.
… attributes rather than deleting it from record id since that way of deletion is not currently needed - Part 2.
…yManagement component
components/org.wso2.carbon.identity.organization.resource.sharing.policy.management/pom.xml
Show resolved
Hide resolved
components/org.wso2.carbon.identity.organization.resource.sharing.policy.management/pom.xml
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #416 +/- ##
============================================
+ Coverage 47.13% 48.57% +1.44%
- Complexity 1024 1080 +56
============================================
Files 112 115 +3
Lines 6710 6898 +188
Branches 802 810 +8
============================================
+ Hits 3163 3351 +188
Misses 3259 3259
Partials 288 288
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
...organization/resource/sharing/policy/management/dao/ResourceSharingPolicyHandlerDAOImpl.java
Outdated
Show resolved
Hide resolved
...organization/resource/sharing/policy/management/dao/ResourceSharingPolicyHandlerDAOImpl.java
Outdated
Show resolved
Hide resolved
...organization/resource/sharing/policy/management/dao/ResourceSharingPolicyHandlerDAOImpl.java
Outdated
Show resolved
Hide resolved
...organization/resource/sharing/policy/management/dao/ResourceSharingPolicyHandlerDAOImpl.java
Outdated
Show resolved
Hide resolved
...ity/organization/resource/sharing/policy/management/ResourceSharingPolicyHandlerService.java
Show resolved
Hide resolved
...organization/resource/sharing/policy/management/dao/ResourceSharingPolicyHandlerDAOImpl.java
Outdated
Show resolved
Hide resolved
...organization/resource/sharing/policy/management/dao/ResourceSharingPolicyHandlerDAOImpl.java
Outdated
Show resolved
Hide resolved
...organization/resource/sharing/policy/management/dao/ResourceSharingPolicyHandlerDAOImpl.java
Outdated
Show resolved
Hide resolved
...esource/sharing/policy/management/internal/ResourceSharingPolicyHandlerServiceComponent.java
Outdated
Show resolved
Hide resolved
...esource/sharing/policy/management/internal/ResourceSharingPolicyHandlerServiceComponent.java
Show resolved
Hide resolved
...esource/sharing/policy/management/internal/ResourceSharingPolicyHandlerServiceComponent.java
Outdated
Show resolved
Hide resolved
.../identity/organization/resource/sharing/policy/management/model/SharedResourceAttribute.java
Show resolved
Hide resolved
...nization/resource/sharing/policy/management/ResourceSharingPolicyHandlerServiceImplTest.java
Show resolved
Hide resolved
…stead of ExecuteQuery
…Record instead of ExecuteQuery
…pply the required validations.
…olicy code in to a more intuitive manner.
* @throws ResourceSharingPolicyMgtException If an error occurs during the creation of the resource sharing policy. | ||
*/ | ||
int addResourceSharingPolicy(ResourceSharingPolicy resourceSharingPolicy) | ||
throws ResourceSharingPolicyMgtException, DataAccessException; |
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.
throws ResourceSharingPolicyMgtException, DataAccessException; | |
throws ResourceSharingPolicyMgtException; |
* @return {@code true} if the resource sharing policy was deleted successfully, {@code false} otherwise. | ||
* @throws ResourceSharingPolicyMgtException If an error occurs while deleting the resource sharing policy. | ||
*/ | ||
boolean deleteResourceSharingPolicyRecordById(int resourceSharingPolicyId, String sharingPolicyInitiatedOrgId) |
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.
shall we make this a void method?
Otherwise invoker needs to handle false / exception cases specifically or we need to mention in which scenario we return false, in which scenarios it will throw an exception
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.
Fix in all other delete operations
*/ | ||
boolean addResourceSharingPolicyWithAttributes(ResourceSharingPolicy resourceSharingPolicy, | ||
List<SharedResourceAttribute> sharedResourceAttributes, | ||
String sharingPolicyInitiatedOrgId) |
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 do we need sharingPolicyInitiatedOrgId as a separate param? Shall we extract it from resourceSharingPolicy
for impl usages
*/ | ||
public class ResourceSharingPolicyHandlerServiceImpl implements ResourceSharingPolicyHandlerService { | ||
|
||
private static final Log LOG = LogFactory.getLog(ResourceSharingPolicyHandlerService.class); |
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.
private static final Log LOG = LogFactory.getLog(ResourceSharingPolicyHandlerService.class); | |
private static final Log LOG = LogFactory.getLog(ResourceSharingPolicyHandlerServiceImpl.class); |
* @throws ResourceSharingPolicyMgtException If an error occurs while retrieving the resource sharing | ||
* policies or shared attributes. | ||
*/ | ||
Optional<Map<String, Map<ResourceSharingPolicy, List<SharedResourceAttribute>>>> |
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.
If the service will anyway construct a Map, not need to make it Optional.
Check other service which return Map
private boolean isInvalidId(String id) { | ||
return id == null || id.isEmpty(); |
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.
private boolean isInvalidId(String id) { | |
return id == null || id.isEmpty(); | |
private boolean isInvalidId(String id) { | |
return id == null || id.isEmpty(); |
This PR adds a new component to manage resource-sharing policies between organizations in the WSO2 Identity Server. It enables defining, storing, and retrieving resource-sharing policies for users, applications, and identity providers.
Purpose
Goals
Approach
Release note
Documentation
Test environment
Related Issue
Introduce a Centralized Resource Sharing Policy Management Service #21815