Skip to content

Make extensions.gallery.authProvider policy-controlled - #333837

Open
Michael Cummings (MSFT) (mcumming) wants to merge 2 commits into
microsoft:mainfrom
mcumming:dev/mcumming/entra-auth-provider-policy
Open

Make extensions.gallery.authProvider policy-controlled#333837
Michael Cummings (MSFT) (mcumming) wants to merge 2 commits into
microsoft:mainfrom
mcumming:dev/mcumming/entra-auth-provider-policy

Conversation

@mcumming

Copy link
Copy Markdown

Follow-up to #325331 — makes the marketplace auth provider setting admin-manageable.

Why

#325331 added the extensions.gallery.authProvider setting (github | microsoft) to select how VS Code authenticates against a configured Private Marketplace. The setting shipped without a policy binding, so an administrator who manages extensions.gallery.serviceUrl by policy has no matching way to pin the auth provider — the two settings that together define marketplace access were only half manageable.

This adds the missing policy so ExtensionGalleryAuthProvider can be set alongside the existing ExtensionGalleryServiceUrl policy.

What changes

  • extensions.contribution.ts — adds a policy block to the extensions.gallery.authProvider registration, mirroring the extensions.gallery.serviceUrl policy directly above it. Name ExtensionGalleryAuthProvider, PolicyCategory.Extensions, minimumVersion: '1.137'. It reuses the setting's existing localize keys for the description and both enum descriptions, so no new strings are introduced.
  • build/lib/policies/policyData.jsonc — regenerated. This file is not hand-edited; it was produced by npm run export-policy-data per .github/skills/policy-and-managed-settings/.

StringEnumPolicy.from() requires localization.enumDescriptions to be present and exactly as long as enum, which is why both enum descriptions are declared explicitly. renderJsonValue()/renderProfileValue() use enum[0] as the ADMX/profile default — github is first, matching the setting's own default: 'github'.

minimumVersion is 1.137 from the root package.json (1.137.0), consistent with the other in-flight policies already at 1.137.

Testing

  • npm run typecheck-client — clean
  • node --test build/lib/test/policyConversion.test.ts — 10/10, including "should successfully parse the checked-in policyData.jsonc"
  • node build/lib/policies/exportPolicyData.ts --check"Policy data is synchronized", the same path the blocking policyExport.integrationTest.ts uses. Re-running the export was idempotent (no unrelated churn).

The setting keeps included: false, so this is inert for anyone not configuring a Private Marketplace.

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

Adds an `ExtensionGalleryAuthProvider` policy to the
`extensions.gallery.authProvider` setting so administrators can manage
which authentication provider is used for the Extensions Marketplace,
matching the neighbouring `extensions.gallery.serviceUrl` setting.

Since the setting is a string enum, the policy declares one localized
`enumDescriptions` entry per value, reusing the existing nls keys.

Regenerated build/lib/policies/policyData.jsonc via
`npm run export-policy-data`.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 1, 2026 19:08

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

Review tier: Balanced
Findings: None

What changed in this PR

Adds enterprise policy control for the Private Marketplace authentication provider.

Changes:

  • Registers ExtensionGalleryAuthProvider as an Extensions policy.
  • Regenerates synchronized policy data with both provider options.
File Description
src/​vs/​workbench/​contrib/​extensions/​browser/​extensions.contribution.ts Adds policy metadata and localized enum descriptions.
build/​lib/​policies/​policyData.jsonc Adds the generated policy catalog entry.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

5 participants