Skip to content

Commit d85c80c

Browse files
authored
Add TokenUrl to Configuration (#40)
1 parent de997dc commit d85c80c

File tree

7 files changed

+11
-21
lines changed

7 files changed

+11
-21
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ all: test
33

44
.PHONY: format
55
format:
6-
find . -iname "*.cs" -exec sed -i -e 's_[[:space:]]*$$__' {} \;
76
~/.dotnet/tools/dotnet-format ./Aspose.BarCode.Cloud.Sdk.sln
7+
# Trim white space in comments
8+
find . -iname "*.cs" -exec sed -i -e 's_[[:space:]]*$$__' {} \;
89

910
.PHONY: format-doc
1011
format-doc:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![Nuget](https://img.shields.io/nuget/v/Aspose.BarCode-Cloud)](https://www.nuget.org/packages/Aspose.BarCode-Cloud/)
1010

1111
- API version: 3.0
12-
- SDK version: 22.3.0
12+
- SDK version: 22.6.0
1313

1414
## Demo applications
1515

Tests/ConfigurationTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public void DefaultParamsTest()
8282

8383
Assert.AreEqual("https://api.aspose.cloud", config.ApiBaseUrl);
8484
Assert.AreEqual("https://api.aspose.cloud/v3.0", config.GetApiRootUrl());
85+
Assert.AreEqual("https://api.aspose.cloud/connect/token", config.TokenUrl);
8586
Assert.AreEqual(false, config.DebugMode);
8687
}
8788

examples/GenerateQR/GenerateQR.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Aspose.BarCode-Cloud" Version="22.3.0" />
9+
<PackageReference Include="Aspose.BarCode-Cloud" Version="22.6.0" />
1010
</ItemGroup>
1111

1212
</Project>

examples/ReadQR/ReadQR.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Aspose.BarCode-Cloud" Version="22.3.0" />
9+
<PackageReference Include="Aspose.BarCode-Cloud" Version="22.6.0" />
1010
</ItemGroup>
1111

1212
</Project>

src/Api/Configuration.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,13 @@ namespace Aspose.BarCode.Cloud.Sdk.Api
3838
/// </summary>
3939
public class Configuration
4040
{
41-
private string _jwtToken;
42-
4341
public Configuration()
4442
{
4543
ApiBaseUrl = "https://api.aspose.cloud";
4644
DebugMode = false;
4745
ApiVersion = "3.0";
4846
AuthType = AuthType.JWT;
47+
TokenUrl = "https://api.aspose.cloud/connect/token";
4948
DefaultHeaders = new Dictionary<string, string>();
5049
}
5150

@@ -57,18 +56,7 @@ public Configuration()
5756
/// <summary>
5857
/// Aspose Cloud API auth URL.
5958
/// </summary>
60-
public string TokenUrl
61-
{
62-
get
63-
{
64-
if (!string.IsNullOrEmpty(_tokenUrl))
65-
{
66-
return _tokenUrl;
67-
}
68-
return ApiBaseUrl + "/connect/token";
69-
}
70-
set => _tokenUrl = value;
71-
}
59+
public string TokenUrl { get; set; }
7260

7361
/// <summary>
7462
/// Gets or sets the Client Secret.
@@ -128,6 +116,6 @@ public string GetApiRootUrl()
128116
return result.EndsWith("/") ? result.Substring(0, result.Length - 1) : result;
129117
}
130118

131-
private string _tokenUrl;
119+
private string _jwtToken;
132120
}
133121
}

src/Aspose.BarCode.Cloud.Sdk.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Aspose.Barcode for Cloud allows you to control all aspects of the image and barc
1818
<PackageId>Aspose.BarCode-Cloud</PackageId>
1919
<Product>Aspose.BarCode Cloud SDK for .NET</Product>
2020
<PackageIcon>PackageIcon.png</PackageIcon>
21-
<Version>22.3.0</Version>
21+
<Version>22.6.0</Version>
2222
<Authors>asposecloud</Authors>
23-
<AssemblyVersion>22.3.0.0</AssemblyVersion>
23+
<AssemblyVersion>22.6.0.0</AssemblyVersion>
2424
</PropertyGroup>
2525

2626
<ItemGroup>

0 commit comments

Comments
 (0)