34 references to Token
Aspire.Hosting.Native.Core.Tests (34)
NativeCliControlTests.cs (2)
78
using var connection = new NativeRpcConnection(
Token
);
81
["jsonrpc"] = "2.0", ["id"] = 1, ["method"] = "authenticate", ["params"] = new JsonArray(
Token
),
NativeIpcSecurityTests.cs (1)
46
using var rpc = new NativeRpcListener(new UnixDomainSocketEndPoint(rpcDirectory.SocketPath),
Token
, NullLogger.Instance);
NativeNamedPipeTests.cs (6)
20
Token
, NullLogger.Instance);
28
Assert.True((await first.CallAsync("authenticate", new JsonArray(
Token
), timeout.Token))["result"]!.GetValue<bool>());
29
Assert.True((await second.CallAsync("authenticate", new JsonArray(
Token
), timeout.Token))["result"]!.GetValue<bool>());
44
new NamedPipeEndPoint("aspire-v2-test", "remote-host"),
Token
, NullLogger.Instance));
51
using var listener = new NativeRpcListener(endpoint,
Token
, NullLogger.Instance);
52
Assert.Throws<UnauthorizedAccessException>(() => new NativeRpcListener(endpoint,
Token
, NullLogger.Instance));
NativeRpcTests.cs (5)
31
Assert.True(client.Call("authenticate", new JsonArray(
Token
))["result"]!.GetValue<bool>());
179
using var connection = new NativeRpcConnection(
Token
);
187
var connection = new NativeRpcConnection(
Token
);
189
$"{{\"jsonrpc\":\"2.0\",\"method\":\"authenticate\",\"params\":[\"{
Token
}\"]}}")));
200
using var connection = new NativeRpcConnection(
Token
);
NativeSocketIsolationTests.cs (15)
28
using var listener = new NativeRpcListener(new IPEndPoint(IPAddress.Loopback, 0),
Token
, NullLogger.Instance,
38
Assert.True((await authenticated.CallAsync("authenticate", new JsonArray(
Token
), timeout.Token))["result"]!.GetValue<bool>());
93
using var listener = new NativeRpcListener(new IPEndPoint(IPAddress.Loopback, 0),
Token
,
99
Assert.True((await existing.CallAsync("authenticate", new JsonArray(
Token
), timeout.Token))["result"]!.GetValue<bool>());
108
Assert.True((await subsequent.CallAsync("authenticate", new JsonArray(
Token
), timeout.Token))["result"]!.GetValue<bool>());
129
using var listener = new NativeRpcListener(new IPEndPoint(IPAddress.Loopback, 0),
Token
,
135
await failing.CallAsync("authenticate", new JsonArray(
Token
), timeout.Token);
158
Assert.True((await subsequent.CallAsync("authenticate", new JsonArray(
Token
), timeout.Token))["result"]!.GetValue<bool>());
267
Assert.Throws<IOException>(() => new NativeRpcListener(new UnixDomainSocketEndPoint(directory.SocketPath),
Token
, NullLogger.Instance));
281
var first = new NativeRpcListener(endPoint,
Token
, NullLogger.Instance);
285
Assert.Throws<SocketException>(() => new NativeRpcListener(endPoint,
Token
, NullLogger.Instance));
293
using var replacement = new NativeRpcListener(endPoint,
Token
, NullLogger.Instance);
309
using var listener = new NativeRpcListener(endPoint,
Token
, NullLogger.Instance);
314
Assert.True((await client.CallAsync("authenticate", new JsonArray(
Token
), timeout.Token))["result"]!.GetValue<bool>());
318
using var replacement = new NativeRpcListener(endPoint,
Token
, NullLogger.Instance);
TestServices\RpcTestClient.cs (5)
18
public RpcTestClient(bool authenticate) : this(new NativeRpcConnection(
Token
), authenticate)
22
public RpcTestClient(NativeApplicationServer server) : this(new NativeRpcConnection(
Token
, server), authenticate: true)
27
: this(new NativeRpcConnection(
Token
, server, languages: null, options), authenticate: true)
32
: this(new NativeRpcConnection(
Token
, server, languages), authenticate: true)
39
if (authenticate && Call("authenticate", new JsonArray(
Token
))["result"]?.GetValue<bool>() != true)