Skip to content

fix: route signed-out sandbox proxy to graphexplorer.microsoft.com#3495

Open
gavinbarron wants to merge 1 commit into
mainfrom
fix/sandbox-calls
Open

fix: route signed-out sandbox proxy to graphexplorer.microsoft.com#3495
gavinbarron wants to merge 1 commit into
mainfrom
fix/sandbox-calls

Conversation

@gavinbarron

Copy link
Copy Markdown
Member

Summary

Updates the sandbox proxy used to fetch Graph data on the Storybook site when users are not signed in, switching from graph.office.net to https://graphexplorer.microsoft.com/api/proxy.

Changes

  • packages/mgt-element/src/mock/MockMiddleware.ts: getBaseUrl() now returns https://graphexplorer.microsoft.com/api/proxy?url= directly. Removed the cdn.graph.office.net endpoint-discovery fetch, the graph.office.net fallback, and the sessionStorage caching (which could otherwise serve a stale host to returning users). Request rewriting (?url= + encodeURIComponent) is unchanged.
  • CSP connect-src allowlists updated to add https://graphexplorer.microsoft.com and remove https://cdn.graph.office.net / https://graph.office.net:
    • .storybook/post-process-index-file.js (main site)
    • .storybook/addons/codeEditorAddon/codeAddon.js (code-editor playground iframe)

Notes

  • MockGraph.create() derives customHosts from getBaseUrl(), so it picks up the new host automatically — no change needed there.

Validation

  • tsc --noEmit on mgt-element passes.
  • Ran the Storybook dev server locally and confirmed signed-out components fetch via https://graphexplorer.microsoft.com/api/proxy?url=... without CSP violations.

Update the signed-out Storybook sandbox proxy to use
https://graphexplorer.microsoft.com/api/proxy. MockMiddleware now
returns this URL directly, removing the graph.office.net endpoint
discovery, fallback, and sessionStorage caching. CSP connect-src
allowlists for the main site and the code-editor playground iframe
are updated to allow the new host and drop the old office.net hosts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gavinbarron gavinbarron requested a review from a team as a code owner July 8, 2026 17:17
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for creating a Pull Request @@gavinbarron.

This is a checklist for the PR reviewer(s) to complete before approving and merging this PR:

  • I have verified a documentation PR has been linked and is approved (or not applicable)
  • I have ran this PR locally and have tested the fix/feature
  • I have verified that stories have been added to storybook (or not applicable)
  • I have tested existing stories in storybook to verify no regression has occured
  • I have tested the solution in at least two browsers (Edge + 1 non-Chromium based browser)

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

📖 The updated storybook is available here

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant