You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by bt...@apache.org on 2026/03/25 09:18:34 UTC
(hadoop) branch branch-3.5 updated: YARN-11953. Use the HTTP auth type property to check the necessary authentication steps in CS UI. (#8374) (#8375)
This is an automated email from the ASF dual-hosted git repository.
bteke pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.5 by this push:
new 25038599c6d YARN-11953. Use the HTTP auth type property to check the necessary authentication steps in CS UI. (#8374) (#8375)
25038599c6d is described below
commit 25038599c6dc4bd013be0415b8d190b70be9d8e9
Author: Benjamin Teke <br...@users.noreply.github.com>
AuthorDate: Wed Mar 25 10:18:26 2026 +0100
YARN-11953. Use the HTTP auth type property to check the necessary authentication steps in CS UI. (#8374) (#8375)
(cherry picked from commit a05185a550b5fed1ae4ce9a523e4a1e69c2b05a8)
---
.../src/main/webapp/src/config/constants.ts | 5 +++++
.../src/main/webapp/src/lib/api/YarnApiClient.ts | 8 +++++---
.../src/main/webapp/src/lib/api/mocks/handlers.ts | 8 ++++----
.../src/main/webapp/src/lib/api/mocks/server-handlers.ts | 3 ++-
4 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/config/constants.ts b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/config/constants.ts
index 350ff472e00..0f8c2d01674 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/config/constants.ts
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/config/constants.ts
@@ -25,3 +25,8 @@
* When set to 'true', the UI will allow viewing and staging changes but prevent mutations.
*/
export const READ_ONLY_PROPERTY = 'yarn.webapp.scheduler-ui.read-only.enable';
+
+/**
+ * YARN configuration property that controls HTTP authentication for web UIs and REST APIs.
+ */
+export const HTTP_AUTH_PROPERTY = 'hadoop.http.authentication.type';
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/lib/api/YarnApiClient.ts b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/lib/api/YarnApiClient.ts
index c44657044cc..35fadf03d65 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/lib/api/YarnApiClient.ts
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/lib/api/YarnApiClient.ts
@@ -35,7 +35,7 @@ import type {
YarnConfigResponse,
ValidationResponse,
} from '~/types';
-import { READ_ONLY_PROPERTY } from '~/config';
+import { HTTP_AUTH_PROPERTY, READ_ONLY_PROPERTY } from '~/config';
export class YarnApiClient {
private readonly baseUrl: string;
@@ -238,11 +238,13 @@ export class YarnApiClient {
}
/**
- * Detect YARN security mode by checking hadoop.security.authentication
+ * Detect YARN security mode by checking the HTTP authentication type.
+ * This governs the REST API layer, which may differ from the cluster-wide
+ * hadoop.security.authentication setting (e.g. Kerberos RPC + simple HTTP).
*/
private async detectSecurityMode(): Promise<void> {
try {
- const authMode = await this.getConfiguration('hadoop.security.authentication');
+ const authMode = await this.getConfiguration(HTTP_AUTH_PROPERTY);
this.securityMode = authMode.toLowerCase() === 'simple' ? 'simple' : 'kerberos';
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/lib/api/mocks/handlers.ts b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/lib/api/mocks/handlers.ts
index 29c6b5c738c..ae9d231662e 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/lib/api/mocks/handlers.ts
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/lib/api/mocks/handlers.ts
@@ -19,7 +19,7 @@
import { http, HttpResponse, type HttpHandler } from 'msw';
import { API_CONFIG } from '~/lib/api/config';
-import { READ_ONLY_PROPERTY } from '~/config';
+import { HTTP_AUTH_PROPERTY, READ_ONLY_PROPERTY } from '~/config';
// Base URL pattern that matches the API configuration
@@ -114,11 +114,11 @@ const staticHandlers: HttpHandler[] = [
const url = new URL(request.url);
const configName = url.searchParams.get('name');
- // Handle security authentication mode query
- if (configName === 'hadoop.security.authentication') {
+ // Handle HTTP authentication mode query
+ if (configName === HTTP_AUTH_PROPERTY) {
return HttpResponse.json({
property: {
- name: 'hadoop.security.authentication',
+ name: HTTP_AUTH_PROPERTY,
value: 'simple',
},
});
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/lib/api/mocks/server-handlers.ts b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/lib/api/mocks/server-handlers.ts
index c5c0542cf71..f65ecc2d84f 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/lib/api/mocks/server-handlers.ts
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-capacity-scheduler-ui/src/main/webapp/src/lib/api/mocks/server-handlers.ts
@@ -20,6 +20,7 @@
import { http, HttpResponse } from 'msw';
import { readFileSync } from 'fs';
import { join } from 'path';
+import { HTTP_AUTH_PROPERTY } from '~/config';
// Helper to load JSON files for server-side testing
function loadMockData(filename: string) {
@@ -38,7 +39,7 @@ export const serverHandlers = [
const url = new URL(request.url);
const name = url.searchParams.get('name');
- if (name === 'hadoop.security.authentication') {
+ if (name === HTTP_AUTH_PROPERTY) {
return HttpResponse.json({ property: { value: 'simple' } });
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org