You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "oscerd (via GitHub)" <gi...@apache.org> on 2026/08/27 14:02:42 UTC
[PR] CAMEL-24456: camel-http - key the OAuth2 token cache on every field that shapes the token [camel]
oscerd opened a new pull request, #25834:
URL: https://github.com/apache/camel/pull/25834
Fixes [CAMEL-24456](https://issues.apache.org/jira/browse/CAMEL-24456).
The cache key was the record OAuth2URIAndCredentials(uri, clientId, clientSecret), while
scope, tokenEndpoint and resourceIndicator all influence the token that
getAccessTokenResponse() mints. The map is static, so it is shared by every
OAuth2ClientConfigurer instance and every CamelContext in the JVM.
A route configured with a narrow scope could therefore be handed a broad-scope token that
another route had cached first for the same target and credentials, which defeats the
scoping the operator configured and makes the audit trail misleading. Where several
CamelContexts run in one JVM, a token minted for one could serve another's requests.
Add tokenEndpoint, scope and resourceIndicator to the key. The map stays JVM wide, but a
hit now requires every field of the token request to match, so it is the same token
request by construction; scoping the cache per CamelContext is noted on the issue as a
separate question.
The added test follows the idiom of the tests around it: cache a token, close the token
endpoint, then request the same target with a different scope. A cache hit succeeds, a
miss cannot mint and fails - so without the fix the narrow-scope token is silently reused.
Co-Authored-By: Claude Opus 5 (1M context) <no...@anthropic.com>
Signed-off-by: Andrea Cosentino <an...@gmail.com>
\n## Verification\n\n3 files changed, including 1 test file(s). Module build with \`-am\` is green on current main, no generated-file drift. Verified against the pre-fix code when the change was written.
_Claude Code on behalf of 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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24456: camel-http - key the OAuth2 token cache on every field that shapes the token [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25834:
URL: https://github.com/apache/camel/pull/25834#issuecomment-5442411799
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `components/camel-http`
- `docs`
> :information_source: Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the `test-dependents` label to force testing all dependents.
---
<details><summary>:microscope: Scalpel shadow comparison — Scalpel: 70 tested, 27 compile-only — current: 69 all tested</summary>
[Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **97 affected modules** (current approach: 69).
<details><summary>:warning: Modules only in Scalpel (28)</summary>
- `apache-camel`
- `camel-allcomponents`
- `camel-catalog`
- `camel-catalog-console`
- `camel-catalog-maven`
- `camel-catalog-suggest`
- `camel-componentdsl`
- `camel-csimple-maven-plugin`
- `camel-endpointdsl`
- `camel-endpointdsl-support`
- `camel-itest`
- `camel-jbang-core`
- `camel-jbang-it`
- `camel-jbang-main`
- `camel-jbang-plugin-edit`
- `camel-jbang-plugin-generate`
- `camel-jbang-plugin-kubernetes`
- `camel-jbang-plugin-test`
- `camel-kamelet-main`
- `camel-launcher`
- `camel-report-maven-plugin`
- `camel-route-parser`
- `camel-yaml-dsl`
- `camel-yaml-dsl-deserializers`
- `camel-yaml-dsl-maven-plugin`
- `coverage`
- `docs`
- `dummy-component`
</details>
**Skip-tests mode would test 70 modules** (2 direct + 68 downstream), **skip tests for 27** (generated code, meta-modules)
<details><summary>Modules Scalpel would test (70)</summary>
- `camel-a2a`
- `camel-ai-observability`
- `camel-as2`
- `camel-clickup`
- `camel-consul`
- `camel-cxf-rest`
- `camel-cxf-soap`
- `camel-cxf-spring-rest`
- `camel-cxf-spring-soap`
- `camel-cxf-spring-transport`
- `camel-cxf-transport`
- `camel-graphql`
- `camel-http`
- `camel-java-joor-dsl`
- `camel-jbang-mcp`
- `camel-jbang-plugin-mcp`
- `camel-jbang-plugin-route-parser`
- `camel-jbang-plugin-tui`
- `camel-jbang-plugin-validate`
- `camel-jetty`
- `camel-jsonpath`
- `camel-kamelet`
- `camel-knative-http`
- `camel-kubernetes`
- `camel-langchain4j-chat`
- `camel-langchain4j-embeddings`
- `camel-langchain4j-embeddingstore`
- `camel-launcher-container`
- `camel-lra`
- `camel-mcp-server`
- `camel-micrometer-observability`
- `camel-micrometer-prometheus`
- `camel-netty-http`
- `camel-oauth`
- `camel-observability-services`
- `camel-openai`
- `camel-openapi-validator`
- `camel-opentelemetry`
- `camel-opentelemetry2`
- `camel-platform-http`
- `camel-platform-http-jolokia`
- `camel-platform-http-main`
- `camel-platform-http-vertx`
- `camel-quickfix`
- `camel-rest-openapi`
- `camel-rest-postman`
- `camel-restdsl-openapi-plugin`
- `camel-sap-netweaver`
- `camel-slack`
- `camel-soap`
- `camel-spring-rabbitmq`
- `camel-state-store`
- `camel-telegram`
- `camel-telemetry`
- `camel-telemetry-dev`
- `camel-test-main-junit5`
- `camel-test-main-junit6`
- `camel-undertow`
- `camel-undertow-spring-security`
- `camel-vertx-http`
- `camel-webhook`
- `camel-whatsapp`
- `camel-xml-io-dsl`
- `camel-xml-jaxb-dsl`
- `camel-xml-jaxb-dsl-test-definition`
- `camel-xml-jaxb-dsl-test-spring`
- `camel-yaml-dsl-validator`
- `camel-yaml-dsl-validator-maven-plugin`
- `camel-zookeeper`
- `docs`
</details>
<details><summary>Modules with tests skipped (27)</summary>
- `apache-camel`
- `camel-allcomponents`
- `camel-catalog`
- `camel-catalog-console`
- `camel-catalog-maven`
- `camel-catalog-suggest`
- `camel-componentdsl`
- `camel-csimple-maven-plugin`
- `camel-endpointdsl`
- `camel-endpointdsl-support`
- `camel-itest`
- `camel-jbang-core`
- `camel-jbang-it`
- `camel-jbang-main`
- `camel-jbang-plugin-edit`
- `camel-jbang-plugin-generate`
- `camel-jbang-plugin-kubernetes`
- `camel-jbang-plugin-test`
- `camel-kamelet-main`
- `camel-launcher`
- `camel-report-maven-plugin`
- `camel-route-parser`
- `camel-yaml-dsl`
- `camel-yaml-dsl-deserializers`
- `camel-yaml-dsl-maven-plugin`
- `coverage`
- `dummy-component`
</details>
> :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
</details>
<details><summary>Build reactor — dependencies compiled but only changed modules were tested (97 modules)</summary>
- Camel :: AI :: A2A
- Camel :: AI :: LangChain4j :: Chat
- Camel :: AI :: LangChain4j :: Embedding
- Camel :: AI :: LangChain4j :: EmbeddingStore
- Camel :: AI :: MCP Server
- Camel :: AI :: Observability
- Camel :: AI :: OpenAI
- Camel :: AS2 :: Component
- Camel :: All Components Sync point
- Camel :: Assembly
- Camel :: CXF :: REST
- Camel :: CXF :: REST :: Spring
- Camel :: CXF :: SOAP
- Camel :: CXF :: SOAP :: Spring
- Camel :: CXF :: Transport
- Camel :: CXF :: Transport :: Spring
- Camel :: Catalog :: CSimple Maven Plugin (deprecated)
- Camel :: Catalog :: Camel Catalog
- Camel :: Catalog :: Camel Report Maven Plugin
- Camel :: Catalog :: Camel Route Parser
- Camel :: Catalog :: Console
- Camel :: Catalog :: Dummy Component
- Camel :: Catalog :: Maven
- Camel :: Catalog :: Suggest
- Camel :: ClickUp
- Camel :: Common Telemetry
- Camel :: Component DSL
- Camel :: Consul
- Camel :: Coverage
- Camel :: Docs
- Camel :: Endpoint DSL
- Camel :: Endpoint DSL :: Support
- Camel :: GraphQL
- Camel :: HTTP
- Camel :: Integration Tests
- Camel :: JBang :: Core
- Camel :: JBang :: Integration tests
- Camel :: JBang :: MCP
- Camel :: JBang :: Main
- Camel :: JBang :: Plugin :: Edit
- Camel :: JBang :: Plugin :: Generate
- Camel :: JBang :: Plugin :: Kubernetes
- Camel :: JBang :: Plugin :: MCP
- Camel :: JBang :: Plugin :: Route Parser
- Camel :: JBang :: Plugin :: TUI
- Camel :: JBang :: Plugin :: Testing
- Camel :: JBang :: Plugin :: Validate
- Camel :: JSon Path
- Camel :: Java DSL with jOOR
- Camel :: Jetty
- Camel :: Kamelet
- Camel :: Kamelet Main
- Camel :: Knative HTTP
- Camel :: Kubernetes
- Camel :: Launcher
- Camel :: Launcher :: Container
- Camel :: Long-Running-Action
- Camel :: Maven Plugins :: OpenApi REST DSL Generator
- Camel :: Micrometer :: Observability 2
- Camel :: Micrometer :: Prometheus
- Camel :: Netty HTTP
- Camel :: OAuth
- Camel :: Observability Services
- Camel :: OpenAPI :: Validator
- Camel :: OpenTelemetry (deprecated)
- Camel :: Opentelemetry 2
- Camel :: Platform HTTP
- Camel :: Platform HTTP :: Jolokia
- Camel :: Platform HTTP :: Main
- Camel :: Platform HTTP :: Vert.x
- Camel :: QuickFIX/J
- Camel :: REST OpenApi
- Camel :: REST Postman
- Camel :: SAP NetWeaver
- Camel :: SOAP
- Camel :: Slack
- Camel :: Spring RabbitMQ
- Camel :: State Store
- Camel :: Telegram
- Camel :: Telemetry :: Dev
- Camel :: Test :: Main :: JUnit5
- Camel :: Test :: Main :: JUnit6
- Camel :: Undertow
- Camel :: Undertow Spring Security
- Camel :: Vert.x :: HTTP
- Camel :: Webhook
- Camel :: Whatsapp
- Camel :: XML DSL Jaxb :: Test :: Definition
- Camel :: XML DSL Jaxb :: Test :: Spring
- Camel :: XML DSL with camel-xml-io
- Camel :: XML DSL with camel-xml-jaxb
- Camel :: YAML DSL
- Camel :: YAML DSL :: Deserializers
- Camel :: YAML DSL :: Maven Plugins
- Camel :: YAML DSL :: Validator
- Camel :: YAML DSL :: Validator Maven Plugin
- Camel :: Zookeeper
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/33086161301)
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24456: camel-http - key the OAuth2 token cache on every field that shapes the token [camel]
Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway merged PR #25834:
URL: https://github.com/apache/camel/pull/25834
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-24456: camel-http - key the OAuth2 token cache on every field that shapes the token [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #25834:
URL: https://github.com/apache/camel/pull/25834#issuecomment-5442098313
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org