Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

feat: mark safe GraphQL requests #57

Merged
merged 1 commit into from
Oct 18, 2018
Merged

Conversation

chrismwendt
Copy link

I'm planning to support running extensions (e.g. Codecov) on private code even when the repository does not exist on the Sourcegraph instance. Doing so will resolve this issue: https://github.com/sourcegraph/browser-extensions/issues/234#issuecomment-430429015

The browser extension currently blocks all GraphQL requests sent from a private repository to Sourcegraph.com, but it needs to allow e-c-c to send certain GraphQL requests that fetch configuration and extension metadata (e.g. the manifest) in order to run extensions on private repositories. At the same time, it still needs to prevent GraphQL requests that might contain private information (such as repo names) up to Sourcegraph.com.

This PR marks known-safe GraphQL requests so that the browser extension can allow these requests to be sent to the Sourcegraph instance.

Copy link
Member

@sqs sqs left a comment

Choose a reason for hiding this comment

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

Looks good to me for this simple case. Do you anticipate more things needing to circumvent this check?

@chrismwendt
Copy link
Author

Not right now. I covered all existing call sites of queryGraphQL in e-c-c, and future call sites that need to circumvent this check will need to pass true for the mightContainPrivateInfo argument.

@chrismwendt chrismwendt merged commit 01b5a49 into master Oct 18, 2018
@chrismwendt chrismwendt deleted the mark-safe-graphql-requests branch October 18, 2018 02:20
@sourcegraph-bot
Copy link

🎉 This PR is included in version 10.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

3 participants