You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/docs/pages/references/keyrings/developer_keyring.mdx
+24-28Lines changed: 24 additions & 28 deletions
Original file line number
Diff line number
Diff 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.
2
2
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.
4
4
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
7
6
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.
9
8
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.
14
10
15
-
Creating a Developer Keyring
11
+
To create a snap-in secret with the CLI, ruun the following command:
16
12
17
-
To create a developer keyring, follow these steps:
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:
34
20
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.
36
23
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:
Copy file name to clipboardExpand all lines: fern/docs/pages/references/keyrings/introduction.mdx
+8-15Lines changed: 8 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,10 @@
1
-
**Keyrings: Securely Connecting Your Snap-in to External Services**
2
-
3
1
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.
4
2
5
-
**Why are Keyrings Important?**
6
-
7
3
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
-
10
4
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.
13
6
14
7
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.
16
8
17
9
Here's where DevRev keyrings come in:
18
10
@@ -22,17 +14,18 @@ When your snap-in needs to interact with a specific service, it retrieves the ne
22
14
23
15
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.
24
16
25
-
**Supported Credential Types:**
17
+
## Supported credential types
26
18
27
19
***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
29
23
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.
31
26
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.
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.
4
2
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
6
6
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.
8
8
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.
10
10
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.
12
12
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.
14
14
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.
16
16
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.
18
26
27
+
### Syntax
19
28
20
29
```yaml
21
30
developer_keyrings:
@@ -87,16 +96,4 @@ keyring_types:
87
96
<param_name>: <param_value>
88
97
```
89
98
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
-
102
99
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).
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).
2
2
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
4
4
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.
7
6
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.
8
8
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:
16
10
17
11
```yaml
18
12
keyrings:
@@ -29,12 +23,16 @@ keyrings:
29
23
types:
30
24
- snap-in-secret
31
25
```
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.
33
26
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.
34
28
35
-
**2. Demonstrating Multi-field Keyrings in the Snap-in Manifest:**
29
+
## Multi-field keyrings
36
30
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:
38
36
39
37
```yaml
40
38
keyrings:
@@ -77,11 +75,11 @@ keyring_types:
77
75
<param_name>: <param_value> # optional: query parameters to be included in the verification request.
78
76
```
79
77
80
-
**3. Demonstrating Secret Configuration to achieve Basic Authentication in the Snap-in Manifest:**
78
+
## Basic authentication with keyrings
81
79
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.
83
81
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:
85
83
86
84
```yaml
87
85
keyrings:
@@ -126,13 +124,12 @@ keyring_types:
126
124
```
127
125
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.
128
126
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.
130
130
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.
137
134
138
135
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