borepin/FabAccessAPI/Connection.cs

33 lines
907 B
C#
Raw Normal View History

2020-10-26 14:35:31 +01:00
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
2020-11-07 22:08:40 +01:00
using System.Threading.Tasks;
2020-10-26 14:35:31 +01:00
using Capnp;
2020-11-07 22:08:40 +01:00
using Capnp.Rpc;
2020-10-26 14:35:31 +01:00
using FabAccessAPI.Schema;
namespace FabAccessAPI
{
2020-11-07 22:08:40 +01:00
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>();
2020-10-26 14:35:31 +01:00
}
2020-11-07 22:08:40 +01:00
async Task Auth(string mech, Dictionary<string, string> kvs) {
_auth = new Auth(await _bootstrapCap.Auth());
var mechs = await _auth.GetMechanisms().ConfigureAwait(false);
}
2020-10-26 14:35:31 +01:00
}
}