Skip to content

Commit

Permalink
Merge pull request #228 from Infisical/expand-open-api
Browse files Browse the repository at this point in the history
Add images to API reference authentication for getting API keys and n…
  • Loading branch information
dangtony98 authored Jan 16, 2023
2 parents 818efe6 + da251d3 commit 1b16066
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 22 deletions.
7 changes: 7 additions & 0 deletions docs/api-reference/endpoints/secrets/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
title: "Create"
openapi: "POST /api/v2/secrets/"
---

<Tip>
Using this route requires understanding Infisical's system and cryptography.
It may be helpful to read through the
[introduction](/api-reference/overview/introduction) and [guide for creating
secrets](/api-reference/overview/examples/create-secrets).
</Tip>
7 changes: 7 additions & 0 deletions docs/api-reference/endpoints/secrets/read.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
title: "Retrieve"
openapi: "GET /api/v2/secrets/"
---

<Tip>
Using this route requires understanding Infisical's system and cryptography.
It may be helpful to read through the
[introduction](/api-reference/overview/introduction) and [guide for retrieving
secrets](/api-reference/overview/examples/retrieve-secrets).
</Tip>
7 changes: 7 additions & 0 deletions docs/api-reference/endpoints/secrets/update.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
title: "Update"
openapi: "PATCH /api/v2/secrets/"
---

<Tip>
Using this route requires understanding Infisical's system and cryptography.
It may be helpful to read through the
[introduction](/api-reference/overview/introduction) and [guide for updating
secrets](/api-reference/overview/examples/update-secrets).
</Tip>
10 changes: 7 additions & 3 deletions docs/api-reference/overview/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
title: "Authentication"
---

To authenticate requests with Infisical, you must include an API key in the `X-API-KEY` header of HTTP requests made to the platform. You can obtain an API key from your user settings.
To authenticate requests with Infisical, you must include an API key in the `X-API-KEY` header of HTTP requests made to the platform. You can obtain an API key in User Settings > API Keys

![API key dashboard](../../images/api-key-dashboard.png)
![API key in personal settings](../../images/api-key-settings.png)
![Adding an API key](../../images/api-key-add.png)

<Info>
It's important to keep your API key secure, as it grants access to your
secrets in Infisical. For added security, consider rotating your API key on a
regular basis.
secrets in Infisical. For added security, set a reasonable expiration time and
rotate your API key on a regular basis.
</Info>
6 changes: 3 additions & 3 deletions docs/api-reference/overview/examples/create-secrets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Prerequisites:

## Flow

1. Get your (encrypted) private key.
1. [Get your (encrypted) private key](/api-reference/endpoints/users/me).
2. Decrypt your (encrypted) private key with your password.
3. Get the (encrypted) project key for the project.
3. [Get the (encrypted) project key for the project.](/api-reference/endpoints/workspaces/workspace-key)
4. Decrypt the (encrypted) project key with your private key.
5. Encrypt your secret(s) with the project key.
6. Send (encrypted) secret(s) to the Infical API
6. [Send (encrypted) secret(s) to the Infical API](/api-reference/endpoints/secrets/create)

## Example

Expand Down
6 changes: 3 additions & 3 deletions docs/api-reference/overview/examples/retrieve-secrets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Prerequisites:

## Flow

1. Get your (encrypted) private key.
1. [Get your (encrypted) private key.](/api-reference/endpoints/users/me)
2. Decrypt your (encrypted) private key with your password.
3. Get the (encrypted) project key for the project.
3. [Get the (encrypted) project key for the project.](/api-reference/endpoints/workspaces/workspace-key)
4. Decrypt the (encrypted) project key with your private key.
5. Get secrets for a project and environment.
5. [Get secrets for a project and environment.](/api-reference/endpoints/secrets/read)
6. Decrypt the (encrypted) secrets

## Example
Expand Down
8 changes: 4 additions & 4 deletions docs/api-reference/overview/examples/update-secrets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Prerequisites:

## Flow

1. Get your (encrypted) private key.
1. [Get your (encrypted) private key.](/api-reference/endpoints/users/me)
2. Decrypt your (encrypted) private key with your password.
3. Get the project key for the project.
4. Decrypt the project key with your private key.
3. [Get the (encrypted) project key for the project.](/api-reference/endpoints/workspaces/workspace-key)
4. Decrypt the (encrypted) project key with your private key.
5. Encrypt your secret(s) with the project key.
6. Send (encrypted) updated secret(s) to the Infical API
6. [Send (encrypted) updated secret(s) to the Infical API.](/api-reference/endpoints/secrets/update)

## Example

Expand Down
14 changes: 5 additions & 9 deletions docs/api-reference/overview/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
title: "Introduction"
---

<Warning>
Infisical's REST API is currently unavailable and scheduled to go live on Jan
16!
</Warning>

Infisical's REST API provides users an alternative way to programmatically access and manage
secrets via HTTPS requests. This can be useful for automating tasks, such as
rotating credentials, or for integrating secret management into a larger system.
Expand All @@ -24,8 +19,9 @@ Using Infisical's API to manage secrets requires a basic understanding of the sy
- Infisical uses AES256-GCM and [TweetNaCl.js](https://tweetnacl.js.org/#/) for symmetric and asymmetric encryption/decryption operations.

<Info>
Infisical's system ensures greater security such that secrets are
encrypted/decrypted on the client-side but requires users to properly
implement cryptographic operations to maintain end-to-end encryption (E2EE).
We're
Infisical's system requires that secrets be encrypted/decrypted on the
client-side to maintain E2EE. We strongly recommend you read up on the system
prior to using the Infisical API. The (opt-in) ability to retrieve secrets
back in decrypted format if you choose to share secrets with Infisical is on
our roadmap.
</Info>
Binary file added docs/images/api-key-add.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 added docs/images/api-key-dashboard.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 added docs/images/api-key-settings.png
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 1b16066

Please sign in to comment.