From 78360a2d4cab3957c011732ce69e6150916cad96 Mon Sep 17 00:00:00 2001 From: TheJoKlLa Date: Sun, 19 Sep 2021 21:12:51 +0200 Subject: [PATCH] Update API and imported CapnProto Runtime --- .gitmodules | 3 +++ Borepin.sln | 26 +++++++++++++++++++ .../LoginPasswordPageModel.cs | 5 ++-- .../Borepin/PageModel/MachineListPageModel.cs | 2 +- Borepin/Borepin/PageModel/MachinePageModel.cs | 6 ++--- Borepin/Borepin/Service/BFFH/BFFHService.cs | 2 +- FabAccessAPI/Connection.cs | 2 +- FabAccessAPI/FabAccessAPI.csproj | 2 +- FabAccessAPI/schema | 2 +- external/capnproto-dotnetcore | 1 + 10 files changed, 40 insertions(+), 11 deletions(-) create mode 160000 external/capnproto-dotnetcore diff --git a/.gitmodules b/.gitmodules index 8e3ea7b..074521b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ path = FabAccessAPI/schema url = https://gitlab.com/fabinfra/fabaccess/fabaccess-api.git branch = main +[submodule "external/capnproto-dotnetcore"] + path = external/capnproto-dotnetcore + url = https://github.com/c80k/capnproto-dotnetcore.git diff --git a/Borepin.sln b/Borepin.sln index bbd4346..10b6fd8 100644 --- a/Borepin.sln +++ b/Borepin.sln @@ -23,6 +23,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FabAccessAPI_Test", "FabAcc EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NFC", "external\NFC\NFC\NFC.csproj", "{D53A98E8-48B5-4DCE-A98E-4623EE746E16}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Capnp.Net.Runtime", "external\capnproto-dotnetcore\Capnp.Net.Runtime\Capnp.Net.Runtime.csproj", "{C587AAC3-50A7-4871-A50D-7880B6F24EF6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -327,6 +329,30 @@ Global {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x64.Build.0 = Release|Any CPU {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x86.ActiveCfg = Release|Any CPU {D53A98E8-48B5-4DCE-A98E-4623EE746E16}.Release|x86.Build.0 = Release|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|ARM.ActiveCfg = Debug|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|ARM.Build.0 = Debug|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|iPhone.Build.0 = Debug|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|x64.ActiveCfg = Debug|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|x64.Build.0 = Debug|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|x86.ActiveCfg = Debug|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Debug|x86.Build.0 = Debug|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|Any CPU.Build.0 = Release|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|ARM.ActiveCfg = Release|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|ARM.Build.0 = Release|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|iPhone.ActiveCfg = Release|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|iPhone.Build.0 = Release|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|x64.ActiveCfg = Release|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|x64.Build.0 = Release|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|x86.ActiveCfg = Release|Any CPU + {C587AAC3-50A7-4871-A50D-7880B6F24EF6}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Borepin/Borepin/PageModel/AddServerProcess/LoginPasswordPageModel.cs b/Borepin/Borepin/PageModel/AddServerProcess/LoginPasswordPageModel.cs index 609d16a..1661d54 100644 --- a/Borepin/Borepin/PageModel/AddServerProcess/LoginPasswordPageModel.cs +++ b/Borepin/Borepin/PageModel/AddServerProcess/LoginPasswordPageModel.cs @@ -58,7 +58,7 @@ namespace Borepin.PageModel.AddServerProcess connection_update.Username = Username; - await _BFFHService.Authenticate(connection_update, Password); + await _BFFHService.Authenticate(connection_update, Password).ConfigureAwait(false); await _ConnectionService.AddConnection(_BFFHService.ActiveConnection); await _ConnectionService.LogConnect(_BFFHService.ActiveConnection); @@ -70,5 +70,4 @@ namespace Borepin.PageModel.AddServerProcess System.Diagnostics.Debugger.Break(); } } - } -} + } \ No newline at end of file diff --git a/Borepin/Borepin/PageModel/MachineListPageModel.cs b/Borepin/Borepin/PageModel/MachineListPageModel.cs index f7795af..f327821 100644 --- a/Borepin/Borepin/PageModel/MachineListPageModel.cs +++ b/Borepin/Borepin/PageModel/MachineListPageModel.cs @@ -84,7 +84,7 @@ namespace Borepin.PageModel NavigationParameters parameters = new NavigationParameters { - { "id", viewmodel.Instance.Id } + { "name", viewmodel.Instance.Name } }; INavigationResult result = await _NavigationService.NavigateAsync($"MachinePage", parameters); diff --git a/Borepin/Borepin/PageModel/MachinePageModel.cs b/Borepin/Borepin/PageModel/MachinePageModel.cs index 790b61e..d67b5d2 100644 --- a/Borepin/Borepin/PageModel/MachinePageModel.cs +++ b/Borepin/Borepin/PageModel/MachinePageModel.cs @@ -14,7 +14,7 @@ namespace Borepin.PageModel { #region Private Properties private IBFFHService _BFFHService; - private UUID _ID; + private string _Name; private Machine _Machine; #endregion @@ -37,7 +37,7 @@ namespace Borepin.PageModel IInfoInterface info = await machineSystem.Info(); - _Machine = (await info.GetMachine(_ID)).Item1; + _Machine = (await info.GetMachine(_Name)).Item1; MachineItem = new MachineVisualize(_Machine); MachineItem.LoadData(); @@ -95,7 +95,7 @@ namespace Borepin.PageModel public override void OnNavigatedTo(INavigationParameters parameters) { - _ID = parameters["id"] as UUID; + _Name = parameters["name"] as string; IsBusy = true; Task.Run(LoadData); diff --git a/Borepin/Borepin/Service/BFFH/BFFHService.cs b/Borepin/Borepin/Service/BFFH/BFFHService.cs index 45bea61..184d5ab 100644 --- a/Borepin/Borepin/Service/BFFH/BFFHService.cs +++ b/Borepin/Borepin/Service/BFFH/BFFHService.cs @@ -66,7 +66,7 @@ namespace Borepin.Service.BFFH public async Task Authenticate(Connection connection, string password) { - await _Connection.Auth("PLAIN", new Dictionary { { "Username", ActiveConnection.Username }, { "Password", password } }); + await _Connection.Auth("PLAIN", new Dictionary { { "Username", ActiveConnection.Username }, { "Password", password } }).ConfigureAwait(false); await _CredentialService.AddCredentialsAsync(connection, password); diff --git a/FabAccessAPI/Connection.cs b/FabAccessAPI/Connection.cs index 2f16e29..952b313 100644 --- a/FabAccessAPI/Connection.cs +++ b/FabAccessAPI/Connection.cs @@ -43,7 +43,7 @@ namespace FabAccessAPI public async Task Auth(string mech, Dictionary kvs, CancellationToken cancellationToken_ = default) { // _bootstrapCap = await _bootstrapCap.Unwrap(); - var authCap = await _bootstrapCap.AuthenticationSystem(cancellationToken_); + var authCap = await _bootstrapCap.AuthenticationSystem(cancellationToken_).ConfigureAwait(false); _auth = new Auth(authCap); var mechs = await _auth.GetMechanisms(); //_Log.Debug($"The Server supports the following auth mechs: {string.Join(", ", mechs)}"); diff --git a/FabAccessAPI/FabAccessAPI.csproj b/FabAccessAPI/FabAccessAPI.csproj index c6c513d..6796eed 100644 --- a/FabAccessAPI/FabAccessAPI.csproj +++ b/FabAccessAPI/FabAccessAPI.csproj @@ -11,13 +11,13 @@ - + diff --git a/FabAccessAPI/schema b/FabAccessAPI/schema index 6935947..1441b59 160000 --- a/FabAccessAPI/schema +++ b/FabAccessAPI/schema @@ -1 +1 @@ -Subproject commit 6935947d9e4569ffb141bdc265e4c08d5a1017e4 +Subproject commit 1441b59145bb364c2c61fe67f52c64a3522ee124 diff --git a/external/capnproto-dotnetcore b/external/capnproto-dotnetcore new file mode 160000 index 0000000..c2d17d6 --- /dev/null +++ b/external/capnproto-dotnetcore @@ -0,0 +1 @@ +Subproject commit c2d17d689cd262bf9bf03366f1364d80c864b862