-
Notifications
You must be signed in to change notification settings - Fork 730
feat(auth): switch legacy IAuthorizationPolicy to IAuthorizationService impl [PPUC-318] #6027
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
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
17f96d9
to
05e472b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Commit fixing system IT test issues was moved to: #6036. |
logs/ | ||
target/ | ||
http:/ | ||
c:/ |
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 correct: C:/
? I'm just wondering.
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, the IT tests create these weird files/folders!
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.
In any case, those changes have moved to #6036.
05e472b
to
e48deeb
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
e48deeb
to
0868674
Compare
(reworded the commit and PR description, from PPUC-122, to the new story, PPUC-318, but kept the branch name, to avoid having to close this PR) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…ce impl [PPUC-318]
…ce [PPUC-318] - refreshes the auth actions cache when plugin manager reloads
…olicyRoleBindingDao [PPUC-318] - invalidates cache when role permissions change
…318] - invalidates cache when users' roles change
…s impls [PPUC-318]
…n cache [PPUC-318] - depends on i18n added to pentaho-commons-gwt
0868674
to
55c8311
Compare
Updated the PR to include caching support for the authorization service and authorization action service. |
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.
Pull Request Overview
This pull request introduces an authorization decision caching mechanism to improve the performance of authorization operations in the Pentaho platform. The PR switches from the legacy IAuthorizationPolicy to a new IAuthorizationService implementation with comprehensive caching support.
- Added authorization decision caching infrastructure with cache invalidation capabilities
- Refactored authorization service to use caching and updated Spring configuration
- Added management endpoints and UI menu items for cache administration
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
core/src/main/java/org/pentaho/platform/engine/security/authorization/core/caching/MemoryAuthorizationDecisionCache.java | New authorization decision cache implementation using Guava cache with session-based invalidation |
core/src/main/java/org/pentaho/platform/engine/security/authorization/core/CachingAuthorizationService.java | Caching wrapper for authorization service that uses the decision cache |
core/src/main/java/org/pentaho/platform/engine/security/authorization/PentahoSystemAuthorizationActionService.java | Refactored service to use plugin manager listener for cache refresh on plugin changes |
assemblies/pentaho-solutions/src/main/resources/pentaho-solutions/system/pentahoObjects.spring.xml | Spring configuration updates to wire caching authorization service and decision cache |
user-console/src/main/java/org/pentaho/mantle/client/commands/PurgeAuthorizationDecisionCacheCommand.java | New GWT command for purging authorization cache via UI |
extensions/src/main/java/org/pentaho/platform/web/http/api/resources/SystemRefreshResource.java | REST endpoint for authorization cache management |
repository/src/main/java/org/pentaho/platform/security/userroledao/jackrabbit/AbstractJcrBackedUserRoleDao.java | Cache invalidation integration for user role changes |
core/src/main/java/org/pentaho/platform/engine/security/SecurityHelper.java | Fixed session resource leak in runAsAnonymous method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...src/main/java/org/pentaho/platform/engine/security/authorization/core/AuthorizationRole.java
Show resolved
Hide resolved
...taho/platform/engine/security/authorization/core/resources/ResourceAuthorizationRequest.java
Show resolved
Hide resolved
...taho/platform/engine/security/authorization/core/resources/ResourceAuthorizationRequest.java
Show resolved
Hide resolved
...taho/platform/engine/security/authorization/core/resources/GenericAuthorizationResource.java
Show resolved
Hide resolved
.../main/java/org/pentaho/platform/engine/security/authorization/core/AuthorizationRequest.java
Show resolved
Hide resolved
Analysis Details10 IssuesCoverage and DuplicationsProject ID: pentaho:pentaho-platform-ce-parent |
Note:Frogbot also supports Contextual Analysis, Secret Detection, IaC and SAST Vulnerabilities Scanning. This features are included as part of the JFrog Advanced Security package, which isn't enabled on your system. |
✅ Build finished in 15h 39m 50sBuild command: mvn clean verify -B -e -Daudit -Djs.no.sandbox -pl \
api,assemblies/pentaho-solutions,assemblies/pentaho-war,core,extensions,repository,user-console 👌 All tests passed! Tests run: 3283, Failures: 0, Skipped: 1 Test Results ℹ️ This is an automatic message |
Please, check each commit for a more local description (title) and set of changes.
Besides actual features, there are a couple of commits dealing with fixes and small performance optimizations.
Issue: https://hv-eng.atlassian.net/browse/PPUC-318
To be merged with:
Copilot Summary
This pull request introduces a new caching mechanism for authorization decisions and refactors how default authorization options are provided. It also updates Spring configuration files to wire up the new cache and related services, improves logging for authorization components, and makes a minor resource management fix in the security helper.
Authorization Decision Caching
IAuthorizationDecisionCache
andIAuthorizationDecisionCacheKey
to support caching of authorization decisions, following a loading cache pattern. [1] [2]authorizationDecisionCache
usingMemoryAuthorizationDecisionCache
in Spring configuration, with configurable expiration and size.Service and Options Refactoring
IAuthorizationOptions.getDefault()
to return a singletonDefaultAuthorizationOptions.INSTANCE
instead of an anonymous inner class, moving the implementation to a dedicated class. [1] [2] [3]Spring Configuration Updates
CachingAuthorizationService
) and to inject the decision cache where needed, including repository and authorization policy beans. [1] [2] [3]Logging Improvements
org.pentaho.platform.engine.security.authorization
at the ERROR level inlog4j2.xml
for better visibility of authorization-related issues.Code Cleanup and Resource Management
SecurityHelper.runAsAnonymous
by ensuring the anonymous session is destroyed after use. Also reordered imports for clarity. [1] [2] [3] [4]These changes collectively improve authorization performance and maintainability, and prepare the platform for more robust security features.