turboFei commented on code in PR #3905:
URL: https://github.com/apache/amoro/pull/3905#discussion_r2516903857
##########
amoro-ams/src/main/java/org/apache/amoro/server/dashboard/DashboardServer.java:
##########
@@ -90,6 +92,8 @@ public class DashboardServer {
private final ApiTokenController apiTokenController;
private final PasswdAuthenticationProvider basicAuthProvider;
+ private final TokenAuthenticationProvider bearerAuthProvider;
+ private final String proxyClientIpHeader;
Review Comment:
done
##########
amoro-ams/src/main/java/org/apache/amoro/server/authentication/HttpAuthenticationFactory.java:
##########
@@ -40,4 +57,28 @@ private static <T> T createAuthenticationProvider(
throw new IllegalStateException(className + " must extend of " +
expected.getName());
}
}
+
+ public static TokenCredential getBearerTokenCredential(
+ Context context, String proxyClientIpHeader) {
+ return new DefaultTokenCredential(
+ getBearerToken(context), getCredentialExtraInfo(context,
proxyClientIpHeader));
+ }
+
+ private static String getBearerToken(Context context) {
+ String authorization = context.header(Header.AUTHORIZATION);
+ if (authorization != null) {
Review Comment:
done
--
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]