fix(android): connect operator session without gateway auth · openclaw/openclaw@5c01418
obviyus
·
2026-05-18
·
via Recent Commits to openclaw:main
File tree
main/java/ai/openclaw/app
test/java/ai/openclaw/app
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1660,7 +1660,16 @@ internal fun resolveOperatorSessionConnectAuth(
|
1660 | 1660 | ) |
1661 | 1661 | } |
1662 | 1662 | |
1663 | | -return null |
| 1663 | +val explicitBootstrapToken = auth.bootstrapToken?.trim()?.takeIf { it.isNotEmpty() } |
| 1664 | +if (explicitBootstrapToken != null) { |
| 1665 | +return null |
| 1666 | + } |
| 1667 | + |
| 1668 | +return NodeRuntime.GatewayConnectAuth( |
| 1669 | + token = null, |
| 1670 | + bootstrapToken = null, |
| 1671 | + password = null, |
| 1672 | + ) |
1664 | 1673 | } |
1665 | 1674 | |
1666 | 1675 | internal fun shouldConnectOperatorSession( |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -65,7 +65,7 @@ class GatewayBootstrapAuthTest {
|
65 | 65 | storedOperatorToken = "stored-token", |
66 | 66 | ), |
67 | 67 | ) |
68 | | -assertFalse( |
| 68 | +assertTrue( |
69 | 69 | shouldConnectOperatorSession( |
70 | 70 | NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = "", password = null), |
71 | 71 | storedOperatorToken = null, |
@@ -95,6 +95,17 @@ class GatewayBootstrapAuthTest {
|
95 | 95 | assertNull(resolved) |
96 | 96 | } |
97 | 97 | |
| 98 | + @Test |
| 99 | +fun resolveOperatorSessionConnectAuthUsesNoAuthWhenGatewayHasNoAuth() { |
| 100 | +val resolved = |
| 101 | + resolveOperatorSessionConnectAuth( |
| 102 | + auth = NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = null, password = null), |
| 103 | + storedOperatorToken = null, |
| 104 | + ) |
| 105 | + |
| 106 | + assertEquals(NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = null, password = null), resolved) |
| 107 | + } |
| 108 | + |
98 | 109 | @Test |
99 | 110 | fun resolveOperatorSessionConnectAuthPrefersExplicitSharedAuth() { |
100 | 111 | val resolved = |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。