Skip to content

Commit

Permalink
Version 8.0.2-v2.1-24.2.00.00 release (#458)
Browse files Browse the repository at this point in the history
Co-authored-by: root <[email protected]>
  • Loading branch information
garg-mudit and root authored Nov 18, 2024
1 parent 598ee95 commit 3aa9f59
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 64 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# DocuSign C# Client Changelog

## [v8.0.2] - eSignature API v2.1-24.2.00.00 - 2024-11-15
### Changed
- Resolved an issue that prevented the use of `RequestJWTApplicationToken` with a production account URL.
- Updated C# SDK dependencies.
- BouncyCastle.Cryptography: Version bumped from 2.3.1 to 2.4.0.
- Microsoft.IdentityModelJsonWebTokens: Version bumped from 7.5.2 to 8.2.0.
- Updated the SDK release version.

## [v8.0.1] - eSignature API v2.1-24.2.00.00 - 2024-11-07
### Changed
- Fixed Deadlock issue with UI Apps (E.g. WinForms).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This client SDK is provided as open source, which enables you to customize its f
<a id="versionInformation"></a>
### Version Information
- **API version**: v2.1
- **Latest SDK version (Including prerelease)**: 8.0.1
- **Latest SDK version (Including prerelease)**: 8.0.2

<a id="requirements"></a>
### Requirements
Expand Down
10 changes: 5 additions & 5 deletions sdk/DocuSign.eSign.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
VisualStudioVersion = 12.0.0.0
MinimumVisualStudioVersion = 10.0.0.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocuSign.eSign", "src\DocuSign.eSign\DocuSign.eSign.csproj", "{54EB3C5C-3432-4E2F-ADEC-DE1DE3934C2B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocuSign.eSign", "src\DocuSign.eSign\DocuSign.eSign.csproj", "{F033EEDD-2FFD-410C-B56A-0AFEDB851DEE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{54EB3C5C-3432-4E2F-ADEC-DE1DE3934C2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54EB3C5C-3432-4E2F-ADEC-DE1DE3934C2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54EB3C5C-3432-4E2F-ADEC-DE1DE3934C2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{54EB3C5C-3432-4E2F-ADEC-DE1DE3934C2B}.Release|Any CPU.Build.0 = Release|Any CPU
{F033EEDD-2FFD-410C-B56A-0AFEDB851DEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F033EEDD-2FFD-410C-B56A-0AFEDB851DEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F033EEDD-2FFD-410C-B56A-0AFEDB851DEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F033EEDD-2FFD-410C-B56A-0AFEDB851DEE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/DocuSign.eSign/Client/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Configuration
/// Version of the package.
/// </summary>
/// <value>Version of the package.</value>
public const string Version = "8.0.1";
public const string Version = "8.0.2";

/// <summary>
/// Identifier for ISO 8601 DateTime Format
Expand Down
46 changes: 23 additions & 23 deletions sdk/src/DocuSign.eSign/Client/DocuSignClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ protected static IHttpClient buildDefaultHttpClient(int timeout = Configuration.
/// <value>An instance of the RestClient</value>
public IHttpClient RestClient { get; set; }

public DocuSignRequest PrepareOAuthRequest(string oAuthBasePath, string path, HttpMethod method, List<KeyValuePair<string, string>> headerParams = null, List<KeyValuePair<string, string>> formParams = null)
public DocuSignRequest PrepareOAuthRequest(string oAuthBasePathParam, string path, HttpMethod method, List<KeyValuePair<string, string>> headerParams = null, List<KeyValuePair<string, string>> formParams = null)
{
string url = $"https://{oAuthBasePath}/{path}";
string url = $"https://{oAuthBasePathParam}/{path}";

if (!headerParams.Any(kvp => kvp.Key?.Equals("Content-Type") ?? false)) { headerParams.Add(new KeyValuePair<string, string>("Content-Type", "application/x-www-form-urlencoded")); }
if (!headerParams.Any(kvp => kvp.Key?.Equals("Cache-Control") ?? false)) { headerParams.Add(new KeyValuePair<string, string>("Cache-Control", "no-store")); }
Expand Down Expand Up @@ -914,7 +914,7 @@ public OAuth.UserInfo GetUserInfo(string accessToken)
if (localVarHeaderParams.ContainsKey("Authorization")) { localVarHeaderParams.Remove("Authorization"); }
localVarHeaderParams.Add("Authorization", "Bearer " + accessToken);

DocuSignRequest request = PrepareOAuthRequest(oAuthBasePath, $"oauth/userinfo", HttpMethod.Get, localVarHeaderParams.ToList(), localVarFormParams.ToList());
DocuSignRequest request = PrepareOAuthRequest(this.oAuthBasePath, $"oauth/userinfo", HttpMethod.Get, localVarHeaderParams.ToList(), localVarFormParams.ToList());
DocuSignResponse response = await RestClient.SendRequestAsync(request, cancellationToken);

if (response.StatusCode >= HttpStatusCode.OK && response.StatusCode < HttpStatusCode.BadRequest)
Expand Down Expand Up @@ -964,7 +964,7 @@ protected static RSA CreateRSAKeyFromPem(string key)
/// </summary>
/// <param name="clientId">Docusign OAuth Client Id(AKA Integrator Key)</param>
/// <param name="userId">Docusign user Id to be impersonated(This is a UUID)</param>
/// <param name="oauthBasePath"> Docusign OAuth base path
/// <param name="oAuthBasePathParam"> Docusign OAuth base path
/// <see cref="OAuth.Demo_OAuth_BasePath"/> <see cref="OAuth.Production_OAuth_BasePath"/>
/// <seealso cref="GetOAuthBasePath()" /> <seealso cref="SetOAuthBasePath(string)"/>
/// </param>
Expand All @@ -974,12 +974,12 @@ protected static RSA CreateRSAKeyFromPem(string key)
/// <see cref="OAuth.Scope_SIGNATURE"/> <see cref="OAuth.Scope_IMPERSONATION"/> <see cref="OAuth.Scope_EXTENDED"/>
/// </param>
/// <returns>The JWT user token</returns>
public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, string oauthBasePath, Stream privateKeyStream, int expiresInHours, List<string> scopes = null)
public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, string oAuthBasePathParam, Stream privateKeyStream, int expiresInHours, List<string> scopes = null)
{
using (var cts = new CancellationTokenSource())
{
return TryCatchWrapper(() => {
var task = Task.Run(async () => await RequestJWTUserTokenAsync(clientId, userId, oauthBasePath, privateKeyStream, expiresInHours, scopes, cts.Token));
var task = Task.Run(async () => await RequestJWTUserTokenAsync(clientId, userId, oAuthBasePathParam, privateKeyStream, expiresInHours, scopes, cts.Token));
task.Wait();
return task.Result;
});
Expand All @@ -992,7 +992,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
/// </summary>
/// <param name="clientId">Docusign OAuth Client Id(AKA Integrator Key)</param>
/// <param name="userId">Docusign user Id to be impersonated(This is a UUID)</param>
/// <param name="oauthBasePath"> Docusign OAuth base path
/// <param name="oAuthBasePathParam"> Docusign OAuth base path
/// <see cref="OAuth.Demo_OAuth_BasePath"/> <see cref="OAuth.Production_OAuth_BasePath"/>
/// <seealso cref="GetOAuthBasePath()" /> <seealso cref="SetOAuthBasePath(string)"/>
/// </param>
Expand All @@ -1003,12 +1003,12 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
/// <see cref="OAuth.Scope_SIGNATURE"/> <see cref="OAuth.Scope_IMPERSONATION"/> <see cref="OAuth.Scope_EXTENDED"/>
/// </param>
/// <returns>The JWT user token</returns>
public async Task<OAuth.OAuthToken> RequestJWTUserTokenAsync(string clientId, string userId, string oauthBasePath, Stream privateKeyStream, int expiresInHours, List<string> scopes = null, CancellationToken cancellationToken = default)
public async Task<OAuth.OAuthToken> RequestJWTUserTokenAsync(string clientId, string userId, string oAuthBasePathParam, Stream privateKeyStream, int expiresInHours, List<string> scopes = null, CancellationToken cancellationToken = default)
{
if (privateKeyStream != null && privateKeyStream.CanRead && privateKeyStream.Length > 0)
{
byte[] privateKeyBytes = ReadAsBytes(privateKeyStream);
return await this.RequestJWTUserTokenAsync(clientId, userId, oauthBasePath, privateKeyBytes, expiresInHours, scopes, cancellationToken);
return await this.RequestJWTUserTokenAsync(clientId, userId, oAuthBasePathParam, privateKeyBytes, expiresInHours, scopes, cancellationToken);
}
else
{
Expand All @@ -1022,7 +1022,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
/// </summary>
/// <param name="clientId">Docusign OAuth Client Id(AKA Integrator Key)</param>
/// <param name="userId">Docusign user Id to be impersonated(This is a UUID)</param>
/// <param name="oauthBasePath"> Docusign OAuth base path
/// <param name="oAuthBasePathParam"> Docusign OAuth base path
/// <see cref="OAuth.Demo_OAuth_BasePath"/> <see cref="OAuth.Production_OAuth_BasePath"/>
/// <seealso cref="GetOAuthBasePath()" /> <seealso cref="SetOAuthBasePath(string)"/>
/// </param>
Expand All @@ -1032,13 +1032,13 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
/// <see cref="OAuth.Scope_SIGNATURE"/> <see cref="OAuth.Scope_IMPERSONATION"/> <see cref="OAuth.Scope_EXTENDED"/>
/// </param>
/// <returns>The JWT user token</returns>
public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, string oauthBasePath, byte[] privateKeyBytes, int expiresInHours, List<string> scopes = null)
public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, string oAuthBasePathParam, byte[] privateKeyBytes, int expiresInHours, List<string> scopes = null)
{

using (var cts = new CancellationTokenSource())
{
return TryCatchWrapper(() => {
var task = Task.Run(async () => await RequestJWTUserTokenAsync(clientId, userId, oauthBasePath, privateKeyBytes, expiresInHours, scopes, cts.Token));
var task = Task.Run(async () => await RequestJWTUserTokenAsync(clientId, userId, oAuthBasePathParam, privateKeyBytes, expiresInHours, scopes, cts.Token));
task.Wait();
return task.Result;
});
Expand All @@ -1051,7 +1051,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
/// </summary>
/// <param name="clientId">Docusign OAuth Client Id(AKA Integrator Key)</param>
/// <param name="userId">Docusign user Id to be impersonated(This is a UUID)</param>
/// <param name="oauthBasePath"> Docusign OAuth base path
/// <param name="oAuthBasePathParam"> Docusign OAuth base path
/// <see cref="OAuth.Demo_OAuth_BasePath"/> <see cref="OAuth.Production_OAuth_BasePath"/>
/// <seealso cref="GetOAuthBasePath()" /> <seealso cref="SetOAuthBasePath(string)"/>
/// </param>
Expand All @@ -1062,7 +1062,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
/// <see cref="OAuth.Scope_SIGNATURE"/> <see cref="OAuth.Scope_IMPERSONATION"/> <see cref="OAuth.Scope_EXTENDED"/>
/// </param>
/// <returns>The JWT user token</returns>
public async Task<OAuth.OAuthToken> RequestJWTUserTokenAsync(string clientId, string userId, string oauthBasePath, byte[] privateKeyBytes, int expiresInHours, List<string> scopes = null, CancellationToken cancellationToken = default)
public async Task<OAuth.OAuthToken> RequestJWTUserTokenAsync(string clientId, string userId, string oAuthBasePathParam, byte[] privateKeyBytes, int expiresInHours, List<string> scopes = null, CancellationToken cancellationToken = default)
{
string privateKey = Encoding.UTF8.GetString(privateKeyBytes);

Expand All @@ -1081,7 +1081,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri

descriptor.Subject = new ClaimsIdentity();
descriptor.Subject.AddClaim(new Claim("scope", String.Join(" ", scopes)));
descriptor.Subject.AddClaim(new Claim("aud", oauthBasePath));
descriptor.Subject.AddClaim(new Claim("aud", oAuthBasePathParam));
descriptor.Subject.AddClaim(new Claim("iss", clientId));

if (!string.IsNullOrEmpty(userId))
Expand Down Expand Up @@ -1112,7 +1112,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
{ "assertion", jwtToken }
};

DocuSignRequest request = PrepareOAuthRequest(oauthBasePath, $"oauth/token", HttpMethod.Post, Configuration.DefaultHeader?.ToList(), localVarFormParams.ToList());
DocuSignRequest request = PrepareOAuthRequest(oAuthBasePathParam, $"oauth/token", HttpMethod.Post, Configuration.DefaultHeader?.ToList(), localVarFormParams.ToList());
DocuSignResponse response = await RestClient.SendRequestAsync(request, cancellationToken);

if (response.StatusCode >= HttpStatusCode.OK && response.StatusCode < HttpStatusCode.BadRequest)
Expand All @@ -1132,7 +1132,7 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
/// *RESERVED FOR PARTNERS* RequestJWTApplicationToken
/// </summary>
/// <param name="clientId">Docusign OAuth Client Id(AKA Integrator Key)</param>
/// <param name="oauthBasePath"> Docusign OAuth base path
/// <param name="oAuthBasePathParam"> Docusign OAuth base path
/// <see cref="OAuth.Demo_OAuth_BasePath"/> <see cref="OAuth.Production_OAuth_BasePath"/>
/// <seealso cref="GetOAuthBasePath()" /> <seealso cref="SetOAuthBasePath(string)"/>
/// </param>
Expand All @@ -1142,12 +1142,12 @@ public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, stri
/// <see cref="OAuth.Scope_SIGNATURE"/> <see cref="OAuth.Scope_IMPERSONATION"/> <see cref="OAuth.Scope_EXTENDED"/>
/// </param>
/// <returns>The JWT application token</returns>
public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oauthBasePath, byte[] privateKeyBytes, int expiresInHours, List<string> scopes = null)
public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oAuthBasePathParam, byte[] privateKeyBytes, int expiresInHours, List<string> scopes = null)
{
using (var cts = new CancellationTokenSource())
{
return TryCatchWrapper(() => {
var task = Task.Run(async () => await RequestJWTApplicationTokenAsync(clientId, oAuthBasePath, privateKeyBytes, expiresInHours, scopes, cts.Token));
var task = Task.Run(async () => await RequestJWTApplicationTokenAsync(clientId, oAuthBasePathParam, privateKeyBytes, expiresInHours, scopes, cts.Token));
task.Wait();
return task.Result;
});
Expand All @@ -1158,7 +1158,7 @@ public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oauth
/// *RESERVED FOR PARTNERS* RequestJWTApplicationTokenAsync
/// </summary>
/// <param name="clientId">Docusign OAuth Client Id(AKA Integrator Key)</param>
/// <param name="oauthBasePath"> Docusign OAuth base path
/// <param name="oAuthBasePathParam"> Docusign OAuth base path
/// <see cref="OAuth.Demo_OAuth_BasePath"/> <see cref="OAuth.Production_OAuth_BasePath"/>
/// <seealso cref="GetOAuthBasePath()" /> <seealso cref="SetOAuthBasePath(string)"/>
/// </param>
Expand All @@ -1169,7 +1169,7 @@ public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oauth
/// <see cref="OAuth.Scope_SIGNATURE"/> <see cref="OAuth.Scope_IMPERSONATION"/> <see cref="OAuth.Scope_EXTENDED"/>
/// </param>
/// <returns>The JWT application token</returns>
public async Task<OAuth.OAuthToken> RequestJWTApplicationTokenAsync(string clientId, string oauthBasePath, byte[] privateKeyBytes, int expiresInHours, List<string> scopes = null, CancellationToken cancellationToken = default)
public async Task<OAuth.OAuthToken> RequestJWTApplicationTokenAsync(string clientId, string oAuthBasePathParam, byte[] privateKeyBytes, int expiresInHours, List<string> scopes = null, CancellationToken cancellationToken = default)
{
string privateKey = Encoding.UTF8.GetString(privateKeyBytes);

Expand All @@ -1184,7 +1184,7 @@ public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oauth

descriptor.Subject = new ClaimsIdentity();
descriptor.Subject.AddClaim(new Claim("scope", String.Join(" ", scopes)));
descriptor.Subject.AddClaim(new Claim("aud", oauthBasePath));
descriptor.Subject.AddClaim(new Claim("aud", oAuthBasePathParam));
descriptor.Subject.AddClaim(new Claim("iss", clientId));

if (!string.IsNullOrEmpty(privateKey))
Expand All @@ -1206,7 +1206,7 @@ public OAuth.OAuthToken RequestJWTApplicationToken(string clientId, string oauth
{ "assertion", jwtToken }
};

DocuSignRequest request = PrepareOAuthRequest(oauthBasePath, $"oauth/token", HttpMethod.Post, Configuration.DefaultHeader?.ToList(), localVarFormParams.ToList());
DocuSignRequest request = PrepareOAuthRequest(oAuthBasePathParam, $"oauth/token", HttpMethod.Post, Configuration.DefaultHeader?.ToList(), localVarFormParams.ToList());
DocuSignResponse response = await RestClient.SendRequestAsync(request, cancellationToken);

if (response.StatusCode >= HttpStatusCode.OK && response.StatusCode < HttpStatusCode.BadRequest)
Expand Down
8 changes: 4 additions & 4 deletions sdk/src/DocuSign.eSign/DocuSign.eSign.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<RootNamespace>DocuSign.eSign</RootNamespace>
<AssemblyName>DocuSign.eSign</AssemblyName>
<NeutralLanguage>en-US</NeutralLanguage>
<VersionPrefix>8.0.1</VersionPrefix>
<VersionPrefix>8.0.2</VersionPrefix>
<VersionSuffix/>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -26,7 +26,7 @@
<PackageLicenseUrl>https://github.com/docusign/docusign-esign-csharp-client/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/docusign/docusign-esign-csharp-client</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReleaseNotes>[v8.0.1] - ESignature API v2.1-24.2.00.00 - 11/7/2024</PackageReleaseNotes>
<PackageReleaseNotes>[v8.0.2] - ESignature API v2.1-24.2.00.00 - 11/15/2024</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net462'">
<DefineConstants>NET462</DefineConstants>
Expand All @@ -38,10 +38,10 @@
<Reference Include="System.Web"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.5.2"/>
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.2.0"/>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0"/>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.3.1"/>
<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0"/>
</ItemGroup>
<ItemGroup/>
</Project>
2 changes: 1 addition & 1 deletion sdk/src/DocuSign.eSign/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
// [assembly: AssemblyVersion("1.0.*")]
internal class AssemblyInformation
{
public const string AssemblyInformationalVersion = "8.0.1";
public const string AssemblyInformationalVersion = "8.0.2";
}
Loading

0 comments on commit 3aa9f59

Please sign in to comment.