Skip to content

Commit 90da0f2

Browse files
authored
Merge pull request #6194 from influxdata/fix-v1-auth-monolith
Fix v1 auth monolith documentation and tooling
2 parents f244a52 + 77c4762 commit 90da0f2

File tree

29 files changed

+1167
-260
lines changed

29 files changed

+1167
-260
lines changed

api-docs/influxdb/cloud/v2/ref.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13731,7 +13731,7 @@ components:
1373113731
Default is [`RFC3339` date/time format](/influxdb/cloud/reference/glossary/#rfc3339-timestamp).
1373213732
To include nanoseconds in timestamps, use `RFC3339Nano`.
1373313733

13734-
#### Example formatted date/time values
13734+
### Example formatted date/time values
1373513735

1373613736
| Format | Value |
1373713737
|:------------|:----------------------------|

api-docs/influxdb/v2/v2/ref.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13270,7 +13270,7 @@ paths:
1327013270
application/json:
1327113271
schema:
1327213272
$ref: '#/components/schemas/LineProtocolError'
13273-
description: Line protocol poorly formed and no points were written. Response can be used to determine the first malformed line in the body line-protocol. All data in body was rejected and not written.
13273+
description: Line protocol is poorly formed and no points were written. Response can be used to determine the first malformed line in the body line-protocol.
1327413274
'401':
1327513275
content:
1327613276
application/json:
@@ -13282,7 +13282,7 @@ paths:
1328213282
application/json:
1328313283
schema:
1328413284
$ref: '#/components/schemas/Error'
13285-
description: No token was sent and they are required.
13285+
description: The request didn't provide an authorization token.
1328613286
'413':
1328713287
content:
1328813288
application/json:
@@ -13293,8 +13293,8 @@ paths:
1329313293
content:
1329413294
application/json:
1329513295
schema:
13296-
$ref: '#/components/schemas/Error'
13297-
description: The request was well-formed, but some or all the points were rejected due to semantic errors--for example, schema conflicts or retention policy violations. Error message contains details for one or more rejected points.
13296+
$ref: '#/components/schemas/Error'
13297+
description: The request was well-formed, but some points were rejected due to semantic errors--for example, schema conflicts or retention policy violations. Error message contains details for one or more rejected points.
1329813298
'429':
1329913299
description: Token is temporarily over quota. The Retry-After header describes when to try the write again.
1330013300
headers:
@@ -14857,7 +14857,7 @@ components:
1485714857
Default is [`RFC3339` date/time format](/influxdb/v2/reference/glossary/#rfc3339-timestamp).
1485814858
To include nanoseconds in timestamps, use `RFC3339Nano`.
1485914859

14860-
#### Example formatted date/time values
14860+
### Example formatted date/time values
1486114861

1486214862
| Format | Value |
1486314863
|:------------|:----------------------------|

api-docs/influxdb3/cloud-dedicated/v2/ref.yml

Lines changed: 59 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ tags:
6363
name: API compatibility
6464
x-traitTag: true
6565
- description: |
66-
Use one of the following schemes to authenticate to the InfluxDB API:
67-
68-
- [Bearer authentication](#section/Authentication/BearerAuthentication)
69-
- [Token authentication](#section/Authentication/TokenAuthentication)
70-
- [Basic authentication](#section/Authentication/BasicAuthentication)
71-
- [Querystring authentication](#section/Authentication/QuerystringAuthentication)
66+
Depending on your workflow, use one of the following schemes to authenticate to the InfluxDB 3 API:
67+
68+
| Authentication scheme | Works with |
69+
|:-------------------|:-----------|
70+
| [Bearer authentication](#section/Authentication/BearerAuthentication) | All endpoints |
71+
| [Token authentication](#section/Authentication/TokenAuthentication) | v1, v2 endpoints |
72+
| [Basic authentication](#section/Authentication/BasicAuthentication) | v1 endpoints |
73+
| [Querystring authentication](#section/Authentication/QuerystringAuthentication) | v1 endpoints |
7274
<!-- ReDoc-Inject: <security-definitions> -->
7375
name: Authentication
7476
x-traitTag: true
@@ -1097,7 +1099,7 @@ components:
10971099
Default is [`RFC3339` date/time format](/influxdb3/cloud-dedicated/reference/glossary/#rfc3339-timestamp).
10981100
To include nanoseconds in timestamps, use `RFC3339Nano`.
10991101
1100-
#### Example formatted date/time values
1102+
### Example formatted date/time values
11011103
11021104
| Format | Value |
11031105
|:------------|:----------------------------|
@@ -1978,61 +1980,45 @@ components:
19781980
type: string
19791981
securitySchemes:
19801982
BasicAuthentication:
1983+
type: http
1984+
scheme: basic
19811985
description: |
1982-
### Basic authentication scheme
1983-
1984-
Use the `Authorization` header with the `Basic` scheme to authenticate v1 API `/write` and `/query` requests.
1985-
When authenticating requests, InfluxDB 3 Cloud Dedicated checks that the `password` part of the decoded credential is an authorized [database token](/influxdb3/cloud-dedicated/admin/tokens/).
1986-
InfluxDB 3 Cloud Dedicated ignores the `username` part of the decoded credential.
1987-
1988-
### Syntax
1986+
Use the `Authorization` header with the `Basic` scheme to authenticate v1 API requests.
19891987
1990-
```http
1991-
Authorization: Basic <base64-encoded [USERNAME]:DATABASE_TOKEN>
1992-
```
1993-
1994-
Replace the following:
1988+
Works with v1 compatibility [`/write`](#operation/PostV1Write) and [`/query`](#operation/GetV1Query) endpoints in InfluxDB 3.
19951989
1996-
- **`[USERNAME]`**: an optional string value (ignored by InfluxDB 3 Cloud Dedicated).
1997-
- **`DATABASE_TOKEN`**: a [database token](/influxdb3/cloud-dedicated/admin/tokens/).
1998-
- Encode the `[USERNAME]:DATABASE_TOKEN` credential using base64 encoding, and then append the encoded string to the `Authorization: Basic` header.
1990+
When authenticating requests, InfluxDB 3 checks that the `password` part of the decoded credential is an authorized token
1991+
and ignores the `username` part of the decoded credential.
19991992
20001993
### Example
20011994
2002-
The following example shows how to use cURL with the `Basic` authentication scheme and a [database token](/influxdb3/cloud-dedicated/admin/tokens/):
2003-
2004-
```sh
2005-
#######################################
2006-
# Use Basic authentication with a database token
2007-
# to query the InfluxDB v1 HTTP API
2008-
#######################################
2009-
# Use the --user option with `--user username:DATABASE_TOKEN` syntax
2010-
#######################################
2011-
2012-
curl --get "http://cluster-id.a.influxdb.io/query" \
1995+
```bash
1996+
curl "https://cluster-id.a.influxdb.io/write?db=DATABASE_NAME&precision=s" \
20131997
--user "":"DATABASE_TOKEN" \
2014-
--data-urlencode "db=DATABASE_NAME" \
2015-
--data-urlencode "q=SELECT * FROM MEASUREMENT"
1998+
--header "Content-type: text/plain; charset=utf-8" \
1999+
--data-binary 'home,room=kitchen temp=72 1641024000'
20162000
```
20172001
20182002
Replace the following:
20192003
20202004
- **`DATABASE_NAME`**: your InfluxDB 3 Cloud Dedicated database
2021-
- **`DATABASE_TOKEN`**: a [database token](/influxdb3/cloud-dedicated/admin/tokens/) with sufficient permissions to the database
2022-
scheme: basic
2023-
type: http
2005+
- **`DATABASE_TOKEN`**: a database token with sufficient permissions to the database
2006+
2007+
#### Related guides
2008+
2009+
- [Authenticate v1 API requests](/influxdb3/cloud-dedicated/guides/api-compatibility/v1/)
2010+
- [Manage tokens](/influxdb3/cloud-dedicated/admin/tokens/)
20242011
QuerystringAuthentication:
20252012
type: apiKey
20262013
in: query
20272014
name: u=&p=
20282015
description: |
2029-
Use the Querystring authentication
2030-
scheme with InfluxDB 1.x API parameters to provide credentials through the query string.
2016+
Use InfluxDB 1.x API parameters to provide credentials through the query string for v1 API requests.
20312017
2032-
### Query string authentication
2018+
Querystring authentication works with v1-compatible [`/write`](#operation/PostV1Write) and [`/query`](#operation/GetV1Query) endpoints.
20332019
2034-
In the URL, pass the `p` query parameter to authenticate `/write` and `/query` requests.
2035-
When authenticating requests, InfluxDB 3 Cloud Dedicated checks that `p` (_password_) is an authorized database token and ignores the `u` (_username_) parameter.
2020+
When authenticating requests, InfluxDB 3 checks that the `p` (_password_) query parameter is an authorized token
2021+
and ignores the `u` (_username_) query parameter.
20362022
20372023
### Syntax
20382024
@@ -2041,11 +2027,20 @@ components:
20412027
https://cluster-id.a.influxdb.io/write/?[u=any]&p=DATABASE_TOKEN
20422028
```
20432029
2044-
### Example
2030+
### Examples
2031+
2032+
```bash
2033+
curl "https://cluster-id.a.influxdb.io/write?db=DATABASE_NAME&precision=s&p=DATABASE_TOKEN" \
2034+
--header "Content-type: text/plain; charset=utf-8" \
2035+
--data-binary 'home,room=kitchen temp=72 1641024000'
2036+
```
20452037
2046-
The following example shows how to use cURL with query string authentication and a [database token](/influxdb3/cloud-dedicated/admin/tokens/).
2038+
Replace the following:
20472039
2048-
```sh
2040+
- **`DATABASE_NAME`**: your InfluxDB 3 Cloud Dedicated database
2041+
- **`DATABASE_TOKEN`**: a database token with sufficient permissions to the database
2042+
2043+
```bash
20492044
#######################################
20502045
# Use an InfluxDB 1.x compatible username and password
20512046
# to query the InfluxDB v1 HTTP API
@@ -2062,16 +2057,23 @@ components:
20622057
20632058
Replace the following:
20642059
2065-
- **`DATABASE_NAME`**: your InfluxDB 3 Cloud Dedicated database
2066-
- **`DATABASE_TOKEN`**: a [database token](/influxdb3/cloud-dedicated/admin/tokens/) with sufficient permissions to the database
2060+
- **`DATABASE_NAME`**: the database to query
2061+
- **`DATABASE_TOKEN`**: a database token with sufficient permissions to the database
2062+
2063+
#### Related guides
2064+
2065+
- [Authenticate v1 API requests](/influxdb3/cloud-dedicated/guides/api-compatibility/v1/)
2066+
- [Manage tokens](/influxdb3/cloud-dedicated/admin/tokens/)
20672067
BearerAuthentication:
20682068
type: http
20692069
scheme: bearer
20702070
bearerFormat: JWT
20712071
description: |
2072+
20722073
Use the OAuth Bearer authentication
2073-
scheme to authenticate to the InfluxDB API.
2074+
scheme to provide an authorization token to InfluxDB 3.
20742075
2076+
Bearer authentication works with all endpoints.
20752077
20762078
In your API requests, send an `Authorization` header.
20772079
For the header value, provide the word `Bearer` followed by a space and a database token.
@@ -2080,29 +2082,20 @@ components:
20802082
### Syntax
20812083
20822084
```http
2083-
Authorization: Bearer INFLUX_TOKEN
2085+
Authorization: Bearer DATABASE_TOKEN
20842086
```
20852087
20862088
### Example
20872089
2088-
```sh
2089-
########################################################
2090-
# Use the Bearer token authentication scheme with /api/v2/write
2091-
# to write data.
2092-
########################################################
2093-
2094-
curl --request post "https://cluster-id.a.influxdb.io/api/v2/write?bucket=DATABASE_NAME&precision=s" \
2095-
--header "Authorization: Bearer DATABASE_TOKEN" \
2096-
--data-binary 'home,room=kitchen temp=72 1463683075'
2090+
```bash
2091+
curl https://cluster-id.a.influxdb.io/api/v3/query_influxql \
2092+
--header "Authorization: Bearer DATABASE_TOKEN"
20972093
```
2098-
2099-
For examples and more information, see the following:
2100-
- [Authenticate API requests](/influxdb3/cloud-dedicated/primers/api/v2/#authenticate-api-requests)
2101-
- [Manage tokens](/influxdb3/cloud-dedicated/admin/tokens/)
21022094
TokenAuthentication:
21032095
description: |
2104-
Use the Token authentication
2105-
scheme to authenticate to the InfluxDB API.
2096+
Use InfluxDB v2 Token authentication to provide an authorization token to InfluxDB 3.
2097+
2098+
The v2 Token scheme works with v1 and v2 compatibility endpoints in InfluxDB 3.
21062099
21072100
In your API requests, send an `Authorization` header.
21082101
For the header value, provide the word `Token` followed by a space and a database token.
@@ -2111,7 +2104,7 @@ components:
21112104
### Syntax
21122105
21132106
```http
2114-
Authorization: Token INFLUX_API_TOKEN
2107+
Authorization: Token DATABASE_TOKEN
21152108
```
21162109
21172110
### Example
@@ -2129,7 +2122,6 @@ components:
21292122
21302123
### Related guides
21312124
2132-
- [Authenticate API requests](/influxdb3/cloud-dedicated/primers/api/v2/#authenticate-api-requests)
21332125
- [Manage tokens](/influxdb3/cloud-dedicated/admin/tokens/)
21342126
in: header
21352127
name: Authorization

api-docs/influxdb3/cloud-serverless/v2/ref.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9414,7 +9414,7 @@ components:
94149414
Default is [`RFC3339` date/time format](/influxdb3/cloud-serverless/reference/glossary/#rfc3339-timestamp).
94159415
To include nanoseconds in timestamps, use `RFC3339Nano`.
94169416
9417-
#### Example formatted date/time values
9417+
### Example formatted date/time values
94189418
94199419
| Format | Value |
94209420
|:------------|:----------------------------|

0 commit comments

Comments
 (0)