Apply suggestions from code review
Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>pull/6026/head
parent
97856f61c6
commit
e9d3cb46d8
|
|
@ -19,7 +19,7 @@ list_code_example: |
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT * FROM SYSTEM.TOKENS WHERE permissions = '*:*:*'" \
|
||||
--data-urlencode "q=SELECT * FROM system.tokens WHERE permissions = '*:*:*'" \
|
||||
--header 'Accept: application/json' \
|
||||
--header "Authorization: Bearer AUTH_TOKEN"
|
||||
```
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ title: List admin tokens
|
|||
description: >
|
||||
Use the `influxdb3` CLI or the `/api/v3` HTTP API
|
||||
to list admin tokens for your {{< product-name >}} instance.
|
||||
Use the `influxdb3 show tokens` command to list all tokens or use SQL to query token metadata directly from the `SYSTEM.TOKENS` table.
|
||||
Use the `influxdb3 show tokens` command to list all tokens or use SQL to query token metadata directly from the `system.tokens` table.
|
||||
menu:
|
||||
influxdb3_enterprise:
|
||||
parent: Admin tokens
|
||||
|
|
@ -19,7 +19,7 @@ list_code_example: |
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT * FROM SYSTEM.TOKENS WHERE permissions = '*:*:*'" \
|
||||
--data-urlencode "q=SELECT * FROM system.tokens WHERE permissions = '*:*:*'" \
|
||||
--header 'Accept: application/json' \
|
||||
--header "Authorization: Bearer AUTH_TOKEN"
|
||||
```
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ description: >
|
|||
Use the `influxdb3` CLI or the HTTP API to list resource tokens with fine-grained
|
||||
access permissions in your {{% product-name %}} instance.
|
||||
Use the `influxdb3 show tokens` command to list all tokens or use SQL to query token
|
||||
metadata directly from the `SYSTEM.TOKENS` table.
|
||||
metadata directly from the `system.tokens` table.
|
||||
menu:
|
||||
influxdb3_enterprise:
|
||||
parent: Resource tokens
|
||||
|
|
@ -20,7 +20,7 @@ list_code_example: |
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT * FROM SYSTEM.TOKENS WHERE permissions NOT LIKE '\*%'" \
|
||||
--data-urlencode "q=SELECT * FROM system.tokens WHERE permissions NOT LIKE '\*%'" \
|
||||
--header 'Accept: application/json' \
|
||||
--header "Authorization: Bearer AUTH_TOKEN"
|
||||
```
|
||||
|
|
@ -32,7 +32,7 @@ related:
|
|||
Use the `influxdb3` CLI or the HTTP API to list resource tokens with fine-grained
|
||||
access permissions in your {{% product-name %}} instance.
|
||||
Use the `influxdb3 show tokens` command to list all tokens or use SQL to query token
|
||||
metadata directly from the `SYSTEM.TOKENS` table.
|
||||
metadata directly from the `system.tokens` table.
|
||||
|
||||
Resource tokens have fine-grained permissions for InfluxDB 3 resources, such
|
||||
as databases and system tables.
|
||||
|
|
@ -73,7 +73,7 @@ To filter tokens and retrieve specific details using SQL, query the `system.toke
|
|||
```bash
|
||||
influxdb3 query \
|
||||
--db _internal \
|
||||
"SELECT name, permissions FROM SYSTEM.TOKENS WHERE permissions NOT LIKE '\*%'"
|
||||
"SELECT name, permissions FROM system.tokens WHERE permissions NOT LIKE '\*%'"
|
||||
```
|
||||
<!---------------------------END CLI------------------------------------------->
|
||||
{{% /code-tab-content %}}
|
||||
|
|
@ -84,7 +84,7 @@ influxdb3 query \
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT * FROM SYSTEM.TOKENS WHERE permissions NOT LIKE '\*%'" \
|
||||
--data-urlencode "q=SELECT * FROM system.tokens WHERE permissions NOT LIKE '\*%'" \
|
||||
--header 'Accept: application/json' \
|
||||
--header "Authorization: Bearer AUTH_TOKEN"
|
||||
```
|
||||
|
|
@ -128,7 +128,7 @@ influxdb3 show tokens \
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT * FROM SYSTEM.TOKENS" \
|
||||
--data-urlencode "q=SELECT * FROM system.tokens" \
|
||||
--data-urlencode "format=csv" \
|
||||
--header 'Accept: text/csv' \
|
||||
--header "Authorization: Bearer AUTH_TOKEN"
|
||||
|
|
@ -167,7 +167,7 @@ influxdb3 show tokens \
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT * FROM SYSTEM.TOKENS" \
|
||||
--data-urlencode "q=SELECT * FROM system.tokens" \
|
||||
--data-urlencode "format=parquet" \
|
||||
--header "Accept: application/parquet" \
|
||||
--header "Authorization: Bearer AUTH_TOKEN" \
|
||||
|
|
@ -196,7 +196,7 @@ Use `grep` to filter for resource (non-admin) tokens:
|
|||
<!---------------------------BEGIN CLI----------------------------------------->
|
||||
|
||||
```bash
|
||||
influxdb3 show tokens --format pretty | grep -v "*:*:*"
|
||||
influxdb3 show tokens --format pretty | grep -v '*:*:*'
|
||||
```
|
||||
<!---------------------------END CLI------------------------------------------->
|
||||
{{% /code-tab-content %}}
|
||||
|
|
@ -207,7 +207,7 @@ influxdb3 show tokens --format pretty | grep -v "*:*:*"
|
|||
curl -G \
|
||||
"http://localhost:8181/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT * FROM SYSTEM.TOKENS" \
|
||||
--data-urlencode "q=SELECT * FROM system.tokens" \
|
||||
--data-urlencode "format=jsonl" \
|
||||
--header 'Accept: application/json' \
|
||||
--header "Authorization: Bearer AUTH_TOKEN" |
|
||||
|
|
@ -240,7 +240,7 @@ jq '.[] | select(.permissions | startswith("system:")) | {name: .name, permissio
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT * FROM SYSTEM.TOKENS" \
|
||||
--data-urlencode "q=SELECT * FROM system.tokens" \
|
||||
--data-urlencode "format=json" \
|
||||
--header "Accept: application/json" \
|
||||
--header "Authorization: Bearer AUTH_TOKEN" |
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ influxdb3 create token --permission <PERMISSION> --name <NAME> [OPTIONS]
|
|||
| | `--token <AUTH_TOKEN>` | The {{% token-link "enterprise" "admin" %}} [env: INFLUXDB3_AUTH_TOKEN=] |
|
||||
| | `--expiry <DURATION>` | The token expiration time as a duration (for example, 1h, 7d, 1y). If not set, the token does not expire until revoked |
|
||||
| | `--tls-ca <CA_CERT>` | An optional arg to use a custom CA for testing with self-signed certs [env: INFLUXDB3_TLS_CA=] |
|
||||
| | `--format <FORMAT>` | Output format for token, supports just json or text [possible values: json, text] |
|
||||
| | `--format <FORMAT>` | Output format (`json` or `text` _(default)_) |
|
||||
| `-h` | `--help` | Print help information |
|
||||
| | `--help-all` | Print more detailed help information |
|
||||
| | `--help-all` | Print detailed help information |
|
||||
|
||||
## Permission Format
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ data and resources in your InfluxDB 3 instance.
|
|||
|
||||
> [!NOTE]
|
||||
> Token metadata includes the hashed token string.
|
||||
> InfluxDB 3 does not store the token string.
|
||||
> InfluxDB 3 does not store the raw token string.
|
||||
|
||||
In the following examples, replace {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}} with your InfluxDB {{% token-link "admin" %}}
|
||||
{{% show-in "enterprise" %}} or a token with read permission on the `_internal` system database`{{% /show-in %}}.
|
||||
|
|
@ -38,7 +38,7 @@ To filter tokens and retrieve specific details using SQL, query the `system.toke
|
|||
influxdb3 query \
|
||||
--database _internal \
|
||||
--format csv \
|
||||
"SELECT name, permissions FROM SYSTEM.TOKENS WHERE permissions = '*:*:*'"
|
||||
"SELECT name, permissions FROM system.tokens WHERE permissions = '*:*:*'"
|
||||
```
|
||||
<!---------------------------END CLI------------------------------------------->
|
||||
{{% /code-tab-content %}}
|
||||
|
|
@ -48,7 +48,7 @@ influxdb3 query \
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT name, permissions FROM SYSTEM.TOKENS WHERE permissions = '*:*:*'" \
|
||||
--data-urlencode "q=SELECT name, permissions FROM system.tokens WHERE permissions = '*:*:*'" \
|
||||
--data-urlencode "format=csv" \
|
||||
--header 'Accept: text/csv' \
|
||||
--header "Authorization: Bearer AUTH_TOKEN"
|
||||
|
|
@ -71,7 +71,7 @@ curl -G \
|
|||
```bash
|
||||
influxdb3 query \
|
||||
--db _internal \
|
||||
"SELECT name, permissions FROM SYSTEM.TOKENS WHERE created_at > '2025-01-01 00:00:00'"
|
||||
"SELECT name, permissions FROM system.tokens WHERE created_at > '2025-01-01 00:00:00'"
|
||||
```
|
||||
<!---------------------------END CLI------------------------------------------->
|
||||
{{% /code-tab-content %}}
|
||||
|
|
@ -81,7 +81,7 @@ influxdb3 query \
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT name, permissions FROM SYSTEM.TOKENS WHERE created_at > '2025-01-01 00:00:00'" \
|
||||
--data-urlencode "q=SELECT name, permissions FROM system.tokens WHERE created_at > '2025-01-01 00:00:00'" \
|
||||
--header "Accept: application/json" \
|
||||
--header "Authorization: Bearer AUTH_TOKEN"
|
||||
```
|
||||
|
|
@ -123,7 +123,7 @@ influxdb3 show tokens \
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT * FROM SYSTEM.TOKENS" \
|
||||
--data-urlencode "q=SELECT * FROM system.tokens" \
|
||||
--data-urlencode "format=csv" \
|
||||
--header 'Accept: text/csv' \
|
||||
--header "Authorization: Bearer AUTH_TOKEN"
|
||||
|
|
@ -162,7 +162,7 @@ influxdb3 show tokens \
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT * FROM SYSTEM.TOKENS" \
|
||||
--data-urlencode "q=SELECT * FROM system.tokens" \
|
||||
--data-urlencode "format=parquet" \
|
||||
--header "Accept: application/parquet" \
|
||||
--header "Authorization: Bearer AUTH_TOKEN" \
|
||||
|
|
@ -201,7 +201,7 @@ grep _admin
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT * FROM SYSTEM.TOKENS" \
|
||||
--data-urlencode "q=SELECT * FROM system.tokens" \
|
||||
--data-urlencode "format=pretty" \
|
||||
--header "Accept: application/json" \
|
||||
--header "Authorization: Bearer AUTH_TOKEN" |
|
||||
|
|
@ -232,7 +232,7 @@ jq '.[] | {name: .name, permissions: .permissions}'
|
|||
curl -G \
|
||||
"http://{{< influxdb/host >}}/api/v3/query_sql" \
|
||||
--data-urlencode "db=_internal" \
|
||||
--data-urlencode "q=SELECT name, created_at FROM SYSTEM.TOKENS WHERE permissions = '*:*:*' AND created_at > '2025-01-01 00:00:00'" \
|
||||
--data-urlencode "q=SELECT name, created_at FROM system.tokens WHERE permissions = '*:*:*' AND created_at > '2025-01-01 00:00:00'" \
|
||||
--data-urlencode "format=json" \
|
||||
--header "Accept: application/json" \
|
||||
--header "Authorization: Bearer AUTH_TOKEN" |
|
||||
|
|
|
|||
Loading…
Reference in New Issue