gnodet commented on PR #31106:
URL: https://github.com/apache/camel/pull/31106#issuecomment-7280868928

   Thanks @davsclaus and @oscerd for the thorough review!
   
   **Addressed in commit 03a47f0:**
   
   **HuggingFace** — reverted the per-request refresh entirely. You are right: 
`config.getAuthToken()` is only read by `AbstractTaskPredictor.modelOptions()` 
from `loadModel()` in `doStart()`, so the `process()` write was a no-op and 
added an unnecessary IdP dependency at inference time. The startup-time 
resolution is kept, and the Javadoc now explains that the token is only used 
for model download (passed as `HF_TOKEN` to the DJL Python process) and is not 
needed once the model is loaded. The `HuggingFaceOAuthTokenRefreshTest` and its 
`StubHuggingFaceOAuthFactory` have been dropped.
   
   **Docling — `API_KEY + oauthProfile` double-header (your explicit 
question)** — yes, this is intentional. When both are configured, the 
`X-Api-Key` header goes out from the static `authenticationToken` and 
`Authorization: Bearer` from the per-request OAuth supplier. The docs already 
say *"authenticationScheme is automatically set to BEARER"* for the OAuth path, 
but that only applies when the scheme was at its default. Setting `API_KEY` 
explicitly alongside `oauthProfile` is a misconfiguration that sends both 
headers; a code comment was added to make this explicit. If you would prefer a 
validation failure at start for this combination, I can add that.
   
   **Other docling points** — all addressed in the same commit: 
`docling-serve.adoc` updated to describe per-request supplier (not 
`authenticationToken` storage), lazy-failure note added, `LOG.info` now logs 
`BEARER (OAuth, profile=..., per-request)` when `oauthProfile` is set, unused 
`currentToken()` removed from the stub factory.


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