Skip to content

include app-bridge asset in the script-src csp directive#1995

Closed
fresh-eggs wants to merge 1 commit intomainfrom
script-src-ext
Closed

include app-bridge asset in the script-src csp directive#1995
fresh-eggs wants to merge 1 commit intomainfrom
script-src-ext

Conversation

@fresh-eggs
Copy link

@fresh-eggs fresh-eggs commented Sep 9, 2025

What this PR does

This gem requires an asset that is hosed oncdn.shopify.com:

https://cdn.shopify.com/shopifycloud/app-bridge.js

For applications that enforce a strict ContentSecurityPolicy, the asset is unlikely to be listed as a permitted script-src .

Rails offers controller APIs to add per-request exceptions to a global policy.

Applications could add exceptions to the controllers included by this gem but it would be best if the gem includes them itself. (similar pattern in maintenance_tasks gem)

Reviewer's guide to testing

This change ensures that the script-src directive on the ContentSecurityPolicy response header served by this gem's controllers include the additional value:

https://cdn.shopify.com/shopifycloud/app-bridge.js

Checklist

Before submitting the PR, please consider if any of the following are needed:

  • Update CHANGELOG.md if the changes would impact users
  • Update README.md, if appropriate.
  • Update any relevant pages in /docs, if necessary
  • For security fixes, the Disclosure Policy must be followed.

@fresh-eggs fresh-eggs force-pushed the script-src-ext branch 2 times, most recently from b8728b3 to 1a232ea Compare September 16, 2025 13:24
@fresh-eggs fresh-eggs marked this pull request as ready for review September 16, 2025 13:24
@fresh-eggs fresh-eggs requested a review from a team as a code owner September 16, 2025 13:24
@fresh-eggs fresh-eggs marked this pull request as draft September 16, 2025 13:26
@fresh-eggs
Copy link
Author

#1997

@fresh-eggs fresh-eggs closed this Sep 23, 2025
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.

1 participant