Skip to content

feat(config): update OpenTelemetry OTLP - #164

Merged
foukou19 merged 13 commits into
mainfrom
feat/idp-core-observability-otel-starter
Oct 14, 2026
Merged

foukou19 merged 13 commits into
mainfrom
feat/idp-core-observability-otel-starter

Conversation

@foukou19

@foukou19 foukou19 commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

PR Description

What this PR Provides

  • Webhook JWT_BEARER security: client_id_field now accepts any non-empty
    claim name (client_id, sub, azp, email, or a custom claim) instead of
    only azp or email.
  • Existing connectors using azp or email keep working without
    reconfiguration.
  • Webhook NONE security: config is now optional. You can omit it, pass
    null, or pass {}. A non-empty config is still rejected.
  • A missing configured claim in the incoming JWT now returns 401
    (previously 403). A claim value outside client_id_values still returns
    403.
  • The JWT validator logs the caller identity (webhook_jwt_caller) with the
    result ACCEPTED or REJECTED.
  • OpenTelemetry: library-based setup (no Java agent) with OTLP export of traces
    and metrics configured in application.yml.
  • OpenTelemetry: business attributes on webhook spans
    (idp.webhook.identifier, idp.webhook.security.result,
    idp.webhook.mapping.result) to ease debugging in Datadog.
  • Documentation updated in docs/src/concepts/webhooks.md.

Fixes

Review

The reviewer must double-check these points:

  • The reviewer has tested the feature
  • The reviewer has reviewed the implementation of the feature
  • The documentation has been updated
  • The feature implementation respects the Technical Doc / ADR previously produced
  • The Pull Request title has a ! after the type/scope to identify the breaking
    change in the release note and ensure we will release a major version.

How to test

  • Initial state:
    • A running idp-core instance.
    • The product entity template and the product-mapping entity dynamic
      mapping exist.
    • A JWT issuer exposing a public HTTPS JWKS endpoint.
  • JWT_BEARER with a client_id claim:
    1. 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"
          }
        }
      }
    2. Call POST /webhooks/product with Authorization: Bearer <jwt>.
      The JWT must contain
      "client_id": "C60ee4cXXXXXXXXXXXXXX8ae.

    3. Repeat with client_id_field set to email and azp to check there is
      no regression.

  • Missing claim: call with a JWT without the configured claim.
  • Wrong value: call with a claim value not in client_id_values.
  • Missing header: call without the Authorization header.
  • NONE without config: create or update a webhook with
    {"security": {"type": "NONE"}}, then with "config": null and
    "config": {}.
  • NONE with config: send "config": {"a": "b"}.
  • Observability: set OTEL_EXPORTER_OTLP_ENDPOINT and call a webhook, then
    check the trace attributes in Datadog.
  • Expected results:
    • Valid configurations are accepted (201 on creation, 200 on update).
    • Authenticated calls are processed and log
      webhook_jwt_caller ... result=ACCEPTED.
    • Missing claim or missing header returns 401.
    • Wrong claim value returns 403.
    • NONE with a non-empty config returns 400.
    • Spans carry the three idp.webhook.* attributes.

Breaking changes (if any)

  • Behavior modification of a component

Context of the Breaking Change

For JWT_BEARER, a JWT that does not contain the configured claim now returns
401 Unauthorized instead of 403 Forbidden.

Result of the Breaking Change

Callers or monitoring that relied on 403 for a missing claim must handle
401. A claim value that is present but not allowed still returns 403.

@foukou19
foukou19 force-pushed the feat/idp-core-observability-otel-starter branch from 9cc79e6 to c803b56 Compare October 5, 2026 12:24
@github-code-quality

github-code-quality Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: Java

Java / code-coverage/jacoco

The overall line coverage in commit deb926e in the feat/idp-core-observ... branch remains at 91%, unchanged from commit 75392db in the main branch.

Show a line coverage summary of the most impacted files.
File main 75392db feat/idp-core-observ... deb926e +/-
com/decathlon/i...okSecurity.java 100% 100% 0%
com/decathlon/i...ionService.java 100% 100% 0%
com/decathlon/i...tractDtoIn.java 100% 100% 0%
com/decathlon/i...hookMapper.java 100% 100% 0%
com/decathlon/i...yProcessor.java 100% 100% 0%
com/decathlon/i...ationUtils.java 87% 87% 0%
com/decathlon/i...yValidator.java 87% 89% +2%

