Skip to content

[release/13.6] Reject empty OTLP API keys - #20408

Merged
Jose Perez Rodriguez (joperezr) merged 2 commits into
release/13.6from
backport/pr-20363-to-release/13.6
Sep 24, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 2 commits into
release/13.6from
backport/pr-20363-to-release/13.6

Conversation

@aspire-repo-bot

@aspire-repo-bot aspire-repo-bot Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #20363 to release/13.6

/cc James Newton-King (@JamesNK)

Customer Impact

An explicitly empty secondary OTLP API key could allow a request with an empty x-otlp-api-key header to authenticate. This prevents that unintended access while still allowing an unset optional secondary key.

Testing

Dashboard test CI passed on Windows and Linux for this backport; Ubuntu x64 native-AOT Dashboard validation passed. The source PR adds configuration, authentication-handler, and OTLP HTTP endpoint coverage for empty keys and a null optional secondary key.

Risk

Medium. This changes OTLP authentication and startup validation: configurations with explicitly empty keys that were previously accepted will now fail validation; no public API changes.

Regression?

Unknown — please confirm.

Accept a null optional secondary key while asserting that an explicitly empty key fails dashboard options validation.

Co-authored-by: Copilot <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20408

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20408"

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

13 / 99 PR test projects · 2 PR jobs, from 5 changed files.

Selected PR test projects (13 / 99)

Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests

Selected PR jobs (2)

extension-e2e, native-dashboard-validation


How these were chosen — grouped by what changed

⚠️ 11 of the 13 selected test projects come from a single change — src/Aspire.Dashboard/Authentication/OtlpApiKey/OtlpApiKeyAuthenticationHandler.cs.

🔧 src/Aspire.Dashboard/Authentication/OtlpApiKey/OtlpApiKeyAuthenticationHandler.cs (changed source)
→ 11 via the project graph: Aspire.Dashboard.Components.Tests, Aspire.Hosting.Azure.Kubernetes.Tests (3 hops), Aspire.Hosting.Azure.Tests (2 hops), Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

🧪 tests/Aspire.Dashboard.Tests/DashboardOptionsTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/Integration/OtlpHttpServiceTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Tests/OtlpApiKeyAuthenticationHandlerTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Tests

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/Authentication/OtlpApiKey/OtlpApiKeyAuthenticationHandler.cs, src/Aspire.Dashboard/Configuration/ValidateDashboardOptions.cs
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard

Selection computed for commit 9bf9a58.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@joperezr
Jose Perez Rodriguez (joperezr) merged commit 6b0c14f into release/13.6 Sep 24, 2026
302 of 305 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.6 milestone Sep 24, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

✅ No documentation update needed.

Step 5 branch taken: excluded → head_branch_is_backport, title_release_prefix, body_backport_marker, base_branch_is_release

This PR is a backport (of #20363 to release/13.6), so per the workflow rules it is out of scope for docs generation — the user-facing documentation for this change belongs to the original forward PR (#20363) on the default branch, not this backport.

Exclusion reasons from signals.json:

  • head_branch_is_backport — head branch pattern indicates a backport
  • title_release_prefix — title is prefixed [release/13.6]
  • body_backport_marker — PR body states "Backport of Reject empty OTLP API keys #20363 to release/13.6"
  • base_branch_is_release — base ref is release/13.6 (supporting context only, not a standalone trigger)

triggered_signals: none (signal_count = 0; recommendation was docs_optional but is moot since excluded == true overrides it).

No documentation PR was drafted.

David Pine (IEvangelist) pushed a commit that referenced this pull request Oct 1, 2026
Backport of #20363 to release/13.6

/cc @JamesNK

## Customer Impact

An explicitly empty secondary OTLP API key could allow a request with an
empty `x-otlp-api-key` header to authenticate. This prevents that
unintended access while still allowing an unset optional secondary key.

## Testing

Dashboard test CI passed on Windows and Linux for this backport; Ubuntu
x64 native-AOT Dashboard validation passed. The source PR adds
configuration, authentication-handler, and OTLP HTTP endpoint coverage
for empty keys and a null optional secondary key.

## Risk

Medium. This changes OTLP authentication and startup validation:
configurations with explicitly empty keys that were previously accepted
will now fail validation; no public API changes.

## Regression?

Unknown — please confirm.

---------

Co-authored-by: James Newton-King <[email protected]>
Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants