Skip to content

Commit b765c58

Browse files
committed
Bumped ClientEncryption.RestSharpV2 version
1 parent 643d22d commit b765c58

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

csharp/Acme.App.MastercardApi.Client/Acme.App.MastercardApi.Client.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<ItemGroup>
2323
<PackageReference Include="JsonSubTypes" Version="1.8.0" />
24-
<PackageReference Include="Mastercard.Developer.ClientEncryption.RestSharpV2" Version="1.1.2" />
24+
<PackageReference Include="Mastercard.Developer.ClientEncryption.RestSharpV2" Version="1.3.1" />
2525
<PackageReference Include="Mastercard.Developer.OAuth1Signer.RestSharpV2" Version="1.3.2" />
2626
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
2727
<PackageReference Include="RestSharp" Version="106.12.0" />

csharp/Acme.App.MastercardApi.Client/Client/MastercardApiClient.cs

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,29 @@
77

88
namespace Acme.App.MastercardApi.Client.Client
99
{
10-
partial class ApiClient
11-
{
12-
private readonly Uri _basePath;
13-
private readonly RestSharpSigner _signer;
14-
private readonly RestSharpFieldLevelEncryptionInterceptor _encryptionInterceptor;
15-
10+
partial class ApiClient
11+
{
12+
private readonly Uri _basePath;
13+
private readonly RestSharpSigner _signer;
14+
private readonly RestSharpEncryptionInterceptor _encryptionInterceptor;
15+
1616
/// <summary>
17-
///
17+
/// Construct an ApiClient which will automatically:
18+
/// - Sign requests
19+
/// - Encrypt/decrypt requests and responses
1820
/// </summary>
19-
/// <param name="signingKey"></param>
20-
/// <param name="basePath"></param>
21-
/// <param name="consumerKey"></param>
22-
/// <param name="config"></param>
23-
public ApiClient(RSA signingKey, string basePath, string consumerKey, FieldLevelEncryptionConfig config)
24-
{
25-
_baseUrl = basePath;
26-
_basePath = new Uri(basePath);
27-
_signer = new RestSharpSigner(consumerKey, signingKey);
28-
_encryptionInterceptor = new RestSharpFieldLevelEncryptionInterceptor(config);
29-
}
30-
31-
partial void InterceptRequest(IRestRequest request)
32-
{
33-
_encryptionInterceptor.InterceptRequest(request);
34-
_signer.Sign(this._basePath, request);
35-
}
21+
public ApiClient(RSA signingKey, string basePath, string consumerKey, EncryptionConfig config)
22+
{
23+
_baseUrl = basePath;
24+
_basePath = new Uri(basePath);
25+
_signer = new RestSharpSigner(consumerKey, signingKey);
26+
_encryptionInterceptor = RestSharpEncryptionInterceptor.From(config);
27+
}
28+
29+
partial void InterceptRequest(IRestRequest request)
30+
{
31+
_encryptionInterceptor.InterceptRequest(request);
32+
_signer.Sign(_basePath, request);
33+
}
3634
}
3735
}

0 commit comments

Comments
 (0)