Updated October 14, 2026 09:33 UTC

Signed-off-by: foukou19 <ferial.oukoukas@decathlon.com>
@foukou19
foukou19 force-pushed the feat/idp-core-observability-otel-starter branch from c803b56 to b98b630 Compare October 6, 2026 09:32
@foukou19
foukou19 requested a balanced review from Copilot October 7, 2026 08:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Default startup and OTLP header configuration issues can prevent or misroute telemetry exports.

Review effort: Balanced
Findings: 2 Medium severity · 2 Low severity

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 NONE security 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.

Comment thread src/main/resources/application.yml Outdated
@foukou19
foukou19 force-pushed the feat/idp-core-observability-otel-starter branch 3 times, most recently from 6b8f4ed to 6b68405 Compare October 7, 2026 09:24
@foukou19
foukou19 requested a balanced review from Copilot October 7, 2026 09:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity · 3 Medium severity · 3 Low severity

Open (7)
Resolved since last review (2)

Comment thread src/main/resources/application.yml Outdated
Comment thread docs/src/features/webhooks.md Outdated
Comment thread src/main/resources/application.yml Outdated
@foukou19
foukou19 force-pushed the feat/idp-core-observability-otel-starter branch 4 times, most recently from 2c23b12 to 241409d Compare October 7, 2026 14:35
@foukou19
foukou19 requested a balanced review from Copilot October 7, 2026 14:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/main/resources/application.yml Outdated
Comment thread src/main/resources/application.yml Outdated
Comment thread docs/src/deployment/docker.md Outdated
Signed-off-by: foukou19 <ferial.oukoukas@decathlon.com>
@foukou19
foukou19 force-pushed the feat/idp-core-observability-otel-starter branch 2 times, most recently from a0e304e to 76f3ec9 Compare October 7, 2026 16:42
Signed-off-by: foukou19 <ferial.oukoukas@decathlon.com>
@foukou19
foukou19 force-pushed the feat/idp-core-observability-otel-starter branch from ad1f8c8 to e46ae70 Compare October 8, 2026 07:01
Comment thread docs/src/features/webhooks.md Outdated
Co-authored-by: Eve Bernhard <115796475+evebrnd@users.noreply.github.com>
Signed-off-by: ferial OUKOUKAS <75682459+foukou19@users.noreply.github.com>
evebrnd
evebrnd previously approved these changes Oct 9, 2026
Comment thread src/main/resources/application.yml Outdated
Comment thread src/main/resources/application.yml Outdated
Comment thread src/main/resources/application.yml Outdated
Comment thread src/main/resources/application.yml Outdated
Comment thread docs/src/deployment/docker.md Outdated
Signed-off-by: foukou19 <ferial.oukoukas@decathlon.com>
@foukou19
foukou19 force-pushed the feat/idp-core-observability-otel-starter branch from a03ee53 to fee9111 Compare October 13, 2026 09:40
Signed-off-by: foukou19 <ferial.oukoukas@decathlon.com>
@foukou19
foukou19 force-pushed the feat/idp-core-observability-otel-starter branch from c7ecd87 to 92d43ba Compare October 13, 2026 11:25
@foukou19
foukou19 force-pushed the feat/idp-core-observability-otel-starter branch from de81ac2 to cc3b018 Compare October 14, 2026 07:13
brandPittCode
brandPittCode previously approved these changes Oct 14, 2026
Signed-off-by: foukou19 <ferial.oukoukas@decathlon.com>
brandPittCode
brandPittCode previously approved these changes Oct 14, 2026
@foukou19
foukou19 enabled auto-merge (squash) October 14, 2026 09:05
Signed-off-by: foukou19 <ferial.oukoukas@decathlon.com>
@sonarqubecloud

Copy link
Copy Markdown

@foukou19
foukou19 merged commit 3c2d8b7 into main Oct 14, 2026
20 checks passed
@foukou19
foukou19 deleted the feat/idp-core-observability-otel-starter branch October 14, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants