Commit 2ea2fcb
authored
feat(go/adbc/driver/flightsql): Add OAuth Support to Flight Client (apache#2651)
## Description
This pull request introduces OAuth support to the Flight client in the
GO driver. The changes include the addition of OAuth access token
support, implementation of token exchange and client credentials OAuth
flows.
## Related Issues
- Closes #[2650](apache#2650)
## Changes Made
1. Added `token` as a database option
1. Added support for [Token
Exchange](https://datatracker.ietf.org/doc/html/rfc8693). If configured,
`token` gets exchanged and the result is added to the `Authorization`
header as a `Bearer` token
1. Added support for [Client
Credentials](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4).
If configured, `client_id` and `client_secret` are used to obtain a
access token that is added to the `Authorization` header as a `Bearer`
token
1. Added new driver options to allow third-party applications to
configure oauth flows:
1. Added tests
Here's the markdown code for the OAuth 2.0 configuration options table:
markdown# OAuth 2.0 Configuration Options
| Option | Description |
|--------|-------------|
| `adbc.flight.sql.oauth.flow` | Specifies the OAuth 2.0 flow type to
use. Possible values: `client_credentials`, `token_exchange` |
| `adbc.flight.sql.oauth.client_id` | Unique identifier issued to the
client application by the authorization server |
| `adbc.flight.sql.oauth.client_secret` | Secret associated to the
client_id. Used to authenticate the client application to the
authorization server |
| `adbc.flight.sql.oauth.token_uri` | The endpoint URL where the client
application requests tokens from the authorization server |
| `adbc.flight.sql.oauth.scope` | Space-separated list of permissions
that the client is requesting access to (e.g `"read.all
offline_access"`) |
| `adbc.flight.sql.oauth.exchange.subject_token` | The security token
that the client application wants to exchange |
| `adbc.flight.sql.oauth.exchange.subject_token_type` | Identifier for
the type of the subject token. Check list below for supported token
types. |
| `adbc.flight.sql.oauth.exchange.actor_token` | A security token that
represents the identity of the acting party |
| `adbc.flight.sql.oauth.exchange.actor_token_type` | Identifier for the
type of the actor token. Check list below for supported token types. |
| `adbc.flight.sql.oauth.exchange.aud` | The intended audience for the
requested security token |
| `adbc.flight.sql.oauth.exchange.resource` | The resource server where
the client intends to use the requested security token |
| `adbc.flight.sql.oauth.exchange.scope` | Specific permissions
requested for the new token |
| `adbc.flight.sql.oauth.exchange.requested_token_type` | The type of
token the client wants to receive in exchange. Check list below for
supported token types. |
**Supported token types:**
* `urn:ietf:params:oauth:token-type:access_token`
* `urn:ietf:params:oauth:token-type:refresh_token`
* `urn:ietf:params:oauth:token-type:id_token`
* `urn:ietf:params:oauth:token-type:saml1`
* `urn:ietf:params:oauth:token-type:saml2`
* `urn:ietf:params:oauth:token-type:jwt`1 parent 7f1dfca commit 2ea2fcb
File tree
5 files changed
+650
-32
lines changed- docs/source/driver
- go/adbc/driver/flightsql
5 files changed
+650
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
162 | 168 | | |
163 | 169 | | |
164 | 170 | | |
| |||
246 | 252 | | |
247 | 253 | | |
248 | 254 | | |
249 | | - | |
| 255 | + | |
250 | 256 | | |
251 | 257 | | |
252 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
253 | 316 | | |
254 | 317 | | |
255 | 318 | | |
| |||
0 commit comments