Commit feb3eb2
committed
[DO NOT MERGE] Core, REST, OAuth2: AuthManager v2 (MVP)
**Do not review this PR unless you are curious to get an early preview of Auth Manager v2 :-)**
This PR encompasses the full scope of the AuthManager v2 effort, except support for human-to-machine grants (Authorization Code and Device Code), which will be introduced in a subsequent update. Cf. Auth Manager v2 [design document].
The goal is to provide complete overview of the planned changes for the curious reader. This PR is not meant to be merged as-is: smaller, incremental PRs will be opened later to introduce these changes gradually.
**Key features of the new implementation:**
- **Standards-compliant OAuth2/OIDC support** with proper client authentication methods (`client_secret_basic`, `client_secret_post`, `none`)
- **OpenID Connect Discovery** for automatic endpoint resolution via `issuer-url`
- **Token Exchange** support (RFC 8693) and **Refresh Token** flows
- **Custom token endpoint parameters** (e.g. Auth0 `audience` via `rest.auth.oauth2.extra-params.*`)
- **Automatic background token refresh**
- **Automatic migration** of legacy property names with deprecation warnings at runtime
**Architecture:**
- `oauth2/` — Core classes: `OAuth2Manager`, `OAuth2Session`, `OAuth2Runtime`, `OAuth2Config`
- `oauth2/config/` — Configuration model: `BasicConfig`, `TokenExchangeConfig`, `TokenRefreshConfig`, `ConfigMigrator`, `ConfigValidator`
- `oauth2/flow/` — OAuth2 grant flows: `ClientCredentialsFlow`, `RefreshTokenFlow`, `TokenExchangeFlow`, `EndpointProvider`
- `oauth2/client/` — Low-level `OAuth2Client` for HTTP token requests
- `oauth2/http/` — `RESTClientAdapter` bridging Iceberg's `RESTClient` to the OAuth2 client
**Deprecations:**
- `org.apache.iceberg.rest.auth.OAuth2Manager` — deprecated, removal planned for 1.14.0
- `org.apache.iceberg.rest.auth.OAuth2Properties` — deprecated in favor of `OAuth2Config`
- `org.apache.iceberg.rest.auth.OAuth2Util` — deprecated in favor of the new `OAuth2Manager`
Other deprecations affect the REST layer (error handlers, etc.).
**Docs:**
Adds an OAuth2 configuration reference page (auto-generated from code) and a migration guide.
**Tests:**
~11,000 lines of new tests including unit tests for all components with MockServer, and Keycloak-based integration tests.
[design document]:https://docs.google.com/document/d/1Hxw-t8Maa7wZFmrlSujm7LRawKsFP3Q31tET_3aRnQU/edit1 parent 69caca0 commit feb3eb2
78 files changed
Lines changed: 11030 additions & 11 deletions
File tree
- .github/workflows
- core/src
- docs/java/org/apache/iceberg/rest/auth/oauth2/docs
- intTest/java/org/apache/iceberg/rest/auth/oauth2
- client
- main/java/org/apache/iceberg/rest
- auth
- oauth2
- client
- config
- flow
- http
- responses
- testFixtures
- java/org/apache/iceberg/rest/auth/oauth2/test
- container
- expectation
- junit
- resources
- test/java/org/apache/iceberg/rest
- auth
- oauth2
- client
- config
- flow
- http
- docs/docs
- gradle
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
360 | 363 | | |
361 | 364 | | |
362 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
363 | 397 | | |
364 | 398 | | |
365 | 399 | | |
| |||
384 | 418 | | |
385 | 419 | | |
386 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
387 | 425 | | |
388 | 426 | | |
389 | 427 | | |
390 | 428 | | |
391 | 429 | | |
| 430 | + | |
392 | 431 | | |
393 | 432 | | |
394 | 433 | | |
| |||
398 | 437 | | |
399 | 438 | | |
400 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
401 | 474 | | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
402 | 542 | | |
403 | 543 | | |
404 | 544 | | |
| |||
0 commit comments