Skip to content

Commit 5fcefb9

Browse files
committed
fix: version
1 parent 54ce2b8 commit 5fcefb9

File tree

8 files changed

+15
-47
lines changed

8 files changed

+15
-47
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,5 +397,5 @@ Thumbs.db
397397

398398
# Project specific
399399
*.DotSettings
400-
.GetSecure.sln
400+
GetSecure.sln
401401
tools/

GetSecure.sln

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/GetSecure.CLI/GetSecure.CLI.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
2323
<Deterministic>true</Deterministic>
2424
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
25+
<Version>1.0.1</Version>
2526
</PropertyGroup>
2627

2728
<ItemGroup>

src/GetSecure.CLI/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static async Task<int> Main(string[] args)
1515

1616
// Create the secure command
1717
var secureCommand = new Command("secure", "Create a secure link");
18-
18+
1919
// Add arguments
2020
var baseLinkArgument = new Argument<string>("baseLink", "Base URL to secure");
2121
var secretArgument = new Argument<string>("secret", "Secret string shared with web server");
@@ -45,10 +45,10 @@ public static async Task<int> Main(string[] args)
4545

4646
// Create the validate command
4747
var validateCommand = new Command("validate", "Validate a secure link");
48-
48+
4949
var linkArgument = new Argument<string>("link", "Secure link to validate");
5050
var validateSecretArgument = new Argument<string>("secret", "Secret string shared with web server");
51-
51+
5252
validateCommand.AddArgument(linkArgument);
5353
validateCommand.AddArgument(validateSecretArgument);
5454

src/GetSecure.Core/GetSecure.Core.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
2222
<Deterministic>true</Deterministic>
2323
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
24+
<Version>1.0.1</Version>
2425
</PropertyGroup>
2526

2627
<ItemGroup>

src/GetSecure.Core/SecureLink.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static string CreateSecureLink(string baseLink, string secret, int period
2222
{
2323
if (string.IsNullOrWhiteSpace(baseLink))
2424
throw new ArgumentException("Base link cannot be null or empty", nameof(baseLink));
25-
25+
2626
if (string.IsNullOrWhiteSpace(secret))
2727
throw new ArgumentException("Secret cannot be null or empty", nameof(secret));
2828

@@ -42,7 +42,7 @@ public static string CreateSecureLink(string baseLink, string secret, int period
4242
// Generate SHA256 hash
4343
using var sha256 = SHA256.Create();
4444
var hashBytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(hashString));
45-
45+
4646
// Convert to base64url encoding (compatible with nginx)
4747
var protectionString = Convert.ToBase64String(hashBytes)
4848
.Replace('+', '-')
@@ -69,15 +69,15 @@ public static bool ValidateSecureLink(string secureLink, string secret)
6969
{
7070
var uri = new Uri(secureLink);
7171
var query = ParseQueryString(uri.Query);
72-
72+
7373
var expiresStr = query.GetValueOrDefault("expires");
7474
var hash = query.GetValueOrDefault("sha256");
7575

7676
if (string.IsNullOrEmpty(expiresStr) || string.IsNullOrEmpty(hash))
7777
return false;
7878

7979
// Check if expired
80-
if (!long.TryParse(expiresStr, out var expires) ||
80+
if (!long.TryParse(expiresStr, out var expires) ||
8181
DateTimeOffset.UtcNow.ToUnixTimeSeconds() > expires)
8282
return false;
8383

@@ -108,7 +108,7 @@ public static bool ValidateSecureLink(string secureLink, string secret)
108108
private static Dictionary<string, string> ParseQueryString(string queryString)
109109
{
110110
var result = new Dictionary<string, string>();
111-
111+
112112
if (string.IsNullOrEmpty(queryString))
113113
return result;
114114

@@ -117,7 +117,7 @@ private static Dictionary<string, string> ParseQueryString(string queryString)
117117
queryString = queryString.Substring(1);
118118

119119
var pairs = queryString.Split('&', StringSplitOptions.RemoveEmptyEntries);
120-
120+
121121
foreach (var pair in pairs)
122122
{
123123
var keyValue = pair.Split('=', 2);

tests/GetSecure.CLI.Tests/GetSecure.CLI.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
</ItemGroup>
3434

3535
<ItemGroup>
36-
<ProjectReference Include="..\..\sdk\GetSecure.CLI\GetSecure.CLI.csproj" />
37-
<ProjectReference Include="..\..\sdk\GetSecure.Core\GetSecure.Core.csproj" />
36+
<ProjectReference Include="..\..\src\GetSecure.CLI\GetSecure.CLI.csproj" />
37+
<ProjectReference Include="..\..\src\GetSecure.Core\GetSecure.Core.csproj" />
3838
</ItemGroup>
3939

4040
</Project>

tests/GetSecure.Core.Tests/GetSecure.Core.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</ItemGroup>
3333

3434
<ItemGroup>
35-
<ProjectReference Include="..\..\sdk\GetSecure.Core\GetSecure.Core.csproj" />
35+
<ProjectReference Include="..\..\src\GetSecure.Core\GetSecure.Core.csproj" />
3636
</ItemGroup>
3737

3838
</Project>

0 commit comments

Comments
 (0)