lasdf1234 opened a new pull request, #10967:
URL: https://github.com/apache/gravitino/pull/10967
### What changes were proposed in this pull request?
This PR wires the new `authenticators:authenticator-basic` module into the
server authentication flow.
The changes include:
- adding the new `authenticators:authenticator-basic` Gradle module
- making the `server` module depend on `authenticator-basic`
- introducing `AuthenticatorType.BASIC`
- wiring `gravitino.authenticators=basic` to load
`org.apache.gravitino.auth.local.BasicAuthenticator`
- adding tests for authenticator factory wiring and Basic authentication
header handling
- returning `400 Bad Request` for malformed Basic authorization headers and
`401 Unauthorized` for missing or invalid Basic authorization headers
### Why are the changes needed?
This is the module wiring work for local authentication. It enables
Gravitino to recognize and load the new Basic authenticator module when
`gravitino.authenticators=basic`, which is the foundation for the follow-up
local authentication tasks.
Fix: #10960
### Does this PR introduce _any_ user-facing change?
Yes.
- Gravitino now recognizes `basic` as a valid value of
`gravitino.authenticators`
- malformed Basic authorization headers now return `400 Bad Request`
- missing or invalid Basic authorization headers now return `401
Unauthorized`
### How was this patch tested?
- added `TestAuthenticatorFactory` to verify `basic` loads
`BasicAuthenticator`
- added `TestBasicAuthenticator` to verify Basic header error handling
- updated `TestAuthenticationFilter` to verify `BadRequestException` maps to
HTTP 400
- ran:
- `./gradlew --no-daemon :authenticators:authenticator-basic:build`
- `./gradlew --no-daemon :server-common:test --tests
org.apache.gravitino.server.authentication.TestAuthenticationFilter`
- `./gradlew --no-daemon :server:test --tests
org.apache.gravitino.server.authentication.TestAuthenticatorFactory`
- `./gradlew --no-daemon classes testClasses`
--
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]