[feat](authentication): add fe-authentication modules (api/spi/handler/plugins) #60407
+4,747
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Doris FE Authentication (fe-authentication)
This directory contains the modular authentication stack for Doris FE. It defines protocol-agnostic
models, a plugin SPI, a handler/orchestrator, and built-in plugin stubs. In the current phase, there
are no changes in fe-core; the handler is intentionally independent and can run with in-memory
registries.
For the full design rationale and details, see
auth.md.#60361
Scope and status (Phase 1)
Implemented now:
AuthenticationRequest,AuthenticationResult).AuthenticationProfile,AuthenticationBinding,Principal,Identity,Subject).validate/initialize/healthCheck/reload/close).AuthenticationService,BindingResolver,PluginManager).ProfileRegistry,BindingRegistry).Not yet wired (planned):
AuthenticationRequest.Module layout
fe-authentication-apife-authentication-spiAuthenticationPlugin,AuthenticationPluginFactory,AuthenticationResult).fe-authentication-handlerfe-authentication-pluginsfe-extension-spi/fe-extension-loaderArchitecture (current)
Dependency graph (compile-time):
Runtime flow (simplified):
Profile selection order
AuthenticationRequest.requestedProfileor request propertiesauth_profile/requested_profile)AuthenticationProfile.createDefault())If a profile is disabled and the binding is mandatory, resolution fails; otherwise it falls back.
Developer usage (today)
1) Create profiles and bindings
2) Build request and authenticate
Notes:
PluginManagerusesServiceLoaderto discoverAuthenticationPluginFactoryon the classpath.Provide
META-INF/services/org.apache.doris.authentication.spi.AuthenticationPluginFactoryinplugin jars to enable discovery.
AuthenticationExceptionbecause fe-core wiringis not done yet.
Plugin development (SPI)
Implement:
AuthenticationPlugin(business logic, supports/validate/initialize/authenticate)AuthenticationPluginFactory(creates plugin instances)ServiceLoader file:
External plugin packaging (planned):
plugin.propertiesfields (recommended):Classloader rules (planned):
java.*, logging, and Doris SPI/API packagesPlanned user experience (future)
Proposed DDL (subject to final syntax):
Multi-step authentication:
AuthenticationResult.CONTINUEwith challenge data.authStateand credential.Integration plan (future adaptation)
AuthenticationRequest.Compatibility and migration