gigi206 opened a new pull request, #10518:
URL: https://github.com/apache/nifi/pull/10518

   ## Summary
   
   Fixes a bug where the `HashiCorpVaultParameterProvider` was caching the 
`VaultCommunicationService` in an instance variable, preventing configuration 
changes from taking effect after the initial fetch. This caused stale vault 
tokens and connection settings to be used even after updating the underlying 
controller service configuration.
   
   ## Related Issue
   
   https://issues.apache.org/jira/browse/NIFI-15208
   
   ## Changes
   
   - Removed private instance variable `vaultCommunicationService` that was 
causing the cache
   - Modified `fetchParameters()` to always retrieve a fresh communication 
service from the context
   - Removed `onPropertyModified()` method as cache invalidation is no longer 
needed
   - The `verify()` method already retrieves a fresh service, so no changes 
were needed there
   
   ## Testing
   
   - ✅ Compiled successfully with Maven
   - ✅ Verified bytecode to ensure cache removal
   - ✅ Tested with Docker Compose + HashiCorp Vault
   - ✅ Verified that configuration changes now take effect immediately
   
   ## Verification
   
   Before this fix:
   1. Initial fetch with valid token → Success
   2. Update token to invalid value in controller service
   3. Second fetch → Still succeeds (uses cached connection - BUG)
   
   After this fix:
   1. Initial fetch with valid token → Success
   2. Update token to invalid value in controller service  
   3. Second fetch → Correctly fails with authentication error
   
   This ensures that configuration changes to the Vault Client Service are 
properly reflected in subsequent parameter fetches without requiring component 
restart.


-- 
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