LJW21-02 opened a new pull request, #17250:
URL: https://github.com/apache/iotdb/pull/17250

   This pull request introduces a mechanism to clear cached user authentication 
data in the REST external service when a user's permissions are invalidated, 
ensuring that permission changes take effect immediately across all service 
endpoints. It also improves configuration file resolution by considering an 
additional environment variable. The most important changes are grouped below:
   
   **User Cache Invalidation Integration:**
   
   * Added a new static method `clearUserCache(String userName)` to 
`RestService` to allow clearing a specific user's cache from outside the REST 
service.
   * Implemented `clearUserCache(String userName)` in `UserCache` to remove 
cached entries for the specified user.
   * Modified `AuthorityChecker.invalidateCache` to invoke REST user cache 
invalidation by dynamically locating and calling the `clearUserCache` method 
via reflection, if the REST service is running. This ensures that user 
permission changes are immediately reflected in the REST service.
   * Added logging and error handling for the dynamic invocation of the cache 
clearing method in `AuthorityChecker`. 
[[1]](diffhunk://#diff-33c0ce2366413f1cdb601f05c8366dd8493d6ee16589f8a410740c120b274bd6R88-R89)
 
[[2]](diffhunk://#diff-33c0ce2366413f1cdb601f05c8366dd8493d6ee16589f8a410740c120b274bd6R66-R70)
   
   **Configuration Resolution Enhancement:**
   
   * Updated `IoTDBRestServiceDescriptor` to check for the `CONFIGNODE_HOME` 
environment variable when resolving configuration file locations, improving 
flexibility in deployment environments. 
[[1]](diffhunk://#diff-8ff1294ea2f12c7c439ce9c0073c099b068820b4843e755358126995f012526eR138-R141)
 
[[2]](diffhunk://#diff-8ff1294ea2f12c7c439ce9c0073c099b068820b4843e755358126995f012526eL147-R158)
 
[[3]](diffhunk://#diff-ad67084adfc1d5a0270235a5a57753675d9134e129dc36cb6bcc81340a346578R130)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to