lasdf1234 opened a new pull request, #11688:
URL: https://github.com/apache/gravitino/pull/11688
### What changes were proposed in this pull request?
This PR implements the **server-side** work for built-in IdP Basic
authentication in the Web UI (#11680, subtask of #11682):
- Add `basic` to `AuthenticatorType` and treat it as a configuration token;
`BasicAuthenticator` is still registered by the `idp-basic` plugin at Jersey
startup.
- Add `IdpBasicAuthConfigValidator` and validate configuration during
`GravitinoServer` initialization and `IdpRESTFeature` startup:
- `basic` and
`gravitino.server.rest.extensionPackages=org.apache.gravitino.idp.web.rest.feature`
must be configured **together**; startup fails if only one is set.
- `basic` and `simple` cannot be configured together.
- Expose `basic` through the existing `/configs` response
(`gravitino.authenticators`) so the Web UI can detect the auth type.
- Update operator documentation and OpenAPI description for the Basic auth +
Web UI contract.
**Out of scope (tracked in #11681):** Web UI login form, axios Basic header
handling, and session routing for `authType === 'basic'`.
### Why are the changes needed?
Built-in IdP previously relied on implicit OAuth-only wiring when the
extension package was enabled, and documentation stated that the Web UI could
not use Basic login. #11680 requires an explicit `basic` authenticator type and
strict startup rules so operators and the Web UI share a clear server contract
before frontend work lands in #11681.
Fix: #11680
### Does this PR introduce _any_ user-facing change?
Yes.
1. New authenticator token: `basic` in `gravitino.authenticators`.
2. Startup validation: enabling the idp-basic extension package without
`basic` (or listing `basic` without the extension package) now fails fast with
a clear error.
3. `basic` + `simple` together now fails at startup.
4. Documentation updates describe Basic auth configuration and Web UI auth
type detection (UI form implementation is #11681).
### How was this patch tested?
1. Added unit tests: `TestIdpBasicAuthConfigValidator`, updated
`TestIdpRESTFeature`.
2. Updated idp-basic integration test configs to use `basic`
(`BasicAuthOperationsIT`, `IdpRESTApiIT`).
3. Ran:
- `./gradlew :core:test --tests
"org.apache.gravitino.auth.TestIdpBasicAuthConfigValidator" -PskipITs`
- `./gradlew :plugins:idp-basic:test --tests
"org.apache.gravitino.idp.web.rest.feature.TestIdpRESTFeature" -PskipITs`
Made with [Cursor](https://cursor.com)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]