Skip to content

Commit 8e62ada

Browse files
mstrandbogesandersonjstirnaman
authored
Release influxctl v2.10.0 (#5959)
* Release influxctl v2.10.0 * Database token expiration in Dedicated and Clustered (#5930) * adds database token expiration to dedicated and clustered docs * update to fix md lint * updates influxctl create in dedicated * Apply suggestions from code review Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com> --------- Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com> * udpates for influxctl 2.10.0 (#5960) * added missing expires at information to cloud-dedicated token mgmt * influxctl 2.10.0 release notes (#5961) * influxctl 2.10.0 release notes * corrected influxctl release note * corrected punctuation in influxctl release note * corrected link urls in shared influxctl release notes --------- Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com> Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com> Co-authored-by: Scott Anderson <scott@influxdata.com>
1 parent 6086d94 commit 8e62ada

File tree

21 files changed

+1420
-1649
lines changed

21 files changed

+1420
-1649
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@
2121
"enabled": true
2222
}
2323
],
24+
"cSpell.words": [
25+
"influxctl"
26+
],
2427
}

content/influxdb3/cloud-dedicated/admin/tokens/database/create.md

Lines changed: 161 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ list_code_example: |
1616
--read-database DATABASE1_NAME \
1717
--read-database DATABASE2_NAME \
1818
--write-database DATABASE2_NAME \
19+
--expires-at 2030-01-01T00:00:00Z \
1920
"Read-only on DATABASE1_NAME, Read/write on DATABASE2_NAME"
2021
```
2122
@@ -37,7 +38,9 @@ list_code_example: |
3738
"action": "read",
3839
"resource": "DATABASE_NAME"
3940
}
40-
]
41+
],
42+
"expirationType": "datetime",
43+
"expiresAt": "2030-01-01T00:00:00Z"
4144
}'
4245
```
4346
aliases:
@@ -60,6 +63,7 @@ or the [Management HTTP API](/influxdb3/cloud-dedicated/api/management/) to crea
6063
{{% tab-content %}}
6164

6265
<!------------------------------- BEGIN INFLUXCTL ----------------------------->
66+
6367
Use the [`influxctl token create` command](/influxdb3/cloud-dedicated/reference/cli/influxctl/token/create/)
6468
to create a token that grants access to databases in your {{% product-name omit=" Clustered" %}} cluster.
6569

@@ -74,22 +78,31 @@ to create a token that grants access to databases in your {{% product-name omit=
7478
permissions to all databases. Enclose wildcards in single or double
7579
quotes--for example: `'*'` or `"*"`.
7680

81+
- _Optional_: the `--expires-at` flag with an RFC3339 date string that defines the
82+
token expiration date and time--for example, `{{< datetime/current-date offset=1 >}}`.
83+
If an expiration isn't set, the token does not expire until revoked.
84+
7785
- Token description
7886

79-
{{% code-placeholders "DATABASE_NAME|TOKEN_DESCRIPTION" %}}
87+
{{% code-placeholders "DATABASE_NAME|TOKEN_DESCRIPTION|RFC3339_TIMESTAMP" %}}
8088

8189
```sh
8290
influxctl token create \
8391
--read-database DATABASE_NAME \
8492
--write-database DATABASE_NAME \
85-
"Read/write token for DATABASE_NAME"
93+
--expires-at RFC3339_TIMESTAMP \
94+
"Read/write token for DATABASE_NAME"
8695
```
8796

8897
{{% /code-placeholders %}}
8998

9099
Replace the following:
91100

92-
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% product-name %}} [database](/influxdb3/cloud-dedicated/admin/databases/)
101+
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}:
102+
your {{% product-name %}} [database](/influxdb3/cloud-dedicated/admin/databases/)
103+
- {{% code-placeholder-key %}}`RFC3339_TIMESTAMP`{{% /code-placeholder-key %}}:
104+
the token expiration date and time in
105+
[RFC3339 format](/influxdb3/cloud-dedicated/reference/glossary/#rfc3339-timestamp).
93106

94107
The output is the token ID and the token string.
95108
**This is the only time the token string is available in plain text.**
@@ -100,28 +113,34 @@ The output is the token ID and the token string.
100113
<!------------------------------- BEGIN cURL ---------------------------------->
101114
_This example uses [cURL](https://curl.se/) to send a Management HTTP API request, but you can use any HTTP client._
102115

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

106-
{{% api-endpoint endpoint="https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/tokens" method="post" api-ref="/influxdb3/cloud-dedicated/api/management/#operation/CreateDatabaseToken" %}}
119+
{{% api-endpoint endpoint="https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/tokens" method="post" api-ref="/influxdb3/cloud-dedicated/api/management/#operation/CreateDatabaseToken" %}}
107120

108-
In the URL, provide the following credentials:
121+
In the URL, provide the following credentials:
109122

110-
- `ACCOUNT_ID`: The ID of the [account](/influxdb3/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that the cluster belongs to _(see how to [list cluster details](/influxdb3/cloud-dedicated/admin/clusters/list/#detailed-output-in-json))_.
111-
- `CLUSTER_ID`: The ID of the [cluster](/influxdb3/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that you want to manage _(see how to [list cluster details](/influxdb3/cloud-dedicated/admin/clusters/list/#detailed-output-in-json))_.
123+
- `ACCOUNT_ID`: The ID of the [account](/influxdb3/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that the cluster belongs to _(see how to [list cluster details](/influxdb3/cloud-dedicated/admin/clusters/list/#detailed-output-in-json))_.
124+
- `CLUSTER_ID`: The ID of the [cluster](/influxdb3/cloud-dedicated/get-started/setup/#request-an-influxdb-cloud-dedicated-cluster) that you want to manage _(see how to [list cluster details](/influxdb3/cloud-dedicated/admin/clusters/list/#detailed-output-in-json))_.
112125

113-
Provide the following request headers:
126+
Provide the following request headers:
114127

115-
- `Accept: application/json` to ensure the response body is JSON content
116-
- `Content-Type: application/json` to indicate the request body is JSON content
117-
- `Authorization: Bearer` and a [Management API token](/influxdb3/cloud-dedicated/admin/tokens/management/) for your cluster _(see how to [create a management token](/influxdb3/cloud-dedicated/admin/tokens/management/) for Management API requests)_.
128+
- `Accept: application/json` to ensure the response body is JSON content
129+
- `Content-Type: application/json` to indicate the request body is JSON content
130+
- `Authorization: Bearer` and a [Management API token](/influxdb3/cloud-dedicated/admin/tokens/management/) for your cluster _(see how to [create a management token](/influxdb3/cloud-dedicated/admin/tokens/management/) for Management API requests)_.
118131

119-
In the request body, provide the following parameters:
132+
In the request body, provide the following parameters:
120133

121134
- `permissions`: an array of token [permissions](/influxdb3/cloud-dedicated/api/management/#operation/CreateDatabaseToken) (read or write) objects:
122135
- `"action"`: Specify `read` or `write` permission to the database.
123136
- `"resource"`: Specify the database name.
124137
- `description`: Provide a description of the token.
138+
- `expirationType`: Specify `datetime` or `noExpiration` token expiration type.
139+
- `expiresAt`: Specify the token expiration date and time in
140+
[RFC3339 format](/influxdb3/cloud-dedicated/reference/glossary/#rfc3339-timestamp).
141+
142+
> [!Note]
143+
> `expiresAt` is only required when `expirationType` is `datetime`.
125144
126145
The following example shows how to use the Management API to create a database token:
127146

@@ -144,7 +163,9 @@ curl \
144163
"action": "read",
145164
"resource": "DATABASE_NAME"
146165
}
147-
]
166+
],
167+
"expirationType": "datetime",
168+
"expiresAt": "2030-01-01T00:00:00Z"
148169
}'
149170
```
150171

@@ -195,6 +216,7 @@ The Management API outputs JSON format in the response body.
195216
- [Create a token with read-only access to a database](#create-a-token-with-read-only-access-to-a-database)
196217
- [Create a token with read-only access to multiple databases](#create-a-token-with-read-only-access-to-multiple-databases)
197218
- [Create a token with mixed permissions to multiple databases](#create-a-token-with-mixed-permissions-to-multiple-databases)
219+
- [Create a token that expires in seven days](#create-a-token-that-expires-in-seven-days)
198220

199221
In the examples below, replace the following:
200222

@@ -241,7 +263,8 @@ curl \
241263
"action": "read",
242264
"resource": "DATABASE_NAME"
243265
}
244-
]
266+
],
267+
"expirationType": "noExpiration"
245268
}'
246269
```
247270

@@ -435,3 +458,124 @@ curl \
435458
{{% /code-placeholders %}}
436459
{{% /code-tab-content %}}
437460
{{< /code-tabs-wrapper >}}
461+
462+
### Create a token that expires in seven days
463+
464+
{{< tabs-wrapper >}}
465+
{{% tabs "small" %}}
466+
[Linux](#)
467+
[macOS](#)
468+
{{% /tabs %}}
469+
{{% tab-content %}}
470+
471+
{{< code-tabs-wrapper >}}
472+
{{% code-tabs %}}
473+
[influxctl](#)
474+
[Management API](#)
475+
{{% /code-tabs %}}
476+
477+
{{% code-tab-content %}}
478+
{{% code-placeholders "DATABASE_NAME" %}}
479+
480+
<!-- pytest.mark.skip -->
481+
482+
```bash
483+
influxctl token create \
484+
--read-database DATABASE_NAME \
485+
--write-database DATABASE_NAME \
486+
--expires-at $(date -d "+7 days" +"%Y-%m-%dT%H:%M:%S%z") \
487+
"Read/write token for DATABASE_NAME with 7d expiration"
488+
```
489+
490+
{{% /code-placeholders %}}
491+
492+
{{% /code-tab-content %}}
493+
{{% code-tab-content %}}
494+
495+
{{% code-placeholders "DATABASE_NAME" %}}
496+
497+
```sh
498+
curl \
499+
--location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/tokens" \
500+
--header "Accept: application/json" \
501+
--header 'Content-Type: application/json' \
502+
--header "Authorization: Bearer MANAGEMENT_TOKEN" \
503+
--data "{
504+
\"description\": \"Read/write token for DATABASE_NAME\",
505+
\"permissions\": [
506+
{
507+
\"action\": \"write\",
508+
\"resource\": \"DATABASE_NAME\"
509+
},
510+
{
511+
\"action\": \"read\",
512+
\"resource\": \"DATABASE_NAME\"
513+
}
514+
],
515+
\"expirationType\": \"datetime\",
516+
\"expiresAt:\" \"$(date -d "+7 days" +"%Y-%m-%dT%H:%M:%S%z")\"
517+
}"
518+
```
519+
520+
{{% /code-placeholders %}}
521+
{{% /code-tab-content %}}
522+
{{< /code-tabs-wrapper >}}
523+
524+
{{% /tab-content %}}
525+
{{% tab-content %}}
526+
527+
{{< code-tabs-wrapper >}}
528+
{{% code-tabs %}}
529+
[influxctl](#)
530+
[Management API](#)
531+
{{% /code-tabs %}}
532+
533+
{{% code-tab-content %}}
534+
{{% code-placeholders "DATABASE_NAME" %}}
535+
536+
<!-- pytest.mark.skip -->
537+
538+
```bash
539+
influxctl token create \
540+
--read-database DATABASE_NAME \
541+
--write-database DATABASE_NAME \
542+
--expires-at $(gdate -d "+7 days" +"%Y-%m-%dT%H:%M:%S%z") \
543+
"Read/write token for DATABASE_NAME with 7d expiration"
544+
```
545+
546+
{{% /code-placeholders %}}
547+
548+
{{% /code-tab-content %}}
549+
{{% code-tab-content %}}
550+
551+
{{% code-placeholders "DATABASE_NAME" %}}
552+
553+
```sh
554+
curl \
555+
--location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/tokens" \
556+
--header "Accept: application/json" \
557+
--header 'Content-Type: application/json' \
558+
--header "Authorization: Bearer MANAGEMENT_TOKEN" \
559+
--data "{
560+
\"description\": \"Read/write token for DATABASE_NAME\",
561+
\"permissions\": [
562+
{
563+
\"action\": \"write\",
564+
\"resource\": \"DATABASE_NAME\"
565+
},
566+
{
567+
\"action\": \"read\",
568+
\"resource\": \"DATABASE_NAME\"
569+
}
570+
],
571+
\"expirationType\": \"datetime\",
572+
\"expiresAt:\" \"$(gdate -d "+7 days" +"%Y-%m-%dT%H:%M:%S%z")\"
573+
}"
574+
```
575+
576+
{{% /code-placeholders %}}
577+
{{% /code-tab-content %}}
578+
{{< /code-tabs-wrapper >}}
579+
580+
{{% /tab-content %}}
581+
{{< /tabs-wrapper >}}

0 commit comments

Comments
 (0)