Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔓 🐛 safelist cdn scripts in meta tag in landing page #7539

Merged
merged 5 commits into from May 2, 2023

Conversation

mayakoneval
Copy link
Contributor

@mayakoneval mayakoneval commented May 1, 2023

Slack context

Pierre found that in Safari the AS embedded Sandbo str8 up doesn't work ?! How long has this been going on without us knowing? Shocked.

Anyways, we needed to add a CSP for Safari to take these scripts seriously, and I did so via <meta tag. using the nonce option.

To test

Download the apollo-server-typescript code sandbox example & install & run on Safari.

@netlify
Copy link

netlify bot commented May 1, 2023

Deploy Preview for apollo-server-docs ready!

Name Link
🔨 Latest commit 13739eb
🔍 Latest deploy log https://app.netlify.com/sites/apollo-server-docs/deploys/64514ec8b1c74c0008b67c8a
😎 Deploy Preview https://deploy-preview-7539--apollo-server-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 1, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c81f738:

Sandbox Source
Apollo Server Typescript Configuration
Apollo Server Configuration

@mayakoneval mayakoneval force-pushed the maya/04-2023/meta-tags branch 3 times, most recently from 7264de5 to fab9453 Compare May 2, 2023 00:00
@mayakoneval mayakoneval changed the title [WIP] safelist cdn scripts in meta tag in landing page 🔓 🐛 safelist cdn scripts in meta tag in landing page May 2, 2023
@mayakoneval mayakoneval force-pushed the maya/04-2023/meta-tags branch 2 times, most recently from 013a2e8 to 00deed7 Compare May 2, 2023 17:10
…nce (sha256 of a uuid) to validate script tags in <meta
@mayakoneval mayakoneval marked this pull request as ready for review May 2, 2023 17:15
Copy link
Member

@trevor-scheer trevor-scheer left a comment

Choose a reason for hiding this comment

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

LGTM!

packages/server/src/plugin/landingPage/default/index.ts Outdated Show resolved Hide resolved
.changeset/sweet-planets-hang.md Outdated Show resolved Hide resolved
Co-authored-by: Trevor Scheer <trevor.scheer@gmail.com>
@mayakoneval mayakoneval merged commit f7157f4 into apollographql:main May 2, 2023
12 checks passed
@github-actions github-actions bot mentioned this pull request May 2, 2023
trevor-scheer pushed a commit that referenced this pull request May 2, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @apollo/server-integration-testsuite@4.7.1

### Patch Changes

- Updated dependencies
\[[`5d3c45be9`](5d3c45b)]:
    -   @apollo/server@4.7.1

## @apollo/server@4.7.1

### Patch Changes

- [#7539](#7539)
[`5d3c45be9`](5d3c45b)
+ [#7540](#7540)
[`42897532b`](42897532b5b7f691883988a149156a3294ed5404)Thanks
[@mayakoneval](https://github.com/mayakoneval)! - 🐛 Bug Fix for Apollo
Server Landing Pages on Safari. A Content Security Policy was added to
our landing page html so that Safari can run the inline scripts we use
to call the Embedded Sandbox & Explorer.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants