mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
set conf token for anonymous
This commit is contained in:
parent
941794fb7a
commit
c24b8a1662
2 changed files with 10 additions and 6 deletions
|
|
@ -65,6 +65,13 @@ public class UserTokenContainer {
|
|||
}
|
||||
|
||||
public String getUserToken(String principal) {
|
||||
if (StringUtils.isBlank(principal) || "anonymous".equals(principal)) {
|
||||
if (StringUtils.isBlank(defaultToken)) {
|
||||
return StringUtils.EMPTY;
|
||||
} else {
|
||||
return defaultToken;
|
||||
}
|
||||
}
|
||||
String token = userTokens.get(principal);
|
||||
if (StringUtils.isBlank(token)) {
|
||||
String ticket = UserSessionContainer.instance.getSession(principal);
|
||||
|
|
|
|||
|
|
@ -281,11 +281,8 @@ public class ZeppelinClient {
|
|||
if (!isActionable(zeppelinMsg.op)) {
|
||||
return;
|
||||
}
|
||||
if (StringUtils.isEmpty(zeppelinMsg.principal) || zeppelinMsg.principal == "anonymous") {
|
||||
token = StringUtils.EMPTY;
|
||||
} else {
|
||||
token = UserTokenContainer.instance.getUserToken(zeppelinMsg.principal);
|
||||
}
|
||||
|
||||
token = UserTokenContainer.instance.getUserToken(zeppelinMsg.principal);
|
||||
Client client = Client.getInstance();
|
||||
if (client == null) {
|
||||
LOG.warn("Client isn't initialized yet");
|
||||
|
|
@ -295,7 +292,7 @@ public class ZeppelinClient {
|
|||
if (StringUtils.isEmpty(token)) {
|
||||
relayToAllZeppelinHub(hubMsg, noteId);
|
||||
} else {
|
||||
client.relayToZeppelinHub(hubMsg.serialize(), zeppelinMsg.ticket);
|
||||
client.relayToZeppelinHub(hubMsg.serialize(), token);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue