Skip to content

Commit b4ae49a

Browse files
committed
Add API key page
1 parent 6afafc2 commit b4ae49a

File tree

5 files changed

+46
-12
lines changed

5 files changed

+46
-12
lines changed

docs/manage/manage/access.md

-7
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,6 @@ You can also remove the user by clicking on **Remove user**.
9898

9999
You can remove any organization except the primary owner from the shared list by clicking the **X** to the right of the location in the shared list.
100100

101-
## Rotate an API key
102-
103-
If you ever need to rotate an API key, click on the **Generate Key** button on the organization setting page to generate a new key.
104-
105-
Viam supports flexible key rotation with up to two keys in use at one time.
106-
After generating a new secret key, update all references to the key in your code as soon as possible and then remove the old key.
107-
108101
## Collaborate safely
109102

110103
When you or your collaborators change the configuration of a machine or a group of machines in the Viam app, `viam-server` automatically synchronizes the configuration and updates the running resources within 15 seconds.

docs/operate/control/api-keys.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: "API keys"
3+
linkTitle: "API keys"
4+
weight: 50
5+
layout: "docs"
6+
type: "docs"
7+
description: "Run control logic on a machine."
8+
images: ["/general/code.png"]
9+
date: "2024-01-13"
10+
---
11+
12+
API keys grant access to organizations, locations, and machines.
13+
14+
To view all API keys in use for your organization and the locations and machines inside it, click on the organization dropdown in the top navigation bar and click on **Settings**.
15+
16+
{{<imgproc src="/fleet/api-keys.png" resize="700x" declaredimensions=true alt="API Keys table">}}
17+
18+
## Add an API key
19+
20+
On your organization's page, click **Generate key** to generate a new key.
21+
Optionally, give the key a name.
22+
Click on the **Resource** menu and choose what organization, location, or machine you want the key to grant access to.
23+
If you select organization, your key grants access to all locations and machines contained within that organization.
24+
If you select location, your key grants access to all of the machines contained within that location.
25+
26+
For **Role**, assign either an **Owner** or **Operator** role.
27+
See [Permissions](/manage/manage/rbac/) for information about the privilege each role entails at each resource level.
28+
29+
## Change an API key's access
30+
31+
To edit an API key, click on **Show details** in the key's row of the key table's **Resources** column.
32+
33+
{{<imgproc src="/fleet/additional-details.png" resize="700x" declaredimensions=true alt="Additional details for a key">}}
34+
35+
To edit the role, click on the dropdown menu next to the role and select **Owner** or **Operator**.
36+
See [Permissions](#permissions) for information about the privilege each role entails at each resource level.
37+
38+
To change the entities it is able to access, click **+ Grant additional access**.
39+
Select which organization, location, or machine you want the key to grant access to.
40+
Click **Choose** to confirm your selection.
41+

static/include/app/apis/generated/app.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/
803803

804804
### GetRobotAPIKeys
805805

806-
Gets the [API keys](/cloud/rbac/#api-keys) for the machine.
806+
Gets the [API keys](/operate/control/api-key/) for the machine.
807807

808808
{{< tabs >}}
809809
{{% tab name="Python" %}}
@@ -2140,7 +2140,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/
21402140

21412141
### CreateKey
21422142

2143-
Create a new [API key](/cloud/rbac/#api-keys).
2143+
Create a new [API key](/operate/control/api-key/).
21442144

21452145
{{< tabs >}}
21462146
{{% tab name="Python" %}}
@@ -2184,7 +2184,7 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/
21842184

21852185
### DeleteKey
21862186

2187-
Delete an [API key](/cloud/rbac/#api-keys).
2187+
Delete an [API key](/operate/control/api-key/).
21882188

21892189
{{< tabs >}}
21902190
{{% tab name="Python" %}}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Gets the [API keys](/cloud/rbac/#api-keys) for the machine.
1+
Gets the [API keys](/operate/control/api-key/) for the machine.

static/include/program/authenticate.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ To authenticate yourself to your machine, you need
44

55
<!-- we will be releasing the ability to create API keys across all types of resources and combinations soon (i.e an API key can have an authorization on a org, location, machine or any combination of all three). this is correct for now though but it will be changing shortly. -->
66

7-
To authenticate, [use a machine part API key](/cloud/machines/#api-keys) or [an API key](/dev/tools/cli/#authenticate) with access to the machine.
7+
To authenticate, [use a machine part API key](/operate/control/api-key/) or [an API key](/dev/tools/cli/#authenticate) with access to the machine.
88
Copy and paste the API key ID and the API key into your environment variables or directly into the code:
99

1010
{{< tabs >}}

0 commit comments

Comments
 (0)