[feat](authentication): add fe-authentication modules (api/spi/handler/plugins)#60407
Open
CalvinKirs wants to merge 4 commits intoapache:masterfrom
Open
[feat](authentication): add fe-authentication modules (api/spi/handler/plugins)#60407CalvinKirs wants to merge 4 commits intoapache:masterfrom
CalvinKirs wants to merge 4 commits intoapache:masterfrom
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
morningman
reviewed
Feb 8, 2026
| /** | ||
| * Authentication plugin type enumeration. | ||
| */ | ||
| public enum AuthenticationPluginType { |
Contributor
There was a problem hiding this comment.
if this is hardcoded, what if user implement a new type that is not included here? Do they have to modify this file too?
morningman
reviewed
Feb 8, 2026
| * return AuthenticationResult.failure(new AuthenticationException("Invalid password")); | ||
| * }</pre> | ||
| */ | ||
| public final class AuthenticationResult { |
Contributor
There was a problem hiding this comment.
- why final? are you sure we can use same request/result for all types of authemtication?
- why put
resultin SPI butrequestin API?
morningman
reviewed
Feb 8, 2026
| * @see Principal | ||
| * @see Identity | ||
| */ | ||
| public final class Subject { |
Contributor
There was a problem hiding this comment.
what is diff between Subject and Principal?
| * Uses {@link ServiceLoader} for classpath plugins and {@link PluginLoader} | ||
| * for external plugins.</p> | ||
| */ | ||
| public class PluginManager { |
Contributor
There was a problem hiding this comment.
Suggested change
| public class PluginManager { | |
| public class AuthPluginManager { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#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
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