You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `auth.type` | Yes | The authentication type to use (`noop`, `basic`, or `custom`). |
416
+
| `auth.type` | Yes | The authentication type to use (`noop`, `basic`, `oauth2`, or `custom`). |
415
417
| `auth.impl` | Conditionally | The fully qualified class path for a custom AuthManager. Required if `auth.type` is `custom`. |
416
418
| `auth.basic` | If type is `basic` | Block containing `username` and `password` for HTTP Basic authentication. |
419
+
| `auth.oauth2` | If type is `oauth2` | Block containing OAuth2 configuration (see below). |
417
420
| `auth.custom` | If type is `custom` | Block containing configuration for the custom AuthManager. |
418
421
| `auth.google` | If type is `google` | Block containing `credentials_path` to a service account file (if using). Will default to using Application Default Credentials. |
419
422
@@ -436,6 +439,20 @@ auth:
436
439
password: mypass
437
440
```
438
441
442
+
OAuth2 Authentication:
443
+
444
+
```yaml
445
+
auth:
446
+
type: oauth2
447
+
oauth2:
448
+
client_id: my-client-id
449
+
client_secret: my-client-secret
450
+
token_url: https://auth.example.com/oauth/token
451
+
scope: read
452
+
refresh_margin: 60 # (optional) seconds before expiry to refresh
453
+
expires_in: 3600 # (optional) fallback if server does not provide
454
+
```
455
+
439
456
Custom Authentication:
440
457
441
458
```yaml
@@ -451,7 +468,7 @@ auth:
451
468
452
469
- If `auth.type` is `custom`, you **must** specify `auth.impl` with the full class path to your custom AuthManager.
453
470
- If `auth.type` is not `custom`, specifying `auth.impl` is not allowed.
454
-
- The configuration block under each type (e.g., `basic`, `custom`) is passed as keyword arguments to the corresponding AuthManager.
471
+
- The configuration block under each type (e.g., `basic`, `oauth2`, `custom`) is passed as keyword arguments to the corresponding AuthManager.
455
472
456
473
<!-- markdown-link-check-enable-->
457
474
@@ -520,94 +537,6 @@ catalog:
520
537
py-io-impl: pyiceberg.io.fsspec.FsspecFileIO
521
538
```
522
539
523
-
#### Authentication in RESTCatalog
524
-
525
-
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.
526
-
527
-
##### Supported Authentication Types
528
-
529
-
- `noop`: No authentication (no Authorization header sent).
530
-
- `basic`: HTTP Basic authentication.
531
-
- `oauth2`: OAuth2 client credentials flow.
532
-
- `legacyoauth2`: Legacy OAuth2 client credentials flow (Deprecated and will be removed in PyIceberg 1.0.0)
| `auth.type` | Yes | The authentication type to use (`noop`, `basic`, `oauth2`, or `custom`). |
556
-
| `auth.impl` | Conditionally | The fully qualified class path for a custom AuthManager. Required if `auth.type` is `custom`. |
557
-
| `auth.basic` | If type is `basic` | Block containing `username` and `password` for HTTP Basic authentication. |
558
-
| `auth.oauth2` | If type is `oauth2` | Block containing OAuth2 configuration (see below). |
559
-
| `auth.custom` | If type is `custom` | Block containing configuration for the custom AuthManager. |
560
-
561
-
##### Examples
562
-
563
-
**No Authentication:**
564
-
565
-
```yaml
566
-
auth:
567
-
type: noop
568
-
```
569
-
570
-
**Basic Authentication:**
571
-
572
-
```yaml
573
-
auth:
574
-
type: basic
575
-
basic:
576
-
username: myuser
577
-
password: mypass
578
-
```
579
-
580
-
**OAuth2 Authentication:**
581
-
582
-
```yaml
583
-
auth:
584
-
type: oauth2
585
-
oauth2:
586
-
client_id: my-client-id
587
-
client_secret: my-client-secret
588
-
token_url: https://auth.example.com/oauth/token
589
-
scope: read
590
-
refresh_margin: 60 # (optional) seconds before expiry to refresh
591
-
expires_in: 3600 # (optional) fallback if server does not provide
592
-
```
593
-
594
-
**Custom Authentication:**
595
-
596
-
```yaml
597
-
auth:
598
-
type: custom
599
-
impl: mypackage.module.MyAuthManager
600
-
custom:
601
-
property1: value1
602
-
property2: value2
603
-
```
604
-
605
-
##### Notes
606
-
607
-
- If `auth.type` is `custom`, you **must** specify `auth.impl` with the full class path to your custom AuthManager.
608
-
- If `auth.type` is not `custom`, specifying `auth.impl` is not allowed.
609
-
- The configuration block under each type (e.g., `basic`, `oauth2`, `custom`) is passed as keyword arguments to the corresponding AuthManager.
610
-
611
540
### SQL Catalog
612
541
613
542
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