Skip to content

Commit f15cc90

Browse files
committed
merge docs
1 parent 80c3fd5 commit f15cc90

File tree

1 file changed

+27
-98
lines changed

1 file changed

+27
-98
lines changed

mkdocs/docs/configuration.md

Lines changed: 27 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,15 @@ Legacy OAuth2 Properties will be removed in PyIceberg 1.0 in place of pluggable
384384

385385
The RESTCatalog supports pluggable authentication via the `auth` configuration block. This allows you to specify which how the access token will be fetched and managed for use with the HTTP requests to the RESTCatalog server. The authentication method is selected by setting the `auth.type` property, and additional configuration can be provided as needed for each method.
386386

387-
###### Supported Authentication Types
387+
##### Supported Authentication Types
388388

389389
- `noop`: No authentication (no Authorization header sent).
390390
- `basic`: HTTP Basic authentication.
391+
- `oauth2`: OAuth2 client credentials flow.
392+
- `legacyoauth2`: Legacy OAuth2 client credentials flow (Deprecated and will be removed in PyIceberg 1.0.0)
391393
- `custom`: Custom authentication manager (requires `auth.impl`).
392394

393-
###### Configuration Properties
395+
##### Configuration Properties
394396

395397
The `auth` block is structured as follows:
396398

@@ -406,25 +408,26 @@ catalog:
406408
impl: <custom_class_path> # Only for custom auth
407409
```
408410

409-
###### Property Reference
411+
**Property Reference:**
410412

411413
| Property | Required | Description |
412414
|------------------|----------|-------------------------------------------------------------------------------------------------|
413-
| `auth.type` | Yes | The authentication type to use (`noop`, `basic`, or `custom`). |
415+
| `auth.type` | Yes | The authentication type to use (`noop`, `basic`, `oauth2`, or `custom`). |
414416
| `auth.impl` | Conditionally | The fully qualified class path for a custom AuthManager. Required if `auth.type` is `custom`. |
415417
| `auth.basic` | If type is `basic` | Block containing `username` and `password` for HTTP Basic authentication. |
418+
| `auth.oauth2` | If type is `oauth2` | Block containing OAuth2 configuration (see below). |
416419
| `auth.custom` | If type is `custom` | Block containing configuration for the custom AuthManager. |
417420

418-
###### Examples
421+
##### Examples
419422

420-
No Authentication:
423+
**No Authentication:**
421424

422425
```yaml
423426
auth:
424427
type: noop
425428
```
426429

427-
Basic Authentication:
430+
**Basic Authentication:**
428431

429432
```yaml
430433
auth:
@@ -434,7 +437,21 @@ auth:
434437
password: mypass
435438
```
436439

437-
Custom Authentication:
440+
**OAuth2 Authentication:**
441+
442+
```yaml
443+
auth:
444+
type: oauth2
445+
oauth2:
446+
client_id: my-client-id
447+
client_secret: my-client-secret
448+
token_url: https://auth.example.com/oauth/token
449+
scope: read
450+
refresh_margin: 60 # (optional) seconds before expiry to refresh
451+
expires_in: 3600 # (optional) fallback if server does not provide
452+
```
453+
454+
**Custom Authentication:**
438455

439456
```yaml
440457
auth:
@@ -445,11 +462,11 @@ auth:
445462
property2: value2
446463
```
447464

448-
###### Notes
465+
##### Notes
449466

450467
- If `auth.type` is `custom`, you **must** specify `auth.impl` with the full class path to your custom AuthManager.
451468
- If `auth.type` is not `custom`, specifying `auth.impl` is not allowed.
452-
- The configuration block under each type (e.g., `basic`, `custom`) is passed as keyword arguments to the corresponding AuthManager.
469+
- The configuration block under each type (e.g., `basic`, `oauth2`, `custom`) is passed as keyword arguments to the corresponding AuthManager.
453470

454471
<!-- markdown-link-check-enable-->
455472

@@ -518,94 +535,6 @@ catalog:
518535
py-io-impl: pyiceberg.io.fsspec.FsspecFileIO
519536
```
520537

521-
#### Authentication in RESTCatalog
522-
523-
The RESTCatalog supports pluggable authentication via the `auth` configuration block. This allows you to specify which how the access token will be fetched and managed for use with the HTTP requests to the RESTCatalog server. The authentication method is selected by setting the `auth.type` property, and additional configuration can be provided as needed for each method.
524-
525-
##### Supported Authentication Types
526-
527-
- `noop`: No authentication (no Authorization header sent).
528-
- `basic`: HTTP Basic authentication.
529-
- `oauth2`: OAuth2 client credentials flow.
530-
- `legacyoauth2`: Legacy OAuth2 client credentials flow (Deprecated and will be removed in PyIceberg 1.0.0)
531-
- `custom`: Custom authentication manager (requires `auth.impl`).
532-
533-
##### Configuration Properties
534-
535-
The `auth` block is structured as follows:
536-
537-
```yaml
538-
catalog:
539-
default:
540-
type: rest
541-
uri: http://rest-catalog/ws/
542-
auth:
543-
type: <auth_type>
544-
<auth_type>:
545-
# Type-specific configuration
546-
impl: <custom_class_path> # Only for custom auth
547-
```
548-
549-
**Property Reference:**
550-
551-
| Property | Required | Description |
552-
|------------------|----------|-------------------------------------------------------------------------------------------------|
553-
| `auth.type` | Yes | The authentication type to use (`noop`, `basic`, `oauth2`, or `custom`). |
554-
| `auth.impl` | Conditionally | The fully qualified class path for a custom AuthManager. Required if `auth.type` is `custom`. |
555-
| `auth.basic` | If type is `basic` | Block containing `username` and `password` for HTTP Basic authentication. |
556-
| `auth.oauth2` | If type is `oauth2` | Block containing OAuth2 configuration (see below). |
557-
| `auth.custom` | If type is `custom` | Block containing configuration for the custom AuthManager. |
558-
559-
##### Examples
560-
561-
**No Authentication:**
562-
563-
```yaml
564-
auth:
565-
type: noop
566-
```
567-
568-
**Basic Authentication:**
569-
570-
```yaml
571-
auth:
572-
type: basic
573-
basic:
574-
username: myuser
575-
password: mypass
576-
```
577-
578-
**OAuth2 Authentication:**
579-
580-
```yaml
581-
auth:
582-
type: oauth2
583-
oauth2:
584-
client_id: my-client-id
585-
client_secret: my-client-secret
586-
token_url: https://auth.example.com/oauth/token
587-
scope: read
588-
refresh_margin: 60 # (optional) seconds before expiry to refresh
589-
expires_in: 3600 # (optional) fallback if server does not provide
590-
```
591-
592-
**Custom Authentication:**
593-
594-
```yaml
595-
auth:
596-
type: custom
597-
impl: mypackage.module.MyAuthManager
598-
custom:
599-
property1: value1
600-
property2: value2
601-
```
602-
603-
##### Notes
604-
605-
- If `auth.type` is `custom`, you **must** specify `auth.impl` with the full class path to your custom AuthManager.
606-
- If `auth.type` is not `custom`, specifying `auth.impl` is not allowed.
607-
- The configuration block under each type (e.g., `basic`, `oauth2`, `custom`) is passed as keyword arguments to the corresponding AuthManager.
608-
609538
### SQL Catalog
610539

611540
The SQL catalog requires a database for its backend. PyIceberg supports PostgreSQL and SQLite through psycopg2. The database connection has to be configured using the `uri` property. The init_catalog_tables is optional and defaults to True. If it is set to False, the catalog tables will not be created when the SQLCatalog is initialized. See SQLAlchemy's [documentation for URL format](https://docs.sqlalchemy.org/en/20/core/engines.html#backend-specific-urls):

0 commit comments

Comments
 (0)