oscerd commented on code in PR #29209:
URL: https://github.com/apache/camel/pull/29209#discussion_r4478339677
##########
components/camel-cyberark-vault/src/main/java/org/apache/camel/component/cyberark/vault/client/impl/ConjurClientImpl.java:
##########
@@ -94,11 +98,11 @@ public String retrieveSecret(String secretId, String
version) {
if (response.statusCode() == 200) {
return response.body();
- } else if (response.statusCode() == 401) {
- // Token expired, re-authenticate and retry
+ } else if (response.statusCode() == 401 && retryOnUnauthorized &&
canReauthenticate()) {
+ // Token expired, re-authenticate and retry once
LOG.debug("Token expired, re-authenticating");
authToken = authenticate();
Review Comment:
Done: `authToken` is now `volatile`, so a token renewed by one call is seen
by the calls on other threads. Two calls that get a 401 at the same time can
each log in once, which is harmless.
_Claude Code on behalf of Andrea Cosentino (oscerd)_
--
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]