Skip to content

Clear REST user cache when invalidating user cache#17250

Open
LJW21-02 wants to merge 2 commits intoapache:masterfrom
LJW21-02:feat_clear_rest_user_cache
Open

Clear REST user cache when invalidating user cache#17250
LJW21-02 wants to merge 2 commits intoapache:masterfrom
LJW21-02:feat_clear_rest_user_cache

Conversation

@LJW21-02
Copy link
Contributor

@LJW21-02 LJW21-02 commented Mar 4, 2026

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] [2]

Configuration Resolution Enhancement:

  • Updated IoTDBRestServiceDescriptor to check for the CONFIGNODE_HOME environment variable when resolving configuration file locations, improving flexibility in deployment environments. [1] [2] [3]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant