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