CAMEL-24373: camel-alibaba: Enhance EventBridge validation, multi-bus DSL, and documentation - #26010
Conversation
DSL, and documentation - Implement 3-level hierarchical event validation (EventBus -> EventSource -> EventType) in camel-alibaba-eventbridge. - Introduce EventSourceCache for Alibaba Cloud metadata caching with configurable TTL. - Add support for allowedEventSources configuration across single-bus shorthand DSL, multi-bus DSL, JSON string schema, and Java records (AllowedEventBus, AllowedEventSource). - Add MapCloudEventValidator to enforce CloudEvents 1.0 specification constraints and map Alibaba dictionary keys. - Unify ClientConfigurations and credential resolution across camel-alibaba-fc, camel-alibaba-kms, camel-alibaba-mns, camel-alibaba-oss, and camel-alibaba-sms. - Update component and catalog documentation with single-bus, multi-bus, and JSON configuration examples. - Add unit tests in MapCloudEventValidationTest with 100% pass rate. Co-authored-by: Antigravity <antigravity@google.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
Hi @arunsrajan thanks for the PR! There are uncommitted changes, and I think this PR need to be rebased on main |
✅ Generated files are up to dateAn earlier CI run reported uncommitted generated changes; the latest run no longer does. |
|
@Croway here is a PR to try your new feature ^^^ |
Done! as reported by the bot I've just executed and 43999d8 was applied, seems like it is working |
|
[15:11:46.267] WARN (asciidoctor): list item index: expected 2, got 1 |
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 20 tested, 24 compile-only — current: 17 all testedMaveniverse Scalpel detected 44 affected modules (current approach: 17).
|
|
there are some doc validation errors that must be fixed |
Code review — CAMEL-24373 EventBridge validation (Bugbot + security + test coverage)AI-generated review on behalf of @atiaomar1978-hub Thanks @arunsrajan for a substantial improvement to Verdict: Request changes (approve in principle once blockers are fixed)CI status
Bugbot findings (correctness)
Security reviewPer Camel's security model, route authors are trusted; untrusted ingress is the main concern.
Recommendation: Document fail-open behaviour and header override semantics in the component doc. Add an upgrade-guide entry for Test coveragePresent (good): Gaps to consider:
Scope noteThe Required before merge
Inline commentsPosted 10 review threads on: Happy to re-review once the docs fix and validation semantics are addressed. |
…w feedback Special thanks to the reviewer @atiaomar1978-hub and the Apache Camel committers for the thorough review and valuable suggestions. - Fail-closed Cloud Validation: Updated EventSourceCache to fail-closed on Alibaba Cloud API connectivity/permission errors and missing metadata. - Prefix Rule Matching: Added prefix pattern matching ({"prefix": "..."}) support for event sources and event types in Alibaba Cloud rule filter patterns. - Dynamic Cache TTL: Passed effective per-message TTL from ClientConfigurations to EventSourceCache to support per-exchange TTL header overrides. - Direct CloudEvent Validation: Added validateCloudEvent(...) for direct CloudEvent object whitelist validation. - Documentation & Upgrade Guide: Added untrusted ingress security guidance, fixed AsciiDoc list formatting, synced catalog docs, and added camel-alibaba-eventbridge section to the 4.23 upgrade guide. - Regenerated Artifacts: Regenerated and committed catalog JSON and Endpoint DSL Java builder (AlibabaEventBridgeEndpointBuilderFactory). - Test Coverage: Added unit tests covering fail-closed API failures, prefix rule matching, TTL overrides, and non-standard spec bypass. Verified test suites across all Alibaba modules (EventBridge, FC, KMS, MNS, OSS, SMS). Co-authored-by: Antigravity <noreply@google.com>
…rror - Synchronize catalog documentation mirror with component documentation. - Ensures all AsciiDoc formatting updates and security guidelines are mirrored in camel-catalog. Co-authored-by: Antigravity <noreply@google.com>
|
can you fix the last upgrade guide merge conflict, thanks |
|
@davsclaus I have fixed the merge conflicts, thanks. |
|
thanks |
gnodet
left a comment
There was a problem hiding this comment.
Good work on this comprehensive enhancement — the hierarchical event validation with caching, the fail-closed validation semantics, and the 19 test cases in MapCloudEventValidationTest are well done. The upgrade guide entry for validateEventSpec defaulting to true is also appreciated.
A few issues to consider (3 confirmed findings after independent verification, 4 initially flagged items were determined to be false positives):
📋 PR Metadata
| Aspect | Current | Suggested |
|---|---|---|
| Milestone | (none) | 4.23.0 |
| Labels | components, catalog, docs, dsl | + enhancement |
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
…rom @gnodet Address PR apache#26010 review feedback from @gnodet: - ServiceKeys Compatibility: Revert ServiceKeys from a Java record back to a mutable class with getters/setters and default/all-args constructors. This preserves PropertyBindingSupport nested property binding (e.g. serviceKeys.accessKey=xxx) and Spring Boot auto-configuration across all 8 Alibaba components. - Credential Resolution: Update OpenApiClientSupport, OSSUtils, and MNSUtils to use getAccessKey() and getSecretKey(). - DSL Colon Fallback Fix: Remove colon-based fallback in AlibabaEventBridgeUtils.parseSourcesBlock to ensure source URIs containing scheme colons or port numbers (e.g. http://example.com:8080/events, urn:custom:source) are not inadvertently split. Mapping to event types is now performed exclusively via -> and =. - Unit Tests: Add testSingleBusDslWithHttpUriAndPort and testSingleBusDslWithUrnAndEquals in MapCloudEventValidationTest; resolve type inference in SLS and OTS test assertions. - Documentation & Catalog: Update alibaba-eventbridge-component.adoc and synchronize the catalog documentation mirror in camel-catalog. Co-authored-by: Antigravity <noreply@google.com>
Description
This pull request enhances the 'camel-alibaba-eventbridge' component by introducing hierarchical event validation, an in-memory TTL event source cache, multi-bus and single-bus DSL configuration for allowed event sources, and comprehensive documentation updates across 'camel-alibaba-eventbridge' and 'camel-catalog'.
Fixes https://issues.apache.org/jira/browse/CAMEL-24373
Motivation
When publishing events via Alibaba Cloud EventBridge, applications often need to:
Modifications:
1. 'camel-alibaba-eventbridge':
2. 'camel-alibaba-common' & other Alibaba modules:
3. Documentation:
Co-authored-by: Antigravity antigravity@google.com