-
Notifications
You must be signed in to change notification settings - Fork 545
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 service layer to manage authorization details types #6073
base: master
Are you sure you want to change the base?
Conversation
- Add SQL queries - Add DAO layer - Modify resource access controls - Add unit tests - Modify APIs to support authorization details types
3688d64
to
498f0de
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6073 +/- ##
============================================
+ Coverage 40.82% 45.75% +4.93%
+ Complexity 16031 14200 -1831
============================================
Files 1813 1639 -174
Lines 130155 102071 -28084
Branches 22264 17805 -4459
============================================
- Hits 53130 46701 -6429
+ Misses 69267 48626 -20641
+ Partials 7758 6744 -1014
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
*/ | ||
public class AuthorizationDetailsTypeMgtDAOImpl implements AuthorizationDetailsTypeMgtDAO { | ||
|
||
private static final Log log = LogFactory.getLog(AuthorizationDetailsTypeMgtDAOImpl.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(AuthorizationDetailsTypeMgtDAOImpl.class); | |
private static final Log LOG = LogFactory.getLog(AuthorizationDetailsTypeMgtDAOImpl.class); |
please change other places also
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.
Fixed in 9f2011a
ID CHAR(36) NOT NULL, | ||
TYPE VARCHAR(255) NOT NULL, | ||
API_ID CHAR(36) NOT NULL, | ||
CURSOR_KEY INTEGER NOT NULL, |
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 we need this cursor key
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.
This field can be used in the "cursor pagination" which is more efficient than "limit/offset pagination"
Capitalize private static final variable names
...main/java/org/wso2/carbon/identity/api/resource/mgt/AuthorizationDetailsTypeManagerImpl.java
Outdated
Show resolved
Hide resolved
...a/org/wso2/carbon/identity/api/resource/mgt/dao/impl/AuthorizationDetailsTypeMgtDAOImpl.java
Outdated
Show resolved
Hide resolved
...a/org/wso2/carbon/identity/api/resource/mgt/dao/impl/AuthorizationDetailsTypeMgtDAOImpl.java
Outdated
Show resolved
Hide resolved
private boolean isRichAuthorizationRequestsEnabled() { | ||
|
||
for (final String tableName : AuthorizationDetailsTypesUtil.RICH_AUTHORIZATION_REQUESTS_TABLES) { | ||
if (!IdentityDatabaseUtil.isTableExists(tableName)) { |
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.
don't we have a configuration to enable this feature? Why are we relying on the table exists?
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.
This has added to prevent database exceptions such as "Table does not exist"
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.
We decided to not use isTableExist checks in the product due to schema owner issues in oracle DB. Shall we use a configuration and properly document the need of necessary tables before enabling the configuration.
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.
@madurangasiriwardena instead of using
isTableExists
method can we have a configuration.
@VimukthiRajapaksha correct me if I am wrong, this config is needed to seperate the feature for any specific deployments right?
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.
Yes @Thumimku we have added this to avoid triggering database operations for this feature in a specific deployment.
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.
Since this is a feature going in a product release, all the required new database tables are supposed to be added with the product upgrade procedure. So there is no requirement to avoid "Table does not exist" exceptions.
If there are no other reasons to enable/disable the feature, we can get rid of this altogether.
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.
@VimukthiRajapaksha Let's address this, and then we can proceed.
...c/main/java/org/wso2/carbon/identity/application/mgt/AuthorizedAPIManagementServiceImpl.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/wso2/carbon/identity/application/mgt/AuthorizedAPIManagementServiceImpl.java
Show resolved
Hide resolved
...gt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/AuthorizedAPIDAOImpl.java
Outdated
Show resolved
Hide resolved
...gt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/AuthorizedAPIDAOImpl.java
Show resolved
Hide resolved
...urce.mgt/src/main/java/org/wso2/carbon/identity/api/resource/mgt/APIResourceManagerImpl.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/wso2/carbon/identity/api/resource/mgt/AuthorizationDetailsTypeManager.java
Outdated
Show resolved
Hide resolved
make db operations transactional Add authorization details types to authorized api events Add missing java doc comments remove static method imports
resolve checkstyle issues
Quality Gate passedIssues Measures |
Proposed changes in this pull request
This PR adds CRUD operations to manage Authorization Details Types, allowing for Create, Read, Update, and Delete operations.
Related Issues
Checklist (for reviewing)
General
Functionality
Code
Tests
Security
Documentation