Skip to content

Commit

Permalink
added documentation for types of role in API keys (#6435)
Browse files Browse the repository at this point in the history
added documentation for types of role in API keys
  • Loading branch information
antblood authored Sep 10, 2020
1 parent 53bcbfd commit c25ca22
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
10 changes: 3 additions & 7 deletions wiki/content/graphql/todo-app-tutorial/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,19 @@ After successfully logging into the site for the first time, your dashboard shou

![Slash-GraphQL: Get Started](/images/graphql/tutorial/todo/slash-graphql-1.png)

Let's go ahead and create a new deployment.
Let's go ahead and launch a new deployment.

![Slash-GraphQL: Create deployment](/images/graphql/tutorial/todo/slash-graphql-2.png)

We named our deployment `todo-app-deployment` and set the optional subdomain as
`todo-app`, using which the deployment will be accessible. We can choose any
subdomain here as long as it is available.

Let's set it up in AWS, in the US region, and click on the *Create Deployment* button.
Let's set it up in AWS, in the US region, and click on the *Launch* button.

![Slash-GraphQL: Deployment created ](/images/graphql/tutorial/todo/slash-graphql-3.png)

While the deployment is spinning up, remember to copy the API key, as the same API key
won't be visible again. Though, you don't need to worry too much about it since you can
create and revoke API keys from the setting page.

Let's also copy the endpoint, which is our GraphQL API endpoint.
Now the backend is ready.

Once the deployment is ready, let's add our schema there (insert your public key) by going to the schema tab.

Expand Down
9 changes: 9 additions & 0 deletions wiki/content/slash-graphql/admin/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ title = "Authentication"

All the APIs documented here require an API token for access. A new API token can be generated from Slash GraphQL by selecting the ["Settings" button](https://slash.dgraph.io/_/settings) from the sidebar, then clicking the Add API Key button. Keep your API key safe, it will not be accessible once you leave the page.

![Slash-GraphQL: Add an API Key ](/images/graphql/tutorial/todo/slash-graphql-4.png)

There are two types of API keys, client and admin.
- **Client API keys** can only be used to perform query, mutation and commit operations.
- **Admin API keys** can be used to perform both client operations and admin operations like drop data, destroy backend, update schema.

<img src="/images/graphql/tutorial/todo/slash-graphql-5.png" alt="Select API Key Role" width="60%">
<br>
<br>
All admin API requests must be authenticated by passing the API token as the 'X-Auth-Token' header to every HTTP request. You can verify that your API token works by using the following HTTP example.

```
Expand Down
Binary file modified wiki/static/images/graphql/tutorial/todo/slash-graphql-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified wiki/static/images/graphql/tutorial/todo/slash-graphql-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified wiki/static/images/graphql/tutorial/todo/slash-graphql-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c25ca22

Please sign in to comment.