Skip to content

Commit e6e162a

Browse files
committed
feat(enterprise): Manage resource tokens for databases and sysinfo
1 parent dd75bf1 commit e6e162a

File tree

1 file changed

+43
-46
lines changed
  • content/influxdb3/enterprise/admin/tokens/resource

1 file changed

+43
-46
lines changed

content/influxdb3/enterprise/admin/tokens/resource/create.md

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ After you
5151
can use the token string to authenticate `influxdb3` commands and HTTP API requests
5252
for managing database and system tokens.
5353

54+
The HTTP API examples in this guide use [cURL](https://curl.se/) to send an API request, but you can use any HTTP client._
55+
5456
> [!Note]
5557
> #### Store secure tokens in a secret store
5658
>
@@ -75,17 +77,17 @@ your {{% product-name %}} instance.
7577

7678
In your terminal, run the `influxdb3 create token` command and provide the following:
7779

78-
- `--permission` flag to create a token with permissions
79-
- `--name` flag with a unique description of the token
80-
- _Options_, for example:
81-
- `--expiry` option with the token expiration time as a [duration](/influxdb3/enterprise/reference/glossary/#duration).
82-
If an expiration isn't set, the token does not expire until revoked.
83-
- Token permissions (read and write) in the Permission in the `RESOURCE_TYPE:RESOURCE_NAMES:ACTIONS` format--for example:
84-
- db:DATABASE1,DATABASE2:read,write
85-
- `db:`: The `db` resource type, which specifies the token is for a database.
86-
- `DATABASE1,DATABASE2`: The names of the databases to grant permissions to.
87-
The resource names part supports the `*` wildcard, which grants read or write permissions to all databases.
88-
- `read,write`: The permissions to grant to the token.
80+
- `--permission` flag to create a token with permissions
81+
- `--name` flag with a unique description of the token
82+
- _Options_, for example:
83+
- `--expiry` option with the token expiration time as a [duration](/influxdb3/enterprise/reference/glossary/#duration).
84+
If an expiration isn't set, the token does not expire until revoked.
85+
- Token permissions (read and write) in the `RESOURCE_TYPE:RESOURCE_NAMES:ACTIONS` format--for example:
86+
- db:DATABASE1,DATABASE2:read,write
87+
- `db:`: The `db` resource type, which specifies the token is for a database.
88+
- `DATABASE1,DATABASE2`: The names of the databases to grant permissions to.
89+
The resource names part supports the `*` wildcard, which grants read or write permissions to all databases.
90+
- `read,write`: The permissions to grant to the token.
8991

9092
{{% code-placeholders "DATABASE1|DATABASE2|1y" %}}
9193

@@ -113,29 +115,27 @@ The output is the token string in plain text.
113115
{{% /tab-content %}}
114116
{{% tab-content %}}
115117
<!------------------------------- BEGIN cURL ---------------------------------->
116-
_This example uses [cURL](https://curl.se/) to send an HTTP API request, but you can use any HTTP client._
117118

118-
1. If you haven't already, follow the instructions to [install cURL](https://everything.curl.dev/install/index.html) for your system.
119-
2. In your terminal, use cURL to send a request to the following {{% product-name %}} endpoint:
119+
Send a request to the following {{% product-name %}} endpoint:
120120

121-
{{% api-endpoint endpoint="http://{{< influxdb/host >}}/api/v3/enterprise/configure/token" method="post" %}}
121+
{{% api-endpoint endpoint="http://{{< influxdb/host >}}/api/v3/enterprise/configure/token" method="post" %}}
122122

123-
Provide the following request headers:
123+
Provide the following request headers:
124124

125-
- `Accept: application/json` to ensure the response body is JSON content
126-
- `Content-Type: application/json` to indicate the request body is JSON content
127-
- `Authorization: Bearer` and the [admin token](/influxdb3/enterprise/admin/tokens/admin/)
128-
for your instance to authorize the request
125+
- `Accept: application/json` to ensure the response body is JSON content
126+
- `Content-Type: application/json` to indicate the request body is JSON content
127+
- `Authorization: Bearer` and the [admin token](/influxdb3/enterprise/admin/tokens/admin/)
128+
for your instance to authorize the request
129129

130-
In the request body, provide the following parameters:
130+
In the request body, provide the following parameters:
131131

132-
- `token_name`: a description of the token, unique within the instance
133-
- `resource_type`: the resource type for the token, which is always `db`
134-
- `resource_identifier`: an array of database names to grant permissions to
135-
- The resource identifier field supports the `*` wildcard, which grants read or write
136-
permissions to all databases.
137-
- `permissions`: an array of token permission actions (`"read"`, `"write"`) for the database
138-
- `expiry_secs`: Specify the token expiration time in seconds.
132+
- `token_name`: a description of the token, unique within the instance
133+
- `resource_type`: the resource type for the token, which is always `db`
134+
- `resource_identifier`: an array of database names to grant permissions to
135+
- The resource identifier field supports the `*` wildcard, which grants read or write
136+
permissions to all databases.
137+
- `permissions`: an array of token permission actions (`"read"`, `"write"`) for the database
138+
- `expiry_secs`: Specify the token expiration time in seconds.
139139

140140
The following example shows how to use the HTTP API to create a database token:
141141

@@ -444,29 +444,26 @@ The output is the token string in plain text.
444444
{{% /tab-content %}}
445445
{{% tab-content %}}
446446
<!------------------------------- BEGIN cURL ---------------------------------->
447-
_This example uses [cURL](https://curl.se/) to send an HTTP API request, but you can use any HTTP client._
448-
449-
1. If you haven't already, follow the instructions to [install cURL](https://everything.curl.dev/install/index.html) for your system.
450-
2. In your terminal, use cURL to send a request to the following {{% product-name %}} endpoint:
447+
Send a request to the following {{% product-name %}} endpoint:
451448

452-
{{% api-endpoint endpoint="http://{{< influxdb/host >}}/api/v3/enterprise/configure/token" method="post" %}}
449+
{{% api-endpoint endpoint="http://{{< influxdb/host >}}/api/v3/enterprise/configure/token" method="post" %}}
453450

454-
Provide the following request headers:
451+
Provide the following request headers:
455452

456-
- `Accept: application/json` to ensure the response body is JSON content
457-
- `Content-Type: application/json` to indicate the request body is JSON content
458-
- `Authorization: Bearer` and the [admin token](/influxdb3/enterprise/admin/tokens/admin/)
459-
for your instance to authorize the request
453+
- `Accept: application/json` to ensure the response body is JSON content
454+
- `Content-Type: application/json` to indicate the request body is JSON content
455+
- `Authorization: Bearer` and the [admin token](/influxdb3/enterprise/admin/tokens/admin/)
456+
for your instance to authorize the request
460457

461-
In the request body, provide the following parameters:
458+
In the request body, provide the following parameters:
462459

463-
- `token_name`: a description of the token, unique within the instance
464-
- `resource_type`: the resource type for the token, which is `system` for system tokens
465-
- `resource_identifier`: an array of system resource names to grant permissions to
466-
- The resource identifier field supports the `*` wildcard, which grants read or write
467-
permissions to all system information resources.
468-
- `permissions`: an array of token permission actions (only `"read"` for system tokens)
469-
- `expiry_secs`: Specify the token expiration time in seconds.
460+
- `token_name`: a description of the token, unique within the instance
461+
- `resource_type`: the resource type for the token, which is `system` for system tokens
462+
- `resource_identifier`: an array of system resource names to grant permissions to
463+
- The resource identifier field supports the `*` wildcard, which grants read or write
464+
permissions to all system information resources.
465+
- `permissions`: an array of token permission actions (only `"read"` for system tokens)
466+
- `expiry_secs`: Specify the token expiration time in seconds.
470467

471468
The following example shows how to use the HTTP API to create a system token:
472469

0 commit comments

Comments
 (0)