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

Add support for configuring auth provider in Directive #62

Merged
merged 8 commits into from
Aug 3, 2021

Conversation

cohix
Copy link
Contributor

@cohix cohix commented Jul 30, 2021

This PR exposes Reactr's AuthProvider as config in the Directive. It allows you to set auth headers for particular domains such that GraphQL and HTTP calls made by Runnables get the appropriate headers to authenticate.

This includes the ability to get auth values from the environment:

authentication:
  domains:
    api.github.com:
      headertype: bearer
      value: env(GITHUB_TOKEN)

To test this PR:

  • build the example project: subo build ./example-project
  • Get a GitHub personal access token from your account and run export GITHUB_TOKEN={your token}
  • Run make atmo bundle=./example-project/runnables.wasm.zip and then call GET /github

The output should be some information about the Reactr repo (GitHub's GraphQL endpoint requires authentication, and it's being provided by the directive configuration)

Closes #34

@cohix cohix linked an issue Jul 30, 2021 that may be closed by this pull request
@cohix cohix changed the base branch from connor/streams-nats to main August 3, 2021 15:09
@cohix cohix merged commit 2e0bd56 into main Aug 3, 2021
@arbourd arbourd deleted the connor/auth-provider branch May 5, 2022 15:20
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.

GraphQL connection support
1 participant