From 0d6df37d5a89e9553978b9b6d80a3907306287aa Mon Sep 17 00:00:00 2001 From: Anthony Timmers Date: Mon, 30 Dec 2019 16:07:59 +0100 Subject: [PATCH 1/9] Refactor DaysToRemind to nullable int --- src/SignhostAPIClient/Rest/DataObjects/Signer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SignhostAPIClient/Rest/DataObjects/Signer.cs b/src/SignhostAPIClient/Rest/DataObjects/Signer.cs index 7a6dd68..71356d9 100644 --- a/src/SignhostAPIClient/Rest/DataObjects/Signer.cs +++ b/src/SignhostAPIClient/Rest/DataObjects/Signer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Newtonsoft.Json; @@ -38,7 +38,7 @@ private Signer(IReadOnlyList activities) public bool? SendSignConfirmation { get; set; } - public int DaysToRemind { get; set; } + public int? DaysToRemind { get; set; } public string Language { get; set; } From 78e24ee6c96c2158bc59f41ec65b83aaedf64f8b Mon Sep 17 00:00:00 2001 From: Anthony Timmers Date: Tue, 23 Feb 2021 12:56:28 +0100 Subject: [PATCH 2/9] Reformat readme for consistency & line length This way we don't need the horizontal scrollbar anymore (in most cases). --- README.md | 50 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 1896f9f..5a86e69 100644 --- a/README.md +++ b/README.md @@ -16,17 +16,18 @@ Get it on NuGet: ### Example code The following code is an example of how to create and start a sign transaction with two documents. ```c# -var client = new SignHostApiClient(new SignHostApiClientSettings("AppName appkey", "apikey or usertoken")); - -var transaction = await client.CreateTransactionAsync(new Transaction -{ - Signers = new List - { - new Signer - { - Email = "john.doe@example.com", +var settings = new SignHostApiClientSettings( + "AppName appkey", + "apikey or usertoken")); + +var client = new SignHostApiClient(settings); + +var transaction = await client.CreateTransactionAsync(new Transaction { + Signers = new List { + new Signer { + Email = "john.doe@example.com", SignRequestMessage = "Could you please sign this document?", - SendSignRequest = true, + SendSignRequest = true, /* * The verifications listed here are executed in order. * Your last verification _must_ be one of the following: @@ -34,23 +35,32 @@ var transaction = await client.CreateTransactionAsync(new Transaction * - ScribbleVerification * - ConsentVerification */ - Verifications = new List { + Verifications = new List { new PhoneNumberVerification { - Number = "+3161234567890" + Number = "+3161234567890", }, new ScribbleVerification { - ScribbleName = "John Doe", - RequireHandsignature = true, + ScribbleName = "John Doe", + RequireHandsignature = true, }, - } - } - } + }, + }, + }, }); -await client.AddOrReplaceFileToTransactionAsync("PathToFile", transaction.Id, "First document", new FileUploadOptions()); -await client.AddOrReplaceFileToTransactionAsync("PathOtherFile", transaction.Id, "General agreement", new FileUploadOptions()); +await client.AddOrReplaceFileToTransactionAsync( + "PathToFile", + transaction.Id, + "First document", + new FileUploadOptions()); + +await client.AddOrReplaceFileToTransactionAsync( + "PathOtherFile", + transaction.Id, + "General agreement", + new FileUploadOptions()); -/* When everything is setup we can start the transaction flow */ +/* When everything is setup we can start the transaction flow. */ await client.StartTransactionAsync(transaction.Id); ``` From d4717734a2ca2714b749e5a21a075c677c921ca1 Mon Sep 17 00:00:00 2001 From: idogan Date: Thu, 5 Oct 2023 15:43:24 +0200 Subject: [PATCH 3/9] Drop UserToken for SignHostApiClient --- src/SignhostAPIClient.Tests/SignhostApiClientTests.cs | 7 +------ .../Rest/ISignhostApiClientSettings.cs | 5 ----- src/SignhostAPIClient/Rest/SignHostApiClient.cs | 4 ---- .../Rest/SignHostApiClientSettings.cs | 11 +---------- src/SignhostAPIClient/SignhostAPIClient.csproj | 2 +- 5 files changed, 3 insertions(+), 26 deletions(-) diff --git a/src/SignhostAPIClient.Tests/SignhostApiClientTests.cs b/src/SignhostAPIClient.Tests/SignhostApiClientTests.cs index 8c0718e..4ca95eb 100644 --- a/src/SignhostAPIClient.Tests/SignhostApiClientTests.cs +++ b/src/SignhostAPIClient.Tests/SignhostApiClientTests.cs @@ -14,8 +14,7 @@ namespace Signhost.APIClient.Rest.Tests public class SignHostApiClientTests { private SignHostApiClientSettings settings = new SignHostApiClientSettings( - "AppKey", - "AuthKey" + "AppKey" ) { Endpoint = "http://localhost/api/" }; @@ -575,22 +574,18 @@ public async Task When_a_complete_transaction_flow_is_created_headers_are_not_se var mockHttp = new MockHttpMessageHandler(); mockHttp.Expect(HttpMethod.Post, "http://localhost/api/transaction") .WithHeaders("Application", "APPKey AppKey") - .WithHeaders("Authorization", "APIKey AuthKey") .WithHeaders("X-Custom", "test") .Respond(new StringContent(RequestBodies.TransactionSingleSignerJson)); mockHttp.Expect(HttpMethod.Put, "http://localhost/api/transaction/*/file/somefileid") .WithHeaders("Application", "APPKey AppKey") - .WithHeaders("Authorization", "APIKey AuthKey") .WithHeaders("X-Custom", "test") .Respond(HttpStatusCode.Accepted, new StringContent(RequestBodies.AddOrReplaceFileMetaToTransaction)); mockHttp.Expect(HttpMethod.Put, "http://localhost/api/transaction/*/file/somefileid") .WithHeaders("Application", "APPKey AppKey") - .WithHeaders("Authorization", "APIKey AuthKey") .WithHeaders("X-Custom", "test") .Respond(HttpStatusCode.Created); mockHttp.Expect(HttpMethod.Put, "http://localhost/api/transaction/*/start") .WithHeaders("Application", "APPKey AppKey") - .WithHeaders("Authorization", "APIKey AuthKey") .WithHeaders("X-Custom", "test") .Respond(HttpStatusCode.NoContent); diff --git a/src/SignhostAPIClient/Rest/ISignhostApiClientSettings.cs b/src/SignhostAPIClient/Rest/ISignhostApiClientSettings.cs index 248b18a..e65b21a 100644 --- a/src/SignhostAPIClient/Rest/ISignhostApiClientSettings.cs +++ b/src/SignhostAPIClient/Rest/ISignhostApiClientSettings.cs @@ -6,11 +6,6 @@ namespace Signhost.APIClient.Rest public interface ISignHostApiClientSettings { - /// - /// Gets the usertoken identifying an authorized user. - /// - string APIKey { get; } - /// /// Gets the app key of your applications. /// diff --git a/src/SignhostAPIClient/Rest/SignHostApiClient.cs b/src/SignhostAPIClient/Rest/SignHostApiClient.cs index ff13e4a..7c77a78 100644 --- a/src/SignhostAPIClient/Rest/SignHostApiClient.cs +++ b/src/SignhostAPIClient/Rest/SignHostApiClient.cs @@ -58,7 +58,6 @@ public SignHostApiClient( "SignhostClientLibrary", Version)); this.client.DefaultRequestHeaders.Add("Application", ApplicationHeader); - this.client.DefaultRequestHeaders.Add("Authorization", AuthorizationHeader); this.client.DefaultRequestHeaders.Accept.Add(MediaTypeWithQualityHeaderValue.Parse($"application/vnd.signhost.{ApiVersion}+json")); settings.AddHeader?.Invoke(this.client.DefaultRequestHeaders.Add); } @@ -66,9 +65,6 @@ public SignHostApiClient( private string ApplicationHeader => $"APPKey {settings.APPKey}"; - private string AuthorizationHeader - => $"APIKey {settings.APIKey}"; - /// /// Globally register an additional verification type. /// diff --git a/src/SignhostAPIClient/Rest/SignHostApiClientSettings.cs b/src/SignhostAPIClient/Rest/SignHostApiClientSettings.cs index 99b187f..1c0526b 100644 --- a/src/SignhostAPIClient/Rest/SignHostApiClientSettings.cs +++ b/src/SignhostAPIClient/Rest/SignHostApiClientSettings.cs @@ -7,18 +7,9 @@ public class SignHostApiClientSettings { public const string DefaultEndpoint = "https://api.signhost.com/api/"; - public SignHostApiClientSettings(string appkey, string apikey) + public SignHostApiClientSettings(string appkey) { APPKey = appkey; - APIKey = apikey; - } - - [Obsolete("Obsoleted by UserToken")] - public string APIKey { get; private set; } - - public string UserToken { - get { return APIKey; } - set { APIKey = value; } } public string APPKey { get; private set; } diff --git a/src/SignhostAPIClient/SignhostAPIClient.csproj b/src/SignhostAPIClient/SignhostAPIClient.csproj index f17c3eb..c3187fa 100644 --- a/src/SignhostAPIClient/SignhostAPIClient.csproj +++ b/src/SignhostAPIClient/SignhostAPIClient.csproj @@ -11,7 +11,7 @@ $(APPVEYOR_BUILD_NUMBER) 0 - 3.0.$(VersionBuildNumber) + 4.0.$(VersionBuildNumber) $(SH_VERSION_SUFFIX) Evidos Signhost From b8b2df175a89e627bcbf7c1619f8ca8e4fef4311 Mon Sep 17 00:00:00 2001 From: ATimmeh33 Date: Mon, 22 Apr 2024 14:48:57 +0200 Subject: [PATCH 4/9] Update Nuget Badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a86e69..902097e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Signhost client library [![join gitter chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Evidos/signhost-api) [![Build status](https://ci.appveyor.com/api/projects/status/696lddgivr6kkhsd/branch/master?svg=true)](https://ci.appveyor.com/project/MrJoe/signhostclientlibrary-xcr5f/branch/master) -[![Nuget package](https://img.shields.io/nuget/v/SignhostClientLibrary.svg)](https://www.nuget.org/Packages/SignhostClientLibrary) +[![Nuget package](https://img.shields.io/nuget/v/EntrustSignhostClientLibary.svg)](https://www.nuget.org/Packages/EntrustSignhostClientLibary) [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=SignhostAPIClient&metric=alert_status)](https://sonarcloud.io/dashboard?id=SignhostAPIClient) This is a client library in c# to demonstrate the usage of the [signhost api](https://api.signhost.com/) using .net. From b9faa8d8d9b93fd5989b851ac2f847dbd11bfce4 Mon Sep 17 00:00:00 2001 From: idogan Date: Tue, 23 Apr 2024 11:32:03 +0200 Subject: [PATCH 5/9] Added new version info --- .appveyor.yml | 4 ++-- README.md | 3 +-- src/SignhostAPIClient/SignhostAPIClient.csproj | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 5867ebb..c382ed6 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -17,8 +17,8 @@ for: before_build: - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { Set-AppveyorBuildVariable 'SH_VERSION_SUFFIX' 'alpha' } - - dotnet tool install --global dotnet-sonarscanner - - dotnet add "src/SignhostAPIClient.Tests/SignhostAPIClient.Tests.csproj" package coverlet.msbuild + - dotnet tool install --global dotnet-sonarscanner --version 5.5.3 + - dotnet add "src/SignhostAPIClient.Tests/SignhostAPIClient.Tests.csproj" package coverlet.msbuild --version 3.1.0 - cmd: dotnet restore "src\SignhostAPIClient.sln build_script: diff --git a/README.md b/README.md index 902097e..1fc863a 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,7 @@ Get it on NuGet: The following code is an example of how to create and start a sign transaction with two documents. ```c# var settings = new SignHostApiClientSettings( - "AppName appkey", - "apikey or usertoken")); + "AppName appkey")); var client = new SignHostApiClient(settings); diff --git a/src/SignhostAPIClient/SignhostAPIClient.csproj b/src/SignhostAPIClient/SignhostAPIClient.csproj index c3187fa..c9c1970 100644 --- a/src/SignhostAPIClient/SignhostAPIClient.csproj +++ b/src/SignhostAPIClient/SignhostAPIClient.csproj @@ -18,9 +18,10 @@ Copyright 2016-2018 © Evidos https://github.com/Evidos/SignhostClientLibrary git - SignhostClientLibrary + EntrustSignhostClientLibrary sign;signing;digital signature;pdf +* 4.0.0 - Added access token marks a significant enhancement in the security and authentication mechanisms of the application * 3.0.0 - Bumped verifications support and added .net core target * 2.3.0 - Added support for custom forms creation over the API * 2.2.2 - Added basic parameter validation From eef4f691dfccc382038a3cc998998242a44e8add Mon Sep 17 00:00:00 2001 From: idogan Date: Tue, 23 Apr 2024 11:32:03 +0200 Subject: [PATCH 6/9] Added new version info --- .appveyor.yml | 4 ++-- README.md | 3 +-- src/SignhostAPIClient/SignhostAPIClient.csproj | 5 +++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 5867ebb..c382ed6 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -17,8 +17,8 @@ for: before_build: - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { Set-AppveyorBuildVariable 'SH_VERSION_SUFFIX' 'alpha' } - - dotnet tool install --global dotnet-sonarscanner - - dotnet add "src/SignhostAPIClient.Tests/SignhostAPIClient.Tests.csproj" package coverlet.msbuild + - dotnet tool install --global dotnet-sonarscanner --version 5.5.3 + - dotnet add "src/SignhostAPIClient.Tests/SignhostAPIClient.Tests.csproj" package coverlet.msbuild --version 3.1.0 - cmd: dotnet restore "src\SignhostAPIClient.sln build_script: diff --git a/README.md b/README.md index 902097e..1fc863a 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,7 @@ Get it on NuGet: The following code is an example of how to create and start a sign transaction with two documents. ```c# var settings = new SignHostApiClientSettings( - "AppName appkey", - "apikey or usertoken")); + "AppName appkey")); var client = new SignHostApiClient(settings); diff --git a/src/SignhostAPIClient/SignhostAPIClient.csproj b/src/SignhostAPIClient/SignhostAPIClient.csproj index c3187fa..69d818e 100644 --- a/src/SignhostAPIClient/SignhostAPIClient.csproj +++ b/src/SignhostAPIClient/SignhostAPIClient.csproj @@ -15,12 +15,13 @@ $(SH_VERSION_SUFFIX) Evidos Signhost - Copyright 2016-2018 © Evidos + Copyright © Entrust https://github.com/Evidos/SignhostClientLibrary git - SignhostClientLibrary + EntrustSignhostClientLibrary sign;signing;digital signature;pdf +* 4.0.0 - Added access token marks a significant enhancement in the security and authentication mechanisms of the application * 3.0.0 - Bumped verifications support and added .net core target * 2.3.0 - Added support for custom forms creation over the API * 2.2.2 - Added basic parameter validation From 048fd0f1be842f35bb927ceb257447164c1ed615 Mon Sep 17 00:00:00 2001 From: ATimmeh33 Date: Tue, 23 Apr 2024 14:48:46 +0200 Subject: [PATCH 7/9] Update badge URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1fc863a..fbe5532 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Signhost client library [![join gitter chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Evidos/signhost-api) [![Build status](https://ci.appveyor.com/api/projects/status/696lddgivr6kkhsd/branch/master?svg=true)](https://ci.appveyor.com/project/MrJoe/signhostclientlibrary-xcr5f/branch/master) -[![Nuget package](https://img.shields.io/nuget/v/EntrustSignhostClientLibary.svg)](https://www.nuget.org/Packages/EntrustSignhostClientLibary) +[![Nuget package](https://img.shields.io/nuget/v/EntrustSignhostClientLibrary.svg)](https://www.nuget.org/Packages/EntrustSignhostClientLibrary) [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=SignhostAPIClient&metric=alert_status)](https://sonarcloud.io/dashboard?id=SignhostAPIClient) This is a client library in c# to demonstrate the usage of the [signhost api](https://api.signhost.com/) using .net. From f8812acf13e8f137d15ddb3e3442f0a0bca95e24 Mon Sep 17 00:00:00 2001 From: ATimmeh33 Date: Tue, 23 Apr 2024 14:50:02 +0200 Subject: [PATCH 8/9] Update NuGet install package example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fbe5532..89d89cb 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ You can request a APPKey for signhost at [ondertekenen.nl](https://portal.signho ### Install Get it on NuGet: -`PM> Install-Package SignhostClientLibrary` +`PM> Install-Package EntrustSignhostClientLibrary` ### Example code The following code is an example of how to create and start a sign transaction with two documents. From 6aa1eb79ea175ed16e9d7985c45b52275738f6b4 Mon Sep 17 00:00:00 2001 From: idogan Date: Tue, 23 Apr 2024 15:51:41 +0200 Subject: [PATCH 9/9] Alpha package added --- .appveyor.yml | 12 ++++-------- README.md | 1 - src/SignhostAPIClient/SignhostAPIClient.csproj | 4 ++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index c382ed6..71100a4 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,29 +1,26 @@ environment: - SH_VERSION_SUFFIX: 'preview' + SH_VERSION_SUFFIX: 'alpha' github_auth_token: secure: qOQatfN0omwlCj5Td82fK9Z3ZKQom0Nv3/x6OH98iB+L9mfOf26bH3q+PnQ7y7g7 configuration: Release -image: Visual Studio 2017 +image: Visual Studio 2019 for: - branches: only: - master + - legacy environment: SH_VERSION_SUFFIX: '' before_build: - - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { Set-AppveyorBuildVariable 'SH_VERSION_SUFFIX' 'alpha' } - - dotnet tool install --global dotnet-sonarscanner --version 5.5.3 - dotnet add "src/SignhostAPIClient.Tests/SignhostAPIClient.Tests.csproj" package coverlet.msbuild --version 3.1.0 - - cmd: dotnet restore "src\SignhostAPIClient.sln + - cmd: dotnet restore "src\SignhostAPIClient.sln" build_script: - - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER ) { dotnet sonarscanner begin /key:"SignhostAPIClient" /d:"sonar.host.url=https://sonarcloud.io" /organization:"signhost" /d:"sonar.login=$env:sonarcloud_auth_token" /d:"sonar.cs.opencover.reportsPaths=src\SignhostAPIClient.Tests\result.cover" /d:"sonar.pullrequest.base=master" /d:"sonar.pullrequest.branch=PR-$env:APPVEYOR_PULL_REQUEST_NUMBER" /d:"sonar.pullrequest.key=$env:APPVEYOR_PULL_REQUEST_NUMBER" /d:"sonar.pullrequest.provider=GitHub" /d:"sonar.pullrequest.github.repository=Evidos/SignhostClientLibrary" } - - ps: if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { dotnet sonarscanner begin /key:"SignhostAPIClient" /d:"sonar.host.url=https://sonarcloud.io" /organization:"signhost" /d:"sonar.login=$env:sonarcloud_auth_token" /d:"sonar.cs.opencover.reportsPaths=src\SignhostAPIClient.Tests\result.cover" } - dotnet build "src\SignhostAPIClient.sln" - dotnet pack "src\SignhostAPIClient\SignhostAPIClient.csproj" @@ -31,7 +28,6 @@ test_script: - dotnet test --no-build "src/SignhostAPIClient.Tests/SignhostAPIClient.Tests.csproj" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput="./result.cover" /p:Exclude="[xunit*]*" after_test: - - ps: dotnet sonarscanner end /d:"sonar.login=$env:sonarcloud_auth_token"; $LASTEXITCODE=0 nuget: project_feed: true diff --git a/README.md b/README.md index 89d89cb..be99f8c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![join gitter chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Evidos/signhost-api) [![Build status](https://ci.appveyor.com/api/projects/status/696lddgivr6kkhsd/branch/master?svg=true)](https://ci.appveyor.com/project/MrJoe/signhostclientlibrary-xcr5f/branch/master) [![Nuget package](https://img.shields.io/nuget/v/EntrustSignhostClientLibrary.svg)](https://www.nuget.org/Packages/EntrustSignhostClientLibrary) -[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=SignhostAPIClient&metric=alert_status)](https://sonarcloud.io/dashboard?id=SignhostAPIClient) This is a client library in c# to demonstrate the usage of the [signhost api](https://api.signhost.com/) using .net. You will need a valid APPKey and APIKey. diff --git a/src/SignhostAPIClient/SignhostAPIClient.csproj b/src/SignhostAPIClient/SignhostAPIClient.csproj index 69d818e..db9859b 100644 --- a/src/SignhostAPIClient/SignhostAPIClient.csproj +++ b/src/SignhostAPIClient/SignhostAPIClient.csproj @@ -13,7 +13,7 @@ 0 4.0.$(VersionBuildNumber) $(SH_VERSION_SUFFIX) - Evidos + Entrust Signhost Copyright © Entrust https://github.com/Evidos/SignhostClientLibrary @@ -30,7 +30,7 @@ * 2.1.0 - Lowered minimum framework from 4.5.2 to 4.5 * 2.0.0 - First release using new multidoc API. - Evidos + Entrust A .NET library for the signhost.com api. true $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb