Repository navigation
Conversation
9cc79e6 to
c803b56
Compare
Code Coverage OverviewLanguages: Java Java / code-coverage/jacocoThe overall line coverage in commit a0e304e in the Show a line coverage summary of the most impacted files.
Updated |
Signed-off-by: foukou19 <ferial.oukoukas@decathlon.com>
c803b56 to
b98b630
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Default startup and OTLP header configuration issues can prevent or misroute telemetry exports.
Review effort: Balanced
Findings: 2
Open (4)
What changed in this PR
Updates OpenTelemetry export and webhook observability while broadening JWT claim support and allowing omitted configuration for unsecured webhooks.
Changes:
- Adds OTLP tracing/metrics dependencies and configuration.
- Adds webhook security and mapping trace attributes.
- Supports custom JWT identity claims and optional
NONEsecurity configuration.
| File | Description |
|---|---|
pom.xml |
Adds OpenTelemetry and Micrometer dependencies. |
src/main/resources/application.yml |
Configures OTLP exporters and Camel tracing. |
JwtBearerSecurityValidator.java |
Accepts custom identity claims. |
JwtBearerSecurityValidatorTest.java |
Tests custom JWT claims. |
SecurityProcessor.java |
Records webhook security trace attributes. |
IngestionProcessor.java |
Records ingestion mapping outcomes. |
InboundWebhookSecurityContractDtoIn.java |
Makes security config optional. |
WebhookSecurityValidationService.java |
Handles absent NONE configuration. |
WebhookSecurity.java |
Normalizes absent NONE configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| tracing: | ||
| # Tracing is disabled by default and only enabled via environment variables (OTEL_TRACING_ENABLED). | ||
| enabled: false | ||
| enabled: ${OTEL_TRACING_ENABLED:true} |
| public record InboundWebhookSecurityContractDtoIn( | ||
| @NotBlank(message = WEBHOOK_CONNECTOR_SECURITY_TYPE_MANDATORY) String type, | ||
| @NotNull(message = WEBHOOK_CONNECTOR_SECURITY_CONFIG_MANDATORY) Map<String, String> config) { | ||
| Map<String, String> config) { |
6b8f4ed to
6b68405
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Telemetry defaults risk breaking unconfigured deployments, mapping results are lossy, and claimed JWT audit logging is missing.
Review effort: Balanced
Findings: 1
Open (7)
Missing safe defaults for new telemetry configuration placeholders · New Mapping results overwrite the webhook span attribute · New Add structured JWT caller outcome logging · New Tracing defaults to enabled instead of remaining opt-in Indent NONE tab content beneath its marker · New Update deployment docs for management OTLP HTTP configuration · New Add coverage for omitted config normalization
Resolved since last review (2)
| case null, default -> log.warn("Unsupported or null mapping action: {}", mapping.action()); | ||
| } | ||
|
|
||
| Span.current().setAttribute(SPAN_ATTRIBUTE_MAPPING_RESULT, "SUCCESS"); |
| === "NONE" | ||
|
|
||
| ```json | ||
| { | ||
| "type": "NONE" | ||
| } | ||
| ``` | ||
|
|
||
| For `NONE`, you can omit `config`, set it to `null`, or pass `{}`. Any non-empty `config` is rejected. |
| traces: | ||
| export: | ||
| url: ${OTEL_EXPORTER_OTLP_ENDPOINT} | ||
| protocol: ${OTEL_EXPORTER_OTLP_PROTOCOL:http/protobuf} |
2c23b12 to
241409d
Compare
There was a problem hiding this comment.
🟡 Changes recommended
OTLP configuration and multi-mapping telemetry currently produce incorrect or misleading operational behavior.
9 open findings
Use supported Spring Boot OTLP trace properties · New Gate OTLP metrics export behind explicit opt-in · New Mapping results overwrite the webhook span attribute Tracing defaults to enabled instead of remaining opt-in Fix table delimiter spacing for markdownlint · New Add coverage for omitted and null config values · New Update deployment docs for management OTLP HTTP configuration Indent NONE tab content beneath its marker Add coverage for omitted config normalization
2 resolved since last review
🧠 Review effort: Balanced
| traces: | ||
| export: | ||
| url: ${OTEL_EXPORTER_OTLP_ENDPOINT:} | ||
| protocol: ${OTEL_EXPORTER_OTLP_PROTOCOL:http/protobuf} |
| metrics: | ||
| export: | ||
| url: ${OTEL_EXPORTER_OTLP_ENDPOINT:} | ||
| protocol: ${OTEL_EXPORTER_OTLP_PROTOCOL:http/protobuf} |
| public record InboundWebhookSecurityContractDtoIn( | ||
| @NotBlank(message = WEBHOOK_CONNECTOR_SECURITY_TYPE_MANDATORY) String type, | ||
| @NotNull(message = WEBHOOK_CONNECTOR_SECURITY_CONFIG_MANDATORY) Map<String, String> config) { | ||
| Map<String, String> config) { |
There was a problem hiding this comment.
Signed-off-by: foukou19 <ferial.oukoukas@decathlon.com>
bb086c7 to
76f3ec9
Compare
|
a0e304e to
76f3ec9
Compare






PR Description
What this PR Provides
JWT_BEARERsecurity:client_id_fieldnow accepts any non-emptyclaim name (
client_id,sub,azp,email, or a custom claim) instead ofonly
azporemail.azporemailkeep working withoutreconfiguration.
NONEsecurity:configis now optional. You can omit it, passnull, or pass{}. A non-emptyconfigis still rejected.401(previously
403). A claim value outsideclient_id_valuesstill returns403.webhook_jwt_caller) with theresult
ACCEPTEDorREJECTED.and metrics configured in
application.yml.(
idp.webhook.identifier,idp.webhook.security.result,idp.webhook.mapping.result) to ease debugging in Datadog.docs/src/concepts/webhooks.md.Fixes
Review
The reviewer must double-check these points:
!after the type/scope to identify the breakingchange in the release note and ensure we will release a major version.
How to test
productentity template and theproduct-mappingentity dynamicmapping exist.
client_idclaim:Create the connector with
POST /api/v1/inbound_webhooks:{ "identifier": "product", "name": "product", "description": "product connector", "enabled": true, "mapping_identifiers": ["product-mapping"], "security": { "type": "JWT_BEARER", "config": { "jwks_uri": "xxx/ext/JWKS", "client_id_field": "client_id", "client_id_values": "C60ee4cXXXXXXXXXXXXXX8ae" } } }Call
POST /webhooks/productwithAuthorization: Bearer <jwt>.The JWT must contain
"client_id": "C60ee4cXXXXXXXXXXXXXX8ae.Repeat with
client_id_fieldset toemailandazpto check there isno regression.
client_id_values.Authorizationheader.{"security": {"type": "NONE"}}, then with"config": nulland"config": {}."config": {"a": "b"}.OTEL_EXPORTER_OTLP_ENDPOINTand call a webhook, thencheck the trace attributes in Datadog.
201on creation,200on update).webhook_jwt_caller ... result=ACCEPTED.401.403.NONEwith a non-empty config returns400.idp.webhook.*attributes.Breaking changes (if any)
Context of the Breaking Change
For
JWT_BEARER, a JWT that does not contain the configured claim now returns401 Unauthorizedinstead of403 Forbidden.Result of the Breaking Change
Callers or monitoring that relied on
403for a missing claim must handle401. A claim value that is present but not allowed still returns403.