borepin/FabAccessAPI/Connection.cs
Kai Jan Kriegel a69d76474f stuff
2020-11-07 22:08:40 +01:00

33 lines
907 B
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Capnp;
using Capnp.Rpc;
using FabAccessAPI.Schema;
namespace FabAccessAPI
{
class Connection {
private TcpRpcClient _rpcClient;
private IBootstrap _bootstrapCap;
private User _user;
private Auth _auth;
/// <summary>
///
/// </summary>
/// <param name="rpcClient">Should be an already configured and connected TcpRpcClient</param>
public Connection(TcpRpcClient rpcClient) {
_rpcClient = rpcClient;
_bootstrapCap = _rpcClient.GetMain<IBootstrap>();
}
async Task Auth(string mech, Dictionary<string, string> kvs) {
_auth = new Auth(await _bootstrapCap.Auth());
var mechs = await _auth.GetMechanisms().ConfigureAwait(false);
}
}
}