mattcasters commented on PR #8305:
URL: https://github.com/apache/hop/pull/8305#issuecomment-5616308366

   Thanks for the thorough review, @bamaer! All points have been addressed in 
commit `0ed000d716`:
   
   1. **Token Refresh & Re-Authentication on 401/403:**
      - The 30s refresh margin (`REFRESH_MARGIN_MILLIS`) now applies 
unconditionally in `tokenNeedsRefresh()` so non-renewable/batch tokens are 
refreshed before they die.
      - If Vault reports a non-positive lease duration (`leaseSeconds <= 0`), 
the token expiry is set to 30s so it doesn't get cached forever.
      - On a 401/403 auth error during `resolve()`, `invalidateCachedClient()` 
is invoked and re-authentication is attempted once before failing.
      - Covered by unit tests `testNonRenewableTokenRefreshesBeforeExpiry`, 
`testKubernetesAuthFailureRetriesOnce`, and `testTokenAuthFailureDoesNotRetry`.
   
   2. **Clearing Stale Credentials on Auth Type Switch:**
      - `VariableResolverEditor` now triggers `persistContents()` after reading 
widget contents.
      - `clearUnusedCredentials()` clears `vaultToken` when `KUBERNETES` is 
chosen, and clears `kubernetesJwt` when `TOKEN` is chosen (both in the model 
and the UI controls).
      - If `authenticationType` is a variable expression (`${...}`), 
credentials and fields are preserved.
      - Covered by unit tests 
`testClearUnusedCredentialsDropsVaultTokenForKubernetes`, 
`testClearUnusedCredentialsDropsJwtForToken`, and SWT UI tests in 
`VaultWidgetVisibilityTest`.
   
   3. **Locale-Insensitive Enum Parsing:**
      - Updated `parseAuthType()` and `readAuthType()` to use 
`toUpperCase(Locale.ROOT)`.
      - Covered by unit test `testAuthTypeParseUsesRootLocale` under Turkish 
(`tr-TR`) locale.
   
   All unit and UI tests pass, and Spotless is clean.
   


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