-
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 XACML DAO JDBC implementation #5792
Add XACML DAO JDBC implementation #5792
Conversation
f1dbfae
to
289f5e5
Compare
289f5e5
to
76b1b8a
Compare
...dentity.entitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/DAOConstants.java
Show resolved
Hide resolved
public static final String VERSION = "VERSION"; | ||
public static final String TENANT_ID = "TENANT_ID"; | ||
public static final String LAST_MODIFIED_TIME = "LAST_MODIFIED_TIME"; | ||
public static final String LAST_MODIFIED_USER = "LAST_MODIFIED_USER"; |
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.
revisit whether this is storing user-id or a username
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.
It stores the username
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.
Cant we store userid?
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.
It will be a behavioral change from registry impl since lastModifiedUser
is a property of the PolicyDTO object.
// IDN_XACML_STATUS table | ||
public static final String STATUS_TYPE = "TYPE"; | ||
public static final String IS_SUCCESS = "IS_SUCCESS"; | ||
public static final String USER = "USERNAME"; |
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.
revisit whether this is storing user-id or a username
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.
Also stores the username
...dentity.entitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/DAOConstants.java
Outdated
Show resolved
Hide resolved
...dentity.entitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/DAOConstants.java
Outdated
Show resolved
Hide resolved
...ty.entitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/JDBCConfigDAOImpl.java
Outdated
Show resolved
Hide resolved
...ty.entitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/JDBCConfigDAOImpl.java
Show resolved
Hide resolved
...ty.entitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/JDBCConfigDAOImpl.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
// performing cache invalidation | ||
EntitlementEngine.getInstance().invalidatePolicyCache(); |
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.
shouldn't we invalidate cache after the commit?
in a rare situation, if the thread got wait just after executing this line.. another thread could add a new cache entry which will be incorrect just after the first thread continues its execution and updated the policy combining algo in the db.. This would leave, a stale incorrect cache entry in the cache.
But moving the invalidation just after the commit, could lead to another race condition other way around, but thats impact is minimal and would not leave for stale data for a long time.
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.
Also, can we move the caching logic out of the dao.
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.
Moved the caching logic out
try { | ||
// Check the existence of the algorithm | ||
String algorithm = getPolicyCombiningAlgorithm(connection, tenantId); | ||
String query = StringUtils.isNotBlank(algorithm) |
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.
better if we can get rid of this kind of logic outside from the dao impl..
but this specific instance have very minor impact.
c73e0bf
to
012de8e
Compare
...ty.entitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/JDBCConfigDAOImpl.java
Outdated
Show resolved
Hide resolved
...ty.entitlement/src/main/java/org/wso2/carbon/identity/entitlement/dao/JDBCConfigDAOImpl.java
Outdated
Show resolved
Hide resolved
e2bd8c6
to
862f890
Compare
862f890
to
92f0a83
Compare
Closing since this will be covered with #5826. |
Proposed changes in this pull request
Introduces the JDBC implementation for XACML.
When should this PR be merged
Upon review
Related PRs
Related issues
Checklist (for reviewing)
General
Functionality
Code
Tests
Security
Documentation