Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
75a73d1
Add missing verifications for CSC, OIDC, and Onfido
ATimmeh33 Nov 27, 2025
23a5c3a
Add ResponseBody property to exceptions
ATimmeh33 Nov 27, 2025
9b976ac
Fix non-breaking data object discrepencies with API docs
ATimmeh33 Nov 27, 2025
6f004ef
Add integration tests
ATimmeh33 Nov 27, 2025
8a119c8
Make support up to net10.0 and drop netstandard1.4 support
ATimmeh33 Nov 21, 2025
6e17fa3
Refactor Signhost API Client to use System.Text.Json
ATimmeh33 Nov 21, 2025
00e4a42
Remove NCrunch
ATimmeh33 Nov 21, 2025
b840196
Remove unused using directives
ATimmeh33 Nov 21, 2025
0a0ec91
Fix or suppress StyleCop Analyzer warnings
ATimmeh33 Nov 21, 2025
2164fc8
Remove obsolete exception
ATimmeh33 Nov 27, 2025
a1fd012
Reformat use file-scoped namespaces
ATimmeh33 Nov 21, 2025
535a658
Remove support weak digest hash algos
ATimmeh33 Sep 26, 2025
a1d7da9
Make remove documentation warnings
ATimmeh33 Nov 27, 2025
30805d2
Refactor to nullable enable
ATimmeh33 Nov 27, 2025
63f1fc0
Refactor EnsureAvailableStatusCode to be async
ATimmeh33 Nov 27, 2025
2f1b316
Add FileFieldType enum
ATimmeh33 Nov 27, 2025
cd54588
Add converter for Field value
ATimmeh33 Nov 27, 2025
f631016
Remove unused activity types
ATimmeh33 Nov 27, 2025
ce8142a
Refactor use BadAuthorizationException
ATimmeh33 Nov 27, 2025
5b08ca4
Refactor test ResponseBody in exceptions
ATimmeh33 Nov 27, 2025
76a66f4
Remove obsolete methods
ATimmeh33 Nov 27, 2025
b4eb6a2
Refactor to request objects for transaction creation
ATimmeh33 Nov 27, 2025
9e5c625
Fix simplify null checks
ATimmeh33 Nov 27, 2025
ed88e79
Refactor various style improvements
ATimmeh33 Nov 27, 2025
e02e24f
Add integration test for complex file metadata
ATimmeh33 Nov 28, 2025
4c5d8a7
Refactor ensure successful status code
ATimmeh33 Sep 26, 2025
b0b94bd
fixup! Make remove documentation warnings
ATimmeh33 Jan 27, 2026
325afbf
fixup! Refactor various style improvements
ATimmeh33 Jan 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,50 @@ root = true
[*]
charset = utf-8
indent_style = tab
insert_final_newline = true

[*.{cs,js}]
[*.{cs,cshtml,js}]
trim_trailing_whitespace = true
insert_final_newline = true

[*.csproj]
indent_style = space
dotnet_sort_system_directives_first = true : warning
dotnet_style_predefined_type_for_locals_parameters_members = true : warning
dotnet_style_object_initializer = true : warning
dotnet_style_collection_initializer = true : warning
dotnet_style_explicit_tuple_names = true : error
dotnet_style_coalesce_expression = true : warning
dotnet_style_null_propagation = true : warning

# Prefer "var" everywhere
csharp_style_var_for_built_in_types = false : suggestion
csharp_style_var_when_type_is_apparent = true : suggestion
csharp_style_var_elsewhere = false : none

# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = false : none
csharp_style_expression_bodied_constructors = false : none
csharp_style_expression_bodied_operators = false : none

# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true : none
csharp_style_expression_bodied_indexers = true : none
csharp_style_expression_bodied_accessors = true : none

# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true : suggestion
csharp_style_pattern_matching_over_as_with_null_check = true : suggestion
csharp_style_inlined_variable_declaration = true : suggestion
csharp_style_throw_expression = true : suggestion
csharp_style_conditional_delegate_call = true : suggestion

# Newline settings
csharp_new_line_before_open_brace = types, methods, properties, indexers, events, event_accessors, anonymous_types, object_collections, array_initializers, local_functions
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true

[*.{props,targets,config,nuspec,csproj}]
indent_style = tab
indent_size = 2
3 changes: 0 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*.edmx text
*.resx text

*.ncrunchproject text
*.ncrunchsolution text

# Custom for Visual Studio
*.sln text eol=crlf merge=union
*.csproj text
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish_nuget_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.x'
dotnet-version: '10.x'

- name: Check for Tag on Current Commit
run: |
Expand Down Expand Up @@ -53,6 +53,7 @@ jobs:

- name: Test with Coverage
run: dotnet test --no-build src/SignhostAPIClient.Tests/SignhostAPIClient.Tests.csproj --collect:"XPlat Code Coverage" -c Release
# Note: Integration tests are excluded from CI/CD as they require live credentials

- name: Pack
run: dotnet pack src/SignhostAPIClient/SignhostAPIClient.csproj /p:Version=${{ env.LATEST_VERSION }}
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ _TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml
*.v3.ncrunchsolution.user

# MightyMoose
*.mm.*
AutoTest.Net/
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ For full API documentation, please visit [evidos.github.io](https://evidos.githu
### Example code
The following code is an example of how to create and start a sign transaction with two documents.
```c#
var settings = new SignHostApiClientSettings(
var settings = new SignhostApiClientSettings(
"AppName appkey",
"apikey or usertoken"));
"apikey or usertoken");

var client = new SignHostApiClient(settings);
var client = new SignhostApiClient(settings);

var transaction = await client.CreateTransactionAsync(new Transaction {
Signers = new List<Signer> {
new Signer {
var transaction = await client.CreateTransactionAsync(new CreateTransactionRequest {
Signers = new List<CreateSignerRequest> {
new CreateSignerRequest {
Email = "john.doe@example.com",
SignRequestMessage = "Could you please sign this document?",
SendSignRequest = true,
Expand Down
27 changes: 27 additions & 0 deletions src/SignhostAPIClient.IntegrationTests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Integration Tests

This project contains integration tests that require live API credentials to run.

## Configuration

The tests require Signhost API credentials configured via .NET User Secrets:

```bash
cd src/SignhostAPIClient.IntegrationTests
dotnet user-secrets set "Signhost:AppKey" "your-app-key-here"
dotnet user-secrets set "Signhost:UserToken" "your-user-token-here"
dotnet user-secrets set "Signhost:ApiBaseUrl" "https://api.signhost.com/api"
```

## Running Tests

```bash
dotnet test src/SignhostAPIClient.IntegrationTests/SignhostAPIClient.IntegrationTests.csproj
```

## Important Notes

- These tests are **excluded from CI/CD** pipelines
- These tests are **not packaged** in the NuGet package
- Tests will fail if credentials are not configured
- Tests create real transactions in your Signhost account
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Build">
<TargetFrameworks>net10.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<CodeAnalysisRuleSet>../signhost.ruleset</CodeAnalysisRuleSet>
<UserSecretsId>signhost-api-client-integration-tests</UserSecretsId>
</PropertyGroup>

<ItemGroup Label="Build">
<AdditionalFiles Include="../stylecop.json" />
</ItemGroup>

<ItemGroup Label="Package References">
<PackageReference Include="FluentAssertions" Version="7.2.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" />
</ItemGroup>

<ItemGroup Label="Project References">
<ProjectReference Include="../SignhostAPIClient/SignhostAPIClient.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="TestFiles/*.pdf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
38 changes: 38 additions & 0 deletions src/SignhostAPIClient.IntegrationTests/TestConfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using Microsoft.Extensions.Configuration;

namespace Signhost.APIClient.Rest.IntegrationTests;

/// <summary>
/// Configuration for integration tests loaded from user secrets only.
/// No appsettings.json is used to prevent accidental credential commits.
/// </summary>
public class TestConfiguration
{
private static readonly Lazy<TestConfiguration> LazyInstance =
new(() => new TestConfiguration());

private TestConfiguration()
{
var builder = new ConfigurationBuilder()
.AddUserSecrets<TestConfiguration>(optional: false);

IConfiguration configuration = builder.Build();
AppKey = configuration["Signhost:AppKey"];
UserToken = configuration["Signhost:UserToken"];
ApiBaseUrl = configuration["Signhost:ApiBaseUrl"];
}

public static TestConfiguration Instance => LazyInstance.Value;

public string AppKey { get; }

public string UserToken { get; }

public string ApiBaseUrl { get; }

public bool IsConfigured =>
!string.IsNullOrWhiteSpace(AppKey) &&
!string.IsNullOrWhiteSpace(UserToken) &&
!string.IsNullOrWhiteSpace(ApiBaseUrl);
}
Binary file not shown.
Loading