Skip to content

fix(service-bus): require exact true to enable emulator administration - #40415

Draft
Eldert Grootenboer (EldertGrootenboer) wants to merge 2 commits into
mainfrom
fix/servicebus-emulator-false-flag
Draft

Eldert Grootenboer (EldertGrootenboer) wants to merge 2 commits into
mainfrom
fix/servicebus-emulator-false-flag

Conversation

@EldertGrootenboer

Copy link
Copy Markdown
Member

Problem

ServiceBusAdministrationClient enables HTTP for UseDevelopmentEmulator=false because the parsed value is a nonempty string. The exported parseServiceBusConnectionString() also returns useDevelopmentEmulator: true.

Fix

Require the exact lowercase value true at both sites, matching the existing core-amqp behavior. The default HTTPS transport, explicit emulator ports, and credential-overload HTTPS protections are unchanged.

Applications relying on another value to enable HTTP must set UseDevelopmentEmulator=true.

Testing

  • Added 72 tests covering PUT, GET, list and DELETE transport selection, SAS audience, credential overloads, and parser values, casing, whitespace, duplicates and malformed assignments. The new tests fail before the fix and pass afterward.
  • Node and Chromium unit suites: 472 passed, 6 skipped each.
  • Native build, API extraction, formatting, lint and package-version checks passed.
  • Pinned public emulator 2.0.1: exact true supports queue create/read/list/delete and AMQP send/receive/complete; false and absent flags select HTTPS and fail TLS against the HTTP listener. Explicit port, SAS audience and HMAC signature checks passed.

What changed

  • sdk/servicebus/service-bus/src/serviceBusAtomManagementClient.ts
  • sdk/servicebus/service-bus/src/util/connectionStringUtils.ts
  • sdk/servicebus/service-bus/test/internal/unit/atomAdminClient.spec.ts
  • sdk/servicebus/service-bus/test/internal/unit/connectionString.spec.ts
  • sdk/servicebus/service-bus/package.json
  • sdk/servicebus/service-bus/src/util/constants.ts
  • sdk/servicebus/service-bus/CHANGELOG.md

- Align administration and exported parser with exact-true emulator semantics.
- Preserve secure defaults, explicit ports and SAS signing with regression coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 56e92b5a-ee90-4b51-ac6a-6ccbc18dbdda
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🟢 Approval recommended

The narrow fix has focused regression coverage and no identified blocking issues.

1 open issue
What changed in this PR

Fixes Service Bus emulator opt-in so only the parsed lowercase value true enables HTTP administration and sets the exported emulator flag.

Changes:

  • Replaces truthiness checks with exact comparisons.
  • Adds regression coverage for transport selection, credentials, SAS audience, and parser edge cases.
  • Updates package metadata and release notes to 7.10.1.
File Description
sdk/​servicebus/​service-bus/​test/​internal/​unit/​connectionString.spec.ts Covers emulator flag parsing edge cases.
sdk/​servicebus/​service-bus/​test/​internal/​unit/​atomAdminClient.spec.ts Tests transport selection and credential protections.
sdk/​servicebus/​service-bus/​src/​util/​constants.ts Updates runtime version to 7.10.1.
sdk/​servicebus/​service-bus/​src/​util/​connectionStringUtils.ts Requires exact true for the emulator flag.
sdk/​servicebus/​service-bus/​src/​serviceBusAtomManagementClient.ts Requires exact true to enable HTTP.
sdk/​servicebus/​service-bus/​package.json Bumps package version to 7.10.1.
sdk/​servicebus/​service-bus/​CHANGELOG.md Documents corrected opt-in behavior.

Review effort: Balanced

Comment thread sdk/servicebus/service-bus/CHANGELOG.md Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 56e92b5a-ee90-4b51-ac6a-6ccbc18dbdda

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.

🟢 Approval recommended

The fix is narrowly scoped, includes targeted regression coverage, and has no identified blocking issues.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants