Skip to content

Commit 6b2f3e9

Browse files
committed
structure, markup, and mechanics
1 parent d5f581c commit 6b2f3e9

File tree

5 files changed

+75
-92
lines changed

5 files changed

+75
-92
lines changed

fern/docs/pages/references/keyrings/developer_keyring.mdx

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,38 @@
1-
Developer Keyrings - For Development Workflows
1+
In addition to keyrings for storing user or organization credentials, DevRev also offers a special type called developer keyrings. These keyrings cater specifically to developers during the snap-in creation process.
22

3-
While the previous pages focused on keyrings used to store user or organization credentials, DevRev also offers a special type called developer keyrings. These keyrings cater specifically to developers during the creation process.
3+
Unlike other keyrings that store user credentials, developer keyrings are designed to hold sensitive information needed by the developer during development and execution of any particular task. These secrets are provided by you, the developer, during the creation of a snap-in version. They are not exposed to users and are stored separately from the snap-in itself.
44

5-
* Unlike other keyrings that store user credentials, developer keyrings are designed to hold sensitive information needed by the developer during development and execution of any particular task.
6-
* These secrets are provided by you, the developer, during the creation of a snap_in version. They are not exposed to users and are stored separately from the snap_in itself.
5+
## Snap-in secrets
76

8-
**Types of Developer Keyrings:**
7+
A `snap_in_secret` is a simple way to store any plain text secret your snap_in requires. It's ideal for sensitive information that doesn't require complex formatting.
98

10-
* **snap_in_secret:** This is a simple way to store any plain text secret your snap_in requires. It's ideal for sensitive information that doesn't require complex formatting.
11-
* **oauth_secret:** This type of keyring is specifically designed to store OAuth client credentials securely. It allows you to define two separate fields:
12-
* client_id: The client ID provided by the OAuth provider.
13-
* client_secret: The client secret provided by the OAuth provider.
9+
To create a snap-in secret in the UI, go to the snap-in page **Connection** tab and find the `snap_in_secret` keyring type.
1410

15-
Creating a Developer Keyring
11+
To create a snap-in secret with the CLI, ruun the following command:
1612

17-
To create a developer keyring, follow these steps:
13+
```bash
14+
echo \"[<SECRET>]\" | devrev developer_keyring create snap-in-secret <KEYRING NAME>
15+
```
16+
17+
## OAuth secrets
1818

19-
1. creating a keyring type of snap_in_secret:
20-
* Using the UI:
21-
Navigate to the Snap-in page, click on the connection tab, and then find the snap_in_secret keyring type.
22-
* Using the CLI:
23-
Run the following command:
24-
```bash
25-
echo \"[SECRET]\" | devrev developer_keyring create snap-in-secret <name of the keyring>
26-
```
27-
2. creating a keyring type of oauth_secret:
28-
* Using the CLI:
29-
Run the following command:
30-
```bash
31-
echo '{"client_id":"[CLIENT_ID]","client_secret":"[CLIENT_SECRET]"}' | devrev developer_keyring create oauth-secret <NAME>
32-
```
33-
Once you've created the keyring, you can use it in your snap_in by referencing the keyring name in the snap_in manifest file.
19+
An `oauth_secret` is specifically designed to store OAuth client credentials securely. It allows you to define two separate fields:
3420

35-
**Declaring Developer Keyrings in the Snap-in Manifest:**
21+
* `client_id`: The client ID provided by the OAuth provider.
22+
* `client_secret`: The client secret provided by the OAuth provider.
3623

37-
This section explains how to declare a developer keyring in your snap-in manifest. Developer keyrings provide a secure way to store sensitive information needed by your snap-in, such as OAuth client credentials.
24+
To create an OAuth secret with the CLI, run the following command:
25+
26+
```bash
27+
echo '{"client_id":"[<CLIENT ID>]","client_secret":"[<CLIENT SECRET>]"}' | devrev developer_keyring create oauth-secret <KEYRING NAME>
28+
```
29+
30+
## Developer keyrings in the snap-in manifest
31+
32+
Once you've created the keyring, you can use it in your snap-in by referencing the keyring name in the snap-in manifest file.
3833

3934
Syntax:
35+
4036
```yaml
4137
developer_keyrings:
4238
- name: <name of the keyring>

fern/docs/pages/references/keyrings/introduction.mdx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
**Keyrings: Securely Connecting Your Snap-in to External Services**
2-
31
Keyrings provide a secure way to manage credentials for external services used within your DevRev snap-in. This eliminates the need to store sensitive information like passwords or access tokens directly in your code or configuration files, improving overall security.
42

5-
**Why are Keyrings Important?**
6-
73
Traditionally, developers might store these credentials directly in their snap-in's code. This poses a significant security risk. If someone gains access to your code, they could also steal these sensitive credentials.
8-
Keyrings provide a secure alternative. By storing credentials separately from your code, you ensure they remain hidden and inaccessible even if the code is compromised. This strengthens the overall security of your snap-in.
9-
104

11-
12-
**How Keyrings Work**
5+
Keyrings provide a secure alternative. By storing credentials separately from your code, you ensure they remain hidden and inaccessible even if the code is compromised. This strengthens the overall security of your snap-in.
136

147
Imagine you're building a DevRev snap-in that helps manage your marketing campaigns across different platforms. This snap-in might need to connect to various external services like Facebook Ads, Mailchimp, and a project management tool like Asana.
15-
Traditionally, you might embed the API keys or access tokens for these services directly in your snap-in's code. This poses a security risk because anyone with access to the code could potentially steal these credentials.
168

179
Here's where DevRev keyrings come in:
1810

@@ -22,17 +14,18 @@ When your snap-in needs to interact with a specific service, it retrieves the ne
2214

2315
Think of keyrings as secure vaults within your snap-in, acting as a middleman between your snap-in and the external services it connects to. This ensures both security and a smooth user experience during installation.
2416

25-
**Supported Credential Types:**
17+
## Supported credential types
2618

2719
* **OAuth:** Streamline connections with popular services like Slack and Jira using pre-defined OAuth keyrings.
28-
* **Secrets (PATs, JSON):** Store various secret configurations, including Personal Access Tokens (PATs) and JSON Web Tokens (JWTs) for broader service integrations.
20+
* **Secrets:** Store various secret configurations, including personal access tokens (PATs) and JSON web tokens (JWTs) for broader service integrations.
21+
22+
## Access levels
2923

30-
**Access Levels:**
24+
- **User level:** Securely store credentials specific to individual users, allowing them to connect their own accounts to external services through your snap-in.
25+
- **Organization level:** Share credentials across your organization for access to a single, shared account for an external service.
3126

32-
* **User Level:** Securely store credentials specific to individual users, allowing them to connect their own accounts to external services through your snap-in.
33-
* **Organization Level:** Share credentials across your organization for access to a single, shared account for an external service.
27+
## Syntax
3428

35-
**Syntax:**
3629
```yaml
3730
keyrings:
3831
organization:

fern/docs/pages/references/keyrings/oauth_config.mdx

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
1-
OAuth Configurations - Securely Storing Access Tokens
2-
31
OAuth (Open Authorization) is a widely adopted standard for authorization that allows users to grant access to their accounts on one service (like Google or GitHub) to another application (like your DevRev snap-in) without needing to share their passwords directly. This approach enhances security and user convenience.
42

5-
For a comprehensive understanding of the OAuth specification, refer to the official documentation: [OAuth 2.0](https://oauth.net/2/).
3+
For comprehensive information about the OAuth specification, refer to the official documentation: [OAuth 2.0](https://oauth.net/2/).
4+
5+
## Using OAuth keyrings
66

7-
Utilizing OAuth Keyrings:
7+
1. **Define the keyring:** Within your snap-in manifest, define a keyring specifically for OAuth credentials. DevRev offers pre-defined keyring types for popular services like Slack or Jira, simplifying the process.
88

9-
- **Define the Keyring:** Within your snap-in manifest, define a keyring specifically for OAuth credentials. DevRev offers pre-defined keyring types for popular services like Slack or Jira, simplifying the process.
9+
2. **Provide credentials:** During development, you'll provide your developer keyring of type `oauth-secret` which contains client ID and client secret for the chosen service within the keyring definition. These credentials are securely stored and not distributed with your published snap-in.
1010

11-
- **Provide Credentials:** During development, you'll provide your developer keyring of type `oauth-secret` which contains client ID and client secret for the chosen service within the keyring definition. These credentials are securely stored and not distributed with your published snap-in.
11+
3. **OAuth flow:** When your snap-in needs to access user data from the external service, it initiates the OAuth flow. This typically involves redirecting the user to the service's login page and then back to your snap-in after successful authorization.
1212

13-
- **OAuth Flow:** When your snap-in needs to access user data from the external service, it initiates the OAuth flow. This typically involves redirecting the user to the service's login page and then back to your snap-in after successful authorization.
13+
4. **Access tokens:** Upon successful authorization, the service provides your snap-in with an access token. This token is used to access user data on the service's behalf without requiring the user's password again.
1414

15-
- **Access Tokens:** Upon successful authorization, the service provides your snap-in with an access token. This token is used to access user data on the service's behalf without requiring the user's password again.
15+
5. **Refreshing tokens:** A key benefit of using keyrings for OAuth is that they can handle refreshing access tokens automatically. Most OAuth implementations issue a refresh token alongside the access token. This refresh token can be used to obtain a new access token before the current one expires.
1616

17-
- **Refreshing Tokens:** A key benefit of using keyrings for OAuth is that they can handle refreshing access tokens automatically. Most OAuth implementations issue a refresh token alongside the access token. This refresh token can be used to obtain a new access token before the current one expires.
17+
### Keywords
18+
19+
The supported keywords that can be dynamically inserted into URLs, headers, and query parameters within your custom keyring type configuration.
20+
- `ACCESS_TOKEN`: The access token obtained during the OAuth flow.
21+
- `REFRESH_TOKEN`: The refresh token obtained during the OAuth flow.
22+
- `CLIENT_ID`: The client ID obtained from the OAuth client credentials.
23+
- `CLIENT_SECRET`: The client secret obtained from the OAuth client credentials.
24+
- `SCOPE`: The scope of the OAuth flow.
25+
- `API_KEY`: The API key obtained from the basic flow.
1826

27+
### Syntax
1928

2029
```yaml
2130
developer_keyrings:
@@ -87,16 +96,4 @@ keyring_types:
8796
<param_name>: <param_value>
8897
```
8998
90-
<Callout intent="note">
91-
92-
**Supported keywords in keyring_type configuration**:
93-
The supported keywords that can be dynamically inserted into URLs, headers, and query parameters within your custom keyring type configuration.
94-
- **[ACCESS_TOKEN]**: The access token obtained during the OAuth flow.
95-
- **[REFRESH_TOKEN]**: The refresh token obtained during the OAuth flow.
96-
- **[CLIENT_ID]**: The client ID obtained from the OAuth client credentials.
97-
- **[CLIENT_SECRET]**: The client secret obtained from the OAuth client credentials.
98-
- **[SCOPE]**: The scope of the OAuth flow.
99-
- **[API_KEY]**: The API key obtained from the basic flow.
100-
</Callout>
101-
10299
For examples of how to use keyrings in your snap-in, refer to the [Keyring API documentation](https://github.com/devrev/snap-in-examples/tree/main/13-keyring-type).

fern/docs/pages/references/keyrings/secret_config.mdx

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
Secret Configurations - Securely Storing Credentials (PATs, JSON)
1+
Secret configurations are a type of keyring well-suited for storing credentials like personal access tokens (PATs) and multi-field tokens (often stored in JSON format).
22

3-
Keyrings offer various mechanisms for storing sensitive information required by your snap-in to connect with external services. This page focuses on secret configurations, a type of keyring well-suited for storing credentials like Personal Access Tokens (PATs) and Multi-field Tokens (often stored in JSON format).
3+
## PAT keyrings
44

5-
- **Personal Access Tokens (PATs)** are API keys generated by many services like GitHub, GitLab, or cloud platforms like AWS or Azure. These tokens grant programmatic access to specific resources or functionalities within the service, on behalf of a user.
6-
- Imagine your snap-in needs to interact with a user's GitHub repository. Instead of embedding the user's username and password directly in your code (a major security risk!), you can leverage secret configurations. During installation, your snap-in can prompt the user to provide their PAT for GitHub access. This PAT is then securely stored within a secret configuration keyring. Whenever your snap-in needs to interact with the user's GitHub repository, it retrieves the PAT from the keyring and uses it for authorization.
5+
_Personal access tokens (PATs)_ are API keys generated by services like GitHub or GitLab, or by cloud platforms like AWS or Azure. These tokens grant programmatic access to specific resources or functionalities within the service, on behalf of a user.
76

7+
Imagine your snap-in needs to interact with a user's GitHub repository. Instead of embedding the user's username and password directly in your code (a major security risk!), you can leverage secret configurations. During installation, your snap-in can prompt the user to provide their PAT for GitHub access. This PAT is then securely stored within a secret configuration keyring. Whenever your snap-in needs to interact with the user's GitHub repository, it retrieves the PAT from the keyring and uses it for authorization.
88

9-
- **Multi-field tokens** are a broader category that often come in JSON format (JavaScript Object Notation). They can contain various fields with different pieces of information needed for authorization with a service.
10-
- Some services might use custom authentication mechanisms that require more than just a single token value. These services might provide credentials in JSON format, containing fields like access keys, secret keys, or expiration times. Secret configurations offer a secure way to store these multi-field tokens within your snap-in.
11-
12-
13-
**1. Demonstrating PAT Keyrings in the Snap-in Manifest:**
14-
15-
To use secret configurations in your snap-in, you need to declare them in your snap-in's manifest file (`manifest.yaml`). Here's a syntax of how you can declare a secret configuration keyring:
9+
To use secret configurations in your snap-in, you need to declare them in your snap-in's manifest file. Here's a syntax of how you can declare a secret configuration keyring:
1610

1711
```yaml
1812
keyrings:
@@ -29,12 +23,16 @@ keyrings:
2923
types:
3024
- snap-in-secret
3125
```
32-
DevRev offers pre-defined keyring types for simplified credential management. The snap-in-secret type is a versatile option for storing Personal Access Tokens (PATs) that need to be shared across your organization within your snap-in. This pre-defined type eliminates the need to create a custom keyring type specifically for PATs.
3326
27+
DevRev offers pre-defined keyring types for simplified credential management. This pre-defined type eliminates the need to create a custom keyring type specifically for PATs.
3428
35-
**2. Demonstrating Multi-field Keyrings in the Snap-in Manifest:**
29+
## Multi-field keyrings
3630
37-
To use secret configurations in your snap-in, you need to declare them in your snap-in's manifest file (`manifest.yaml`). Here's a syntax of how you can declare a secret configuration keyring:
31+
_Multi-field tokens_ are a broader category that often come in JSON format. They can contain various fields with different pieces of information needed for authorization with a service.
32+
33+
Some services might use custom authentication mechanisms that require more than just a single token value. These services might provide credentials in JSON format, containing fields like access keys, secret keys, or expiration times. Secret configurations offer a secure way to store these multi-field tokens within your snap-in.
34+
35+
To use secret configurations in your snap-in, you need to declare them in your snap-in's manifest file. Here's a syntax of how you can declare a secret configuration keyring:
3836
3937
```yaml
4038
keyrings:
@@ -77,11 +75,11 @@ keyring_types:
7775
<param_name>: <param_value> # optional: query parameters to be included in the verification request.
7876
```
7977
80-
**3. Demonstrating Secret Configuration to achieve Basic Authentication in the Snap-in Manifest:**
78+
## Basic authentication with keyrings
8179
82-
For a more in-depth understanding of Basic Authentication, you can refer to the Uncyclopedia article: [Basic authentication on Uncyclopedia](https://en.wikipedia.org/wiki/Basic_access_authentication). This resource provides detailed information about the protocol and its potential security considerations.
80+
For more information about basic authentication, you can refer to the Uncyclopedia article: [Basic authentication](https://en.wikipedia.org/wiki/Basic_access_authentication). This resource provides detailed information about the protocol and its potential security considerations.
8381
84-
Here's an syntax of how you can define a secret configuration keyring for Basic Authentication in your snap-in's manifest file (`manifest.yaml`):
82+
Here's an syntax of how you can define a secret configuration keyring for basic authentication in your snap-in's manifest file:
8583
8684
```yaml
8785
keyrings:
@@ -126,13 +124,12 @@ keyring_types:
126124
```
127125
The secret_transform field is intended for more advanced scenarios where the secret needs to be transformed before use. For example, it could be used to hash a password before storing it within the keyring. The jq query provided in this field will be applied to the secret data before it is stored.
128126
129-
<Callout intent="note">
127+
### Keyring types
128+
129+
The supported keywords that can be dynamically inserted into URLs, headers, and query parameters within your custom keyring type configuration.
130130
131-
**Supported keywords in keyring_type configuration**:
132-
The supported keywords that can be dynamically inserted into URLs, headers, and query parameters within your custom keyring type configuration.
133-
- **[API_KEY]**: The API key obtained from the secret configuration.
134-
- **[SUBDOMAIN]**: The subdomain obtained from the secret configuration.
135-
- **[FIELD_ID]**: The field ID obtained from the secret configuration.
136-
</Callout>
131+
- `API_KEY`: The API key obtained from the secret configuration.
132+
- `SUBDOMAIN`: The subdomain obtained from the secret configuration.
133+
- `FIELD_ID`: The field ID obtained from the secret configuration.
137134

138135
For examples of how to use keyrings in your snap-in, refer to the [Keyring API documentation](https://github.com/devrev/snap-in-examples/tree/main/13-keyring-type).

0 commit comments

Comments
 (0)