Skip to content

[CELEBORN-2456] Fix wrong isAssignableFrom direction in Basic/Bearer authenticationSupported - #3841

Open
yew1eb wants to merge 1 commit into
apache:mainfrom
yew1eb:CELEBORN-2456
Open

[CELEBORN-2456] Fix wrong isAssignableFrom direction in Basic/Bearer authenticationSupported#3841
yew1eb wants to merge 1 commit into
apache:mainfrom
yew1eb:CELEBORN-2456

Conversation

@yew1eb

@yew1eb yew1eb commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Fix the reversed isAssignableFrom direction in BasicAuthenticationHandler and BearerAuthenticationHandler (its result was also discarded, making the check a no-op), and fail fast in AuthenticationFilter.init when schemes are configured but no handler is registered.

Why are the changes needed?

The broken check lets invalid providers pass startup validation; if the provider class cannot be loaded and it is the only configured scheme, all requests are silently served without authentication.

Does this PR resolve a correctness bug?

  • Yes

Does this PR introduce any user-facing change?

  • Yes

How was this patch tested?

Added AuthenticationHandlerSuite

…authenticationSupported

The provider type check in BasicAuthenticationHandler and BearerAuthenticationHandler evaluated Class.forName(providerClass).isAssignableFrom(<SPI interface>) in the wrong direction, and its result was discarded anyway, making the check a no-op. Return the correctly-directed check result so invalid providers are rejected at startup, and fail fast in AuthenticationFilter.init when schemes are configured but no handler was registered, instead of silently serving requests without authentication.
@yew1eb yew1eb closed this Sep 7, 2026
@yew1eb yew1eb reopened this Sep 7, 2026
@yew1eb

yew1eb commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Ping @turboFei

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant