Skip to content

Commit

Permalink
Merge pull request #94 from getyoti/release/1.6.1
Browse files Browse the repository at this point in the history
Release v1.6.1
  • Loading branch information
echarrod authored Dec 3, 2021
2 parents 0b6f514 + 276a84b commit fb3e191
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="coverlet.collector" Version="3.0.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
<PackageReference Include="coverlet.collector" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 4 additions & 2 deletions Yoti.Auth.Sandbox.Tests/DocScan/DocScanSandboxClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ public void ConfigureSessionResponseShouldNotThrowException()
.WithKeyPair(KeyPair.Get())
.Build();

docScanSandboxClient.ConfigureSessionResponse(
var ex = Record.Exception(() => docScanSandboxClient.ConfigureSessionResponse(
_someSessionId,
_sandboxResponseConfig);
_sandboxResponseConfig));

Assert.Null(ex);
};
}

Expand Down
8 changes: 4 additions & 4 deletions Yoti.Auth.Sandbox.Tests/Yoti.Auth.Sandbox.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.0.3">
<PackageReference Include="coverlet.msbuild" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Moq" Version="4.15.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
Expand Down
72 changes: 47 additions & 25 deletions Yoti.Auth.Sandbox/DocScan/Request/SandboxClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,54 +32,76 @@ internal SandboxClient(string sdkId, AsymmetricCipherKeyPair keyPair, Uri apiUri

public void ConfigureSessionResponse(string sessionId, ResponseConfig sandboxExpection)
{
string serializedSandboxResponseConfig = JsonConvert.SerializeObject(
try
{
string serializedSandboxResponseConfig = JsonConvert.SerializeObject(
sandboxExpection,
new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
});
byte[] body = Encoding.UTF8.GetBytes(serializedSandboxResponseConfig);
byte[] body = Encoding.UTF8.GetBytes(serializedSandboxResponseConfig);

Yoti.Auth.Web.Request request = new RequestBuilder()
.WithKeyPair(_keyPair)
.WithBaseUri(DocScanSandboxApiUrl)
.WithEndpoint($"/sessions/{sessionId}/response-config")
.WithHttpMethod(HttpMethod.Put)
.WithContent(body)
.WithQueryParam("sdkId", _sdkId)
.Build();
Yoti.Auth.Web.Request request = new RequestBuilder()
.WithKeyPair(_keyPair)
.WithBaseUri(DocScanSandboxApiUrl)
.WithEndpoint($"/sessions/{sessionId}/response-config")
.WithHttpMethod(HttpMethod.Put)
.WithContent(body)
.WithQueryParam("sdkId", _sdkId)
.Build();

HttpResponseMessage response = request.Execute(_httpClient).Result;
HttpResponseMessage response = request.Execute(_httpClient).Result;

if (!response.IsSuccessStatusCode)
if (!response.IsSuccessStatusCode)
{
Response.CreateYotiExceptionFromStatusCode<SandboxException>(response);
}
}
catch (SandboxException)
{
throw;
}
catch (Exception ex)
{
Response.CreateYotiExceptionFromStatusCode<SandboxException>(response);
throw new SandboxException(Properties.Resources.DocScanSessionResponseError, ex);
}
}

public void ConfigureApplicationResponse(ResponseConfig sandboxExpection)
{
string serializedSandboxResponseConfig = JsonConvert.SerializeObject(
try
{
string serializedSandboxResponseConfig = JsonConvert.SerializeObject(
sandboxExpection,
new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
});
byte[] body = Encoding.UTF8.GetBytes(serializedSandboxResponseConfig);
byte[] body = Encoding.UTF8.GetBytes(serializedSandboxResponseConfig);

Yoti.Auth.Web.Request request = new RequestBuilder()
.WithKeyPair(_keyPair)
.WithBaseUri(DocScanSandboxApiUrl)
.WithEndpoint($"/apps/{_sdkId}/response-config")
.WithHttpMethod(HttpMethod.Put)
.WithContent(body)
.Build();
Yoti.Auth.Web.Request request = new RequestBuilder()
.WithKeyPair(_keyPair)
.WithBaseUri(DocScanSandboxApiUrl)
.WithEndpoint($"/apps/{_sdkId}/response-config")
.WithHttpMethod(HttpMethod.Put)
.WithContent(body)
.Build();

HttpResponseMessage response = request.Execute(_httpClient).Result;
HttpResponseMessage response = request.Execute(_httpClient).Result;

if (!response.IsSuccessStatusCode)
if (!response.IsSuccessStatusCode)
{
Response.CreateYotiExceptionFromStatusCode<SandboxException>(response);
}
}
catch (SandboxException)
{
throw;
}
catch (Exception ex)
{
Response.CreateYotiExceptionFromStatusCode<SandboxException>(response);
throw new SandboxException(Properties.Resources.DocScanApplicationResponseError, ex);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Yoti.Auth.Sandbox/Yoti.Auth.Sandbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageId>Yoti.Sandbox</PackageId>
<PackageProjectUrl>https://developers.yoti.com/yoti-app/web-integration</PackageProjectUrl>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Version>1.6.0</Version>
<Version>1.6.1</Version>
</PropertyGroup>

<ItemGroup>
Expand All @@ -33,12 +33,12 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.18.0.27296">
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.32.0.39516">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Yoti" Version="3.8.0" />
<PackageReference Include="Yoti" Version="3.9.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ steps:
scannerMode: 'MSBuild'
projectKey: 'getyoti:dotnet-sandbox'
projectName: '.NET SDK Sandbox'
projectVersion: '1.6.0'
projectVersion: '1.6.1'
extraProperties: |
sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml"
sonar.links.scm = https://github.com/getyoti/yoti-dotnet-sdk-sandbox
Expand Down

0 comments on commit fb3e191

Please sign in to comment.