diff --git a/CHANGELOG.md b/CHANGELOG.md index d265e36..5f26e05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +## [v2.0.0-rc1] - Monitor API v2.0-2.0.0 - 2024-04-05 +### Breaking Changes +- Updated C# SDK dependencies. + - Microsoft.CSharp: Version bumped from 4.5.0 to 4.7.0. + - Newtonsoft.Json: Version bumped from 13.0.1 to 13.0.3. + - System.ComponentModel.Annotations: Version bumped from 4.5.0 to 5.0.0. + - Microsoft.IdentityModel.Protocols: Version bumped from 5.4.0 to 7.3.1. + - System.IdentityModel.Tokens.Jwt: Version bumped from 5.4.0 to 7.3.1. + - BouncyCastle.Cryptography: Version bumped from 2.2.1 to 2.3.0. +### Changed +- Updated the SDK release version. + +## [v1.2.1] - Monitor API v2.0-2.0.0 - 2023-12-15 +### Changed +- Updated the SDK release version. +- Removed tracked files which are now present in .gitignore. + ## [v1.2.0] - Monitor API v2.0-2.0.0 - 2023-06-14 ### Changed - Added support for version v2.0-2.0.0 of the DocuSign Monitor API. diff --git a/LICENSE b/LICENSE index 99f6a65..aae1b9b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ -MIT License +The MIT License -Copyright (c) 2020 DocuSign Inc. +Copyright (c) 2020 - DocuSign, Inc. (https://www.docusign.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/.swagger-codegen/VERSION b/sdk/.swagger-codegen/VERSION index 580ce10..19244e8 100644 --- a/sdk/.swagger-codegen/VERSION +++ b/sdk/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.21-SNAPSHOT \ No newline at end of file +2.4.21 \ No newline at end of file diff --git a/sdk/DocuSign.Monitor.sln b/sdk/DocuSign.Monitor.sln index b44dfc7..20d6f38 100644 --- a/sdk/DocuSign.Monitor.sln +++ b/sdk/DocuSign.Monitor.sln @@ -1,8 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29509.3 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocuSign.Rooms", "src\DocuSign.Monitor\DocuSign.Monitor.csproj", "{6E3B93F3-8407-4C94-A73D-42A2D0ED2E35}" +# Visual Studio 2012 +VisualStudioVersion = 12.0.0.0 +MinimumVisualStudioVersion = 10.0.0.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocuSign.Monitor", "src\DocuSign.Monitor\DocuSign.Monitor.csproj", "{7C3EC099-EE1B-42B7-B644-12B6E8FA3E3B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -10,15 +10,12 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6E3B93F3-8407-4C94-A73D-42A2D0ED2E35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6E3B93F3-8407-4C94-A73D-42A2D0ED2E35}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6E3B93F3-8407-4C94-A73D-42A2D0ED2E35}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6E3B93F3-8407-4C94-A73D-42A2D0ED2E35}.Release|Any CPU.Build.0 = Release|Any CPU + {7C3EC099-EE1B-42B7-B644-12B6E8FA3E3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C3EC099-EE1B-42B7-B644-12B6E8FA3E3B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C3EC099-EE1B-42B7-B644-12B6E8FA3E3B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C3EC099-EE1B-42B7-B644-12B6E8FA3E3B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {CA303803-4024-4EE9-8A5C-EAFB2427F8CF} - EndGlobalSection -EndGlobal +EndGlobal \ No newline at end of file diff --git a/sdk/src/DocuSign.Monitor/Api/DataSetApi.cs b/sdk/src/DocuSign.Monitor/Api/DataSetApi.cs index 9d5b74d..d3566d2 100644 --- a/sdk/src/DocuSign.Monitor/Api/DataSetApi.cs +++ b/sdk/src/DocuSign.Monitor/Api/DataSetApi.cs @@ -205,10 +205,16 @@ public ApiResponse GetStreamWithHttpInfo(string version, string if (options.limit != null) localVarQueryParams.Add("limit", this.ApiClient.ParameterToString(options.limit)); // query parameter } + // authentication (docusignAccessCode) required + // oauth required + if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken; + } // make the HTTP request - DocuSignRequest localVarRequest = this.ApiClient.PrepareRequest(localVarPath, HttpMethod.Get, localVarQueryParams.ToList(), localVarPostBody, localVarHeaderParams.ToList(), localVarFormParams.ToList(), localVarPathParams.ToList(), localVarFileParams, localVarHttpContentType, localVarHttpContentDisposition); + DocuSignRequest localVarRequest = this.ApiClient.PrepareRequest(localVarPath, new HttpMethod("GET"), localVarQueryParams.ToList(), localVarPostBody, localVarHeaderParams.ToList(), localVarFormParams.ToList(), localVarPathParams.ToList(), localVarFileParams, localVarHttpContentType, localVarHttpContentDisposition); DocuSignResponse localVarResponse = this.ApiClient.CallApi(localVarRequest); int localVarStatusCode = (int)localVarResponse.StatusCode; @@ -289,10 +295,16 @@ public async System.Threading.Tasks.Task> GetStreamA if (options.limit != null) localVarQueryParams.Add("limit", this.ApiClient.ParameterToString(options.limit)); // query parameter } + // authentication (docusignAccessCode) required + // oauth required + if (!String.IsNullOrEmpty(this.ApiClient.Configuration.AccessToken)) + { + localVarHeaderParams["Authorization"] = "Bearer " + this.ApiClient.Configuration.AccessToken; + } // make the HTTP request - DocuSignRequest localVarRequest = this.ApiClient.PrepareRequest(localVarPath, HttpMethod.Get, localVarQueryParams.ToList(), localVarPostBody, localVarHeaderParams.ToList(), localVarFormParams.ToList(), localVarPathParams.ToList(), localVarFileParams, localVarHttpContentType, localVarHttpContentDisposition); + DocuSignRequest localVarRequest = this.ApiClient.PrepareRequest(localVarPath, new HttpMethod("GET"), localVarQueryParams.ToList(), localVarPostBody, localVarHeaderParams.ToList(), localVarFormParams.ToList(), localVarPathParams.ToList(), localVarFileParams, localVarHttpContentType, localVarHttpContentDisposition); DocuSignResponse localVarResponse = await this.ApiClient.CallApiAsync(localVarRequest); int localVarStatusCode = (int)localVarResponse.StatusCode; diff --git a/sdk/src/DocuSign.Monitor/Client/ApiClient.cs b/sdk/src/DocuSign.Monitor/Client/ApiClient.cs index e38145e..cc10f7e 100644 --- a/sdk/src/DocuSign.Monitor/Client/ApiClient.cs +++ b/sdk/src/DocuSign.Monitor/Client/ApiClient.cs @@ -22,14 +22,14 @@ public class ApiClient : DocuSignClient { /// /// Initializes a new instance of the class - /// with default configuration and base path (https://lens.docusign.net). + /// with default configuration and base path (https://lens-d.docusign.net). /// [Obsolete("ApiClient is now obsolete and will be removed in a future release. Use DocuSignClient() instead.", false)] public ApiClient() : base() { } /// /// Initializes a new instance of the class - /// with default base path (https://lens.docusign.net). + /// with default base path (https://lens-d.docusign.net). /// /// An instance of Configuration. [Obsolete("ApiClient is now obsolete and will be removed in a future release. Use DocuSignClient(Configuration) instead.", false)] diff --git a/sdk/src/DocuSign.Monitor/Client/Configuration.cs b/sdk/src/DocuSign.Monitor/Client/Configuration.cs index 04c98e6..5939971 100644 --- a/sdk/src/DocuSign.Monitor/Client/Configuration.cs +++ b/sdk/src/DocuSign.Monitor/Client/Configuration.cs @@ -26,7 +26,7 @@ public class Configuration /// Version of the package. /// /// Version of the package. - public const string Version = "1.2.0"; + public const string Version = "2.0.0-rc1"; /// /// Identifier for ISO 8601 DateTime Format @@ -102,10 +102,10 @@ static Configuration() /// /// Initializes a new instance of the class /// - public Configuration(string basePath = "https://lens.docusign.net") + public Configuration(string basePath = "https://lens-d.docusign.net") { - UserAgent = $"C#/{Version}/{_getFrameworkVersion()}"; - BasePath = basePath ?? "https://lens.docusign.net"; + UserAgent = $"Swagger-Codegen/v2.0/{Version}/C#/{_getFrameworkVersion()}"; + BasePath = basePath ?? "https://lens-d.docusign.net"; DefaultHeader = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); ApiKeyPrefix = new ConcurrentDictionary(); diff --git a/sdk/src/DocuSign.Monitor/Client/DocuSignClient.cs b/sdk/src/DocuSign.Monitor/Client/DocuSignClient.cs index 793d6af..29062a9 100644 --- a/sdk/src/DocuSign.Monitor/Client/DocuSignClient.cs +++ b/sdk/src/DocuSign.Monitor/Client/DocuSignClient.cs @@ -46,15 +46,15 @@ public class DocuSignClient // Stage base path public const string Stage_REST_BasePath = "https://lens-s.docusign.net"; - protected string basePath = Production_REST_BasePath; + protected string basePath = Demo_REST_BasePath; - protected Uri baseUri => Uri.TryCreate(basePath, UriKind.Absolute, out Uri uri) ? uri : new Uri(Production_REST_BasePath); + protected Uri baseUri => Uri.TryCreate(basePath, UriKind.Absolute, out Uri uri) ? uri : new Uri(Demo_REST_BasePath); - protected string oAuthBasePath = OAuth.Production_OAuth_BasePath; + protected string oAuthBasePath = OAuth.Demo_OAuth_BasePath; protected string oAuthBasePathWithScheme => $"https://{oAuthBasePath}/"; - protected Uri oAuthBaseUri => Uri.TryCreate(oAuthBasePathWithScheme, UriKind.Absolute, out Uri uri) ? uri : new Uri(OAuth.Production_OAuth_BasePath); + protected Uri oAuthBaseUri => Uri.TryCreate(oAuthBasePathWithScheme, UriKind.Absolute, out Uri uri) ? uri : new Uri(OAuth.Demo_OAuth_BasePath); protected JsonSerializerSettings serializerSettings = new JsonSerializerSettings { @@ -82,13 +82,13 @@ public virtual void InterceptResponse(DocuSignRequest request, DocuSignResponse /// /// Initializes a new instance of with default - /// with default base path (https://lens.docusign.net). + /// with default base path (https://lens-d.docusign.net). /// public DocuSignClient() { Configuration = new Configuration(); - SetBasePath(Production_REST_BasePath); + SetBasePath(Demo_REST_BasePath); RestClient = buildDefaultHttpClient(); SetOAuthBasePath(); @@ -98,14 +98,14 @@ public DocuSignClient() /// /// Initializes a new instance of using - /// the provided configuration with the default base path (https://lens.docusign.net). + /// the provided configuration with the default base path (https://lens-d.docusign.net). /// /// Provided pre-populated object public DocuSignClient(Configuration configuration) { Configuration = configuration ?? new Configuration(); - SetBasePath(string.IsNullOrEmpty(configuration.BasePath) ? Production_REST_BasePath : configuration.BasePath); + SetBasePath(string.IsNullOrEmpty(configuration.BasePath) ? Demo_REST_BasePath : configuration.BasePath); RestClient = buildDefaultHttpClient(configuration?.Timeout ?? Configuration.DefaultTimeoutValue); SetOAuthBasePath(); @@ -181,7 +181,7 @@ public DocuSignClient(string apiBase, HttpClient apiClient) /// public DocuSignClient(string apiBase, IHttpClient client) { - string baseUrl = string.IsNullOrEmpty(apiBase) ? Production_REST_BasePath : apiBase; + string baseUrl = string.IsNullOrEmpty(apiBase) ? Demo_REST_BasePath : apiBase; Configuration = new Configuration(baseUrl); SetBasePath(baseUrl); @@ -235,24 +235,24 @@ public DocuSignRequest PrepareOAuthRequest(string oAuthBasePath, string path, Ht public DocuSignRequest PrepareRequest(string path, HttpMethod method, List> queryParams = null, object postBody = null, List> headerParams = null, List> formParams = null, List> pathParams = null, List fileParams = null, string contentType = null, string contentDisposition = null) { - string url = $"{basePath}{path}"; + string url = $"{basePath}{path}"; return new DocuSignRequest(method, url, queryParams, postBody, headerParams, formParams, pathParams, fileParams, contentType, contentDisposition); } public DocuSignResponse CallApi(DocuSignRequest request) { - //InterceptRequest(request); + InterceptRequest(request); var response = RestClient.SendRequest(request); - //InterceptResponse(request, response); + InterceptResponse(request, response); return response; } public async Task CallApiAsync(DocuSignRequest request) { - //InterceptRequest(request); + InterceptRequest(request); CancellationTokenSource cts = new CancellationTokenSource(); var response = await RestClient.SendRequestAsync(request, cts.Token); - //InterceptResponse(request, response); + InterceptResponse(request, response); return response; } @@ -720,11 +720,11 @@ public void SetOAuthBasePath(string oauthBaseUri = null) //Derive OAuth Base Path if not given. if (Uri.TryCreate(this.basePath, UriKind.Absolute, out Uri baseUri)) { - if (Uri.TryCreate(Demo_REST_BasePath, UriKind.Absolute, out Uri demoBaseUri) && (Uri.Compare(baseUri, demoBaseUri, UriComponents.Host, UriFormat.Unescaped, StringComparison.InvariantCultureIgnoreCase) == 0)) + if (baseUri.Host.StartsWith("apps-d") || baseUri.Host.StartsWith("demo")) { this.oAuthBasePath = OAuth.Demo_OAuth_BasePath; } - else if (Uri.TryCreate(Stage_REST_BasePath, UriKind.Absolute, out Uri stageBaseUri) && (Uri.Compare(baseUri, stageBaseUri, UriComponents.Host, UriFormat.Unescaped, StringComparison.InvariantCultureIgnoreCase) == 0)) + else if (baseUri.Host.StartsWith("apps-s") || baseUri.Host.StartsWith("stage")) { this.oAuthBasePath = OAuth.Stage_OAuth_BasePath; } @@ -735,7 +735,7 @@ public void SetOAuthBasePath(string oauthBaseUri = null) } else { - this.oAuthBasePath = OAuth.Production_OAuth_BasePath; + this.oAuthBasePath = OAuth.Demo_OAuth_BasePath; } } diff --git a/sdk/src/DocuSign.Monitor/Client/DocuSignRequest.cs b/sdk/src/DocuSign.Monitor/Client/DocuSignRequest.cs index 1b357cb..a99bbeb 100644 --- a/sdk/src/DocuSign.Monitor/Client/DocuSignRequest.cs +++ b/sdk/src/DocuSign.Monitor/Client/DocuSignRequest.cs @@ -76,7 +76,7 @@ public DocuSignRequest(HttpMethod method, string path) : this(method, path, null public DocuSignRequest(HttpMethod method, string path, string contentType) : this(method, path, null, null, null, null, null, null, contentType, null) { } public DocuSignRequest(HttpMethod method, string path, List> queryParams = null, Object bodyContent = null, - List> headerParams = null, List> postParams = null, List> pathParams = null, + List> headerParams = null, List> postParams = null, List> pathParams = null, List fileParams = null, string contentType = null, string contentDisposition = null) { Method = method; diff --git a/sdk/src/DocuSign.Monitor/Client/SystemNetHttpClient.cs b/sdk/src/DocuSign.Monitor/Client/SystemNetHttpClient.cs index 3c35f4d..1039e90 100644 --- a/sdk/src/DocuSign.Monitor/Client/SystemNetHttpClient.cs +++ b/sdk/src/DocuSign.Monitor/Client/SystemNetHttpClient.cs @@ -107,13 +107,32 @@ private async Task SendHttpRequestAsync( return response; } + bool isPostOrPutHttpMethod(HttpMethod method) => method == HttpMethod.Post || method == HttpMethod.Put; + + bool isEmptyOrJsonContentType(string contentType, List> headerParams) + { + if (contentType == "application/json") + { + return true; + } + else + { + KeyValuePair contentTypeHeader = headerParams.FirstOrDefault(kvp => kvp.Key.ToLower() == "content-type"); + if (contentTypeHeader.Value == "application/json" || string.IsNullOrEmpty(contentTypeHeader.Value)) + { + return true; + } + } + return false; + } + private HttpRequestMessage BuildRequestMessage(DocuSignRequest request) { - string contentType = string.IsNullOrEmpty(request.ContentType) ? "application/json" : request.ContentType; var requestMessage = new HttpRequestMessage(request.Method, request.Url); if (request.BodyContent != null) { + string contentType = string.IsNullOrEmpty(request.ContentType) ? "application/json" : request.ContentType; if (request.BodyContent is byte[]) { requestMessage.Content = new ByteArrayContent(request.BodyContent as byte[]); @@ -158,6 +177,13 @@ private HttpRequestMessage BuildRequestMessage(DocuSignRequest request) } requestMessage.Content = multipartFormContent; } + else + { + if (isPostOrPutHttpMethod(request.Method) && isEmptyOrJsonContentType(request.ContentType, request.HeaderParams)) + { + requestMessage.Content = new StringContent("{ }", System.Text.Encoding.UTF8, "application/json"); + } + } } string uri = request.Url.ToString(); diff --git a/sdk/src/DocuSign.Monitor/DocuSign.Monitor.csproj b/sdk/src/DocuSign.Monitor/DocuSign.Monitor.csproj index 1fa276b..9d34d67 100644 --- a/sdk/src/DocuSign.Monitor/DocuSign.Monitor.csproj +++ b/sdk/src/DocuSign.Monitor/DocuSign.Monitor.csproj @@ -7,7 +7,7 @@ The DocuSign NuGet package makes integrating DocuSign into your apps and websites a super fast and painless process. The library is open sourced on GitHub, look for the docusign-monitor-csharp-client repository. DocuSign Inc. DocuSign - Copyright © DocuSign 2023 + Copyright © DocuSign 2024 DocuSign.Monitor DocuSign Library @@ -16,7 +16,7 @@ DocuSign.Monitor DocuSign.Monitor en-US - 1.2.0 + 2.0.0-rc1 true true @@ -26,7 +26,7 @@ https://github.com/docusign/docusign-csharp-client/blob/master/LICENSE https://github.com/docusign/docusign-csharp-client git - [v1.2.0] - Monitor API v2.0-2.0.0 - 6/14/2023 + [v2.0.0-rc1] - Monitor API v2.0-2.0.0 - 4/5/2024 NET462 @@ -38,12 +38,12 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/sdk/src/DocuSign.Monitor/Model/CursoredResult.cs b/sdk/src/DocuSign.Monitor/Model/CursoredResult.cs index 41169d4..ef47c4f 100644 --- a/sdk/src/DocuSign.Monitor/Model/CursoredResult.cs +++ b/sdk/src/DocuSign.Monitor/Model/CursoredResult.cs @@ -9,18 +9,15 @@ */ using System; -using System.Linq; +using System.Collections.Generic; using System.IO; +using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = DocuSign.Monitor.Client.SwaggerDateConverter; namespace DocuSign.Monitor.Model { diff --git a/sdk/src/DocuSign.Monitor/Model/DataSet.cs b/sdk/src/DocuSign.Monitor/Model/DataSet.cs index 47e6171..f9d4a5f 100644 --- a/sdk/src/DocuSign.Monitor/Model/DataSet.cs +++ b/sdk/src/DocuSign.Monitor/Model/DataSet.cs @@ -9,18 +9,15 @@ */ using System; -using System.Linq; +using System.Collections.Generic; using System.IO; +using System.Linq; +using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = DocuSign.Monitor.Client.SwaggerDateConverter; namespace DocuSign.Monitor.Model { diff --git a/sdk/src/DocuSign.Monitor/Properties/AssemblyInfo.cs b/sdk/src/DocuSign.Monitor/Properties/AssemblyInfo.cs index 1f38512..116e725 100644 --- a/sdk/src/DocuSign.Monitor/Properties/AssemblyInfo.cs +++ b/sdk/src/DocuSign.Monitor/Properties/AssemblyInfo.cs @@ -22,5 +22,5 @@ // [assembly: AssemblyVersion("1.0.*")] internal class AssemblyInformation { - public const string AssemblyInformationalVersion = "1.2.0"; + public const string AssemblyInformationalVersion = "2.0.0-rc1"; } \ No newline at end of file diff --git a/sdk/src/DocuSign.Monitor/packages.config b/sdk/src/DocuSign.Monitor/packages.config deleted file mode 100644 index bc8a491..0000000 --- a/sdk/src/DocuSign.Monitor/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/test/SdkNetCoreTests/JwtAuthUnitTests.cs b/test/SdkNetCoreTests/JwtAuthUnitTests.cs index c865307..61475d5 100644 --- a/test/SdkNetCoreTests/JwtAuthUnitTests.cs +++ b/test/SdkNetCoreTests/JwtAuthUnitTests.cs @@ -17,8 +17,8 @@ public class JwtAuthNetCoreTests [TestMethod] public void JwtLoginTest() { - testConfig.ApiClient = new ApiClient(testConfig.Host); - + testConfig.ApiClient = new DocuSignClient(testConfig.Host); + testConfig.ApiClient.SetOAuthBasePath(testConfig.OAuthBasePath); Assert.IsNotNull(testConfig.PrivateKey); byte[] privateKeyStream = Convert.FromBase64String(testConfig.PrivateKey); @@ -34,7 +34,8 @@ public void JwtLoginTest() // the authentication api uses the apiClient (and X-DocuSign-Authentication header) that are set in Configuration object // for testing purposes, we have to connect using a different host than we do for authentication and other monitor tests - ApiClient userInfoApiClient = new ApiClient(testConfig.UserInfoHost); + DocuSignClient userInfoApiClient = new DocuSignClient(testConfig.UserInfoHost); + userInfoApiClient.SetOAuthBasePath(testConfig.OAuthBasePath); OAuth.UserInfo userInfo = userInfoApiClient.GetUserInfo(tokenInfo.access_token); Assert.IsNotNull(userInfo); diff --git a/test/SdkNetCoreTests/SdkNetCoreTests.csproj b/test/SdkNetCoreTests/SdkNetCoreTests.csproj index 56c4d56..d2d4282 100644 --- a/test/SdkNetCoreTests/SdkNetCoreTests.csproj +++ b/test/SdkNetCoreTests/SdkNetCoreTests.csproj @@ -1,32 +1,29 @@  - - netcoreapp2.0 + + netcoreapp2.0 - false - + false + - - - - - - + + + + + - - - - - - - - - + + + + + + + - - - ..\..\sdk\src\DocuSign.Monitor\bin\Debug\netstandard2.0\DocuSign.Monitor.dll - - + + + ..\..\sdk\src\DocuSign.Monitor\bin\Debug\netstandard2.0\DocuSign.Monitor.dll + + diff --git a/test/SdkNetCoreTests/TestConfig.cs b/test/SdkNetCoreTests/TestConfig.cs index 0a0c7eb..d2246a6 100644 --- a/test/SdkNetCoreTests/TestConfig.cs +++ b/test/SdkNetCoreTests/TestConfig.cs @@ -11,7 +11,7 @@ class TestConfig public string UserInfoHost { get; set; } - public ApiClient ApiClient { get; set; } + public DocuSignClient ApiClient { get; set; } public string AccountId { get; set; } @@ -35,7 +35,7 @@ public TestConfig(string integratorKey = null, string host = null, string recipi string integratorKeyFromEnv = Environment.GetEnvironmentVariable("integratorkey"); this.Host = host ?? "https://lens-d.docusign.net"; - this.UserInfoHost = userInfoHost ?? "https://demo.docusign.net"; + this.UserInfoHost = userInfoHost ?? "https://lens-d.docusign.net"; this.IntegratorKey = (integratorKey != null) ? integratorKey : integratorKeyFromEnv; this.RecipientEmail = (recipientEmail != null) ? recipientEmail : "docusignsdktest@mailinator.com"; diff --git a/test/SdkTests/JwtAuthUnitTests.cs b/test/SdkTests/JwtAuthUnitTests.cs index 675c0f3..5736d30 100644 --- a/test/SdkTests/JwtAuthUnitTests.cs +++ b/test/SdkTests/JwtAuthUnitTests.cs @@ -17,7 +17,8 @@ public class JwtAuthUnitTests [TestMethod] public void JwtLoginTest() { - testConfig.ApiClient = new ApiClient(testConfig.Host); + testConfig.ApiClient = new DocuSignClient(testConfig.Host); + testConfig.ApiClient.SetOAuthBasePath(testConfig.OAuthBasePath); Assert.IsNotNull(testConfig.PrivateKey); @@ -34,7 +35,8 @@ public void JwtLoginTest() // the authentication api uses the apiClient (and X-DocuSign-Authentication header) that are set in Configuration object // for testing purposes, we have to connect using a different host than we do for authentication and other monitor tests - ApiClient userInfoApiClient = new ApiClient(testConfig.UserInfoHost); + DocuSignClient userInfoApiClient = new DocuSignClient(testConfig.UserInfoHost); + userInfoApiClient.SetOAuthBasePath(testConfig.OAuthBasePath); OAuth.UserInfo userInfo = userInfoApiClient.GetUserInfo(tokenInfo.access_token); Assert.IsNotNull(userInfo); diff --git a/test/SdkTests/SdkTests.csproj b/test/SdkTests/SdkTests.csproj index 98df3f8..b028e75 100644 --- a/test/SdkTests/SdkTests.csproj +++ b/test/SdkTests/SdkTests.csproj @@ -43,23 +43,29 @@ - ..\packages\BouncyCastle.Cryptography.2.2.1\lib\net461\BouncyCastle.Cryptography.dll + ..\packages\BouncyCastle.Cryptography.2.3.0\lib\net461\BouncyCastle.Cryptography.dll ..\..\sdk\src\DocuSign.Monitor\bin\Debug\net462\DocuSign.Monitor.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + - - ..\packages\Microsoft.IdentityModel.JsonWebTokens.5.4.0\lib\net461\Microsoft.IdentityModel.JsonWebTokens.dll + + ..\packages\Microsoft.IdentityModel.Abstractions.7.3.1\lib\net472\Microsoft.IdentityModel.Abstractions.dll + + + ..\packages\Microsoft.IdentityModel.JsonWebTokens.7.3.1\lib\net472\Microsoft.IdentityModel.JsonWebTokens.dll - - ..\packages\Microsoft.IdentityModel.Logging.5.4.0\lib\net461\Microsoft.IdentityModel.Logging.dll + + ..\packages\Microsoft.IdentityModel.Logging.7.3.1\lib\net472\Microsoft.IdentityModel.Logging.dll - - ..\..\sdk\src\DocuSign.Monitor\bin\Debug\net452\Microsoft.IdentityModel.Protocols.dll + + ..\packages\Microsoft.IdentityModel.Protocols.7.3.1\lib\net472\Microsoft.IdentityModel.Protocols.dll - - ..\packages\Microsoft.IdentityModel.Tokens.5.4.0\lib\net461\Microsoft.IdentityModel.Tokens.dll + + ..\packages\Microsoft.IdentityModel.Tokens.7.3.1\lib\net472\Microsoft.IdentityModel.Tokens.dll ..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll @@ -74,16 +80,42 @@ ..\packages\RestSharp.106.12.0\lib\net452\RestSharp.dll + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + - ..\packages\System.ComponentModel.Annotations.4.5.0\lib\net461\System.ComponentModel.Annotations.dll + ..\packages\System.ComponentModel.Annotations.5.0.0\lib\net461\System.ComponentModel.Annotations.dll - - ..\packages\System.IdentityModel.Tokens.Jwt.5.4.0\lib\net461\System.IdentityModel.Tokens.Jwt.dll + + ..\packages\System.IdentityModel.Tokens.Jwt.7.3.1\lib\net472\System.IdentityModel.Tokens.Jwt.dll + + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Text.Encodings.Web.4.7.2\lib\net461\System.Text.Encodings.Web.dll + + + ..\packages\System.Text.Json.4.7.2\lib\net461\System.Text.Json.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + diff --git a/test/SdkTests/TestConfig.cs b/test/SdkTests/TestConfig.cs index cec1a43..08ff8bf 100644 --- a/test/SdkTests/TestConfig.cs +++ b/test/SdkTests/TestConfig.cs @@ -11,7 +11,7 @@ class TestConfig public string UserInfoHost { get; set; } - public ApiClient ApiClient { get; set; } + public DocuSignClient ApiClient { get; set; } public string AccountId { get; set; } @@ -35,7 +35,7 @@ public TestConfig(string integratorKey = null, string host = null, string recipi string integratorKeyFromEnv = Environment.GetEnvironmentVariable("integratorkey"); this.Host = host ?? "https://lens-d.docusign.net"; - this.UserInfoHost = userInfoHost ?? "https://demo.docusign.net"; + this.UserInfoHost = userInfoHost ?? "https://lens-d.docusign.net"; this.IntegratorKey = (integratorKey != null) ? integratorKey : integratorKeyFromEnv; this.RecipientEmail = (recipientEmail != null) ? recipientEmail : "docusignsdktest@mailinator.com"; diff --git a/test/SdkTests/app.config b/test/SdkTests/app.config index 9d3046c..f673240 100644 --- a/test/SdkTests/app.config +++ b/test/SdkTests/app.config @@ -14,6 +14,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/SdkTests/packages.config b/test/SdkTests/packages.config index a4d4fd4..f48f458 100644 --- a/test/SdkTests/packages.config +++ b/test/SdkTests/packages.config @@ -1,15 +1,25 @@  - - - - - - + + + + + + + + - - + + + + + + + + + + \ No newline at end of file