mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-06-11 11:03:23 +02:00
Fixed: Android Deadlock from RPC Connection
This commit is contained in:
@ -1,14 +1,12 @@
|
||||
using Capnp;
|
||||
using FabAccessAPI.Schema;
|
||||
using FabAccessAPI.Schema;
|
||||
using S22.Sasl;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Exception = System.Exception;
|
||||
|
||||
namespace FabAccessAPI {
|
||||
namespace FabAccessAPI
|
||||
{
|
||||
/// Authentication Identity
|
||||
///
|
||||
/// Under the hood a string because the form depends heavily on the method
|
||||
|
@ -3,6 +3,7 @@ using FabAccessAPI.Schema;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FabAccessAPI {
|
||||
@ -37,18 +38,18 @@ namespace FabAccessAPI {
|
||||
/// <param name="mech">The desired authentication mechanism</param>
|
||||
/// <param name="kvs">Key-Value data specific to the mechanism</param>
|
||||
/// <returns></returns>
|
||||
public async Task Auth(string mech, Dictionary<string, object> kvs) {
|
||||
public async Task Auth(string mech, Dictionary<string, object> kvs, CancellationToken cancellationToken_ = default) {
|
||||
// _bootstrapCap = await _bootstrapCap.Unwrap();
|
||||
var authCap = await _bootstrapCap.Auth();
|
||||
var authCap = await _bootstrapCap.Auth(cancellationToken_);
|
||||
_auth = new Auth(authCap);
|
||||
var mechs = await _auth.GetMechanisms().ConfigureAwait(false);
|
||||
var mechs = await _auth.GetMechanisms();
|
||||
_Log.Debug($"The Server supports the following auth mechs: {string.Join(", ", mechs)}");
|
||||
|
||||
if (!mechs.Contains(mech)) {
|
||||
throw new UnsupportedMechanismException();
|
||||
}
|
||||
|
||||
await _auth.Authenticate(mech, kvs).ConfigureAwait(false);
|
||||
await _auth.Authenticate(mech, kvs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -56,7 +57,7 @@ namespace FabAccessAPI {
|
||||
/// </summary>
|
||||
/// <returns>A wrapped capability to interact with machines</returns>
|
||||
public async Task<Machines> AccessMachines() {
|
||||
_machines ??= new Machines((await _bootstrapCap.Machines().ConfigureAwait(false)));
|
||||
_machines ??= new Machines(await _bootstrapCap.Machines());
|
||||
return _machines;
|
||||
}
|
||||
}
|
||||
|
@ -11,13 +11,14 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Capnp.Net.Runtime" Version="1.3.118" />
|
||||
<PackageReference Include="CapnpC.CSharp.MsBuild.Generation" Version="1.3.118" />
|
||||
<PackageReference Include="log4net" Version="2.0.12" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\capnproto-dotnetcore\Capnp.Net.Runtime\Capnp.Net.Runtime.csproj" />
|
||||
<ProjectReference Include="..\external\CapnProto\Capnp.Net.Runtime\Capnp.Net.Runtime.csproj" />
|
||||
<ProjectReference Include="..\external\SASL\S22.Sasl.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
using FabAccessAPI.Schema;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FabAccessAPI {
|
||||
namespace FabAccessAPI
|
||||
{
|
||||
|
||||
public class MachineException : Exception { }
|
||||
|
||||
|
@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
|
||||
//This is where the permissions subsystem will live
|
||||
namespace FabAccessAPI {
|
||||
//This is where the permissions subsystem will live
|
||||
namespace FabAccessAPI
|
||||
{
|
||||
public class Permissions {
|
||||
#region Log
|
||||
private static readonly log4net.ILog _Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
Reference in New Issue
Block a user