From 60f3a2b1019373599c25bc09704bafa0884e4a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A0=E9=94=A1=E5=B9=B3?= <40832063+zhangxiping1@users.noreply.github.com> Date: Tue, 19 Sep 2023 00:40:22 +0800 Subject: [PATCH] =?UTF-8?q?HDFS-17138=20RBF:=20We=20changed=20the=20hadoop?= =?UTF-8?q?.security.auth=5Fto=5Flocal=20configur=E2=80=A6=20(#5921)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractDelegationTokenSecretManager.java | 7 +++- .../hdfs/security/TestDelegationToken.java | 32 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java index cafa5135e6..8378a47ced 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java @@ -81,7 +81,12 @@ class AbstractDelegationTokenSecretManager expiredTokens = new HashSet(); + expiredTokens.add(dtId); + setRules("RULE:[2:$1@$0](OtherUser.*)s/.*/OtherUser/"); + //rules was modified, causing the existing tokens + //(May be loaded from other storage systems like zookeeper) to fail to match the kerberos rules, + //return an exception that cannot be handled + new AbstractDelegationTokenSecretManager(10 * 1000, 10 * 1000, + 10 * 1000, 10 * 1000) { + @Override + public DelegationTokenIdentifier createIdentifier() { + return null; + } + public void logExpireTokens(Collection expiredTokens) + throws IOException { + super.logExpireTokens(expiredTokens); + } + }.logExpireTokens(expiredTokens); + } }