Skip to content

Commit 16e17af

Browse files
Merge pull request #162 from kolappannathan/dev
v8.0.0
2 parents e7336ce + 2aecde4 commit 16e17af

File tree

17 files changed

+65
-79
lines changed

17 files changed

+65
-79
lines changed

.vscode/spellright.dict

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ launchsettings.json
66
editorconfig
77
db
88
Serilog
9+
Bcrypt

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
44

55
## [Unreleased]
66

7+
## [8.0.0] - 2023-12-02
8+
### Added
9+
- Salt added as separate param for Bcrypt in Security lib. Previously it was indented to be already added and sent with the plain text password.
10+
- New test cases in postman
11+
12+
### Changed
13+
- Updated .NET version to 8
14+
- Moved Configurators into a separate folder to simplify Program.cs
15+
- Updated Random String Generator to use `System.Security.Cryptography.RandomNumberGenerator`.
16+
- Using updated checks for Argument exceptions
17+
- Updated dependencies
18+
19+
### Removed
20+
- Removed the random number generating function. The built-in function with RandomNumberGenerator to be used instead.
21+
722
## [7.1.0] - 2023-03-02
823
### Added
924
- Added interfaces for library classes, helper functions.

src/WebApiBolierplate/API/API.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
</PropertyGroup>
77

@@ -13,7 +13,7 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.14" />
16+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
1717
<PackageReference Include="Serilog.AspNetCore" Version="8.0.0" />
1818
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
1919
</ItemGroup>

src/WebApiBolierplate/API/Models/LoginDTO.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public LoginDTO()
99

1010
}
1111

12-
[Required(ErrorMessage = "No name. No game.")]
12+
[Required(ErrorMessage = "No name. No game.", AllowEmptyStrings = false)]
1313
public string UserName { get; set; }
1414

15-
[Required(ErrorMessage = "No password?! Are you kidding?")]
15+
[Required(ErrorMessage = "No password?! Are you kidding?", AllowEmptyStrings = false)]
1616
public string Password { get; set; }
1717
}

src/WebApiBolierplate/API/appsettings.Development.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"JWT": {
1414
"Audience": "https://www.example.com",
1515
"Issuer": "WebApiBoilerplate",
16-
"Key": "This is a JWT secret key",
16+
"Key": "JWT_keys_with_random_chars---m4sjcv46v06etirgflvcgdwixb9tg5wk5hy1mew85zcznjshivssia9mls539rsq",
1717
"HoursValid": 48
1818
}
1919
}

src/WebApiBolierplate/API/appsettings.production.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"JWT": {
1212
"Audience": "https://www.example.com",
1313
"Issuer": "WebApiBoilerplate",
14-
"Key": "This is a JWT secret key",
14+
"Key": "JWT_keys_with_random_chars---9sav3zkqd1gmgur2r7sdxqwtwvsxong36lylhdnwca3sfr5n6kqg7qpdr1nbhf1q",
1515
"HoursValid": 48
1616
}
1717
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
</PropertyGroup>
66

77
</Project>

src/WebApiBolierplate/Core.Lib/Core.Lib.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

src/WebApiBolierplate/Core.Lib/Utilities/Interfaces/IRandomUtils.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,4 @@ public interface IRandomUtils
1212
/// <returns></returns>
1313
/// <exception cref="ArgumentException"></exception>
1414
public string GenRandomChar(int length, CharSet charSet);
15-
16-
17-
/// <summary>
18-
/// Generates a random number using cryptography within the specified range
19-
/// Ref: https://stackoverflow.com/a/38669162/5407188
20-
/// </summary>
21-
/// <param name="min">minimum value for the random number</param>
22-
/// <param name="max">maximum value for the random number</param>
23-
/// <returns></returns>
24-
/// <exception cref="ArgumentException"></exception>
25-
public int GenRandomNumber(int min, int max);
2615
}

src/WebApiBolierplate/Core.Lib/Utilities/Interfaces/ISecurityUtils.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@ public interface ISecurityUtils
1515
/// Hashes the plaintext password using BCrypt and returns the hash
1616
/// </summary>
1717
/// <param name="plainText"></param>
18+
/// <param name="salt"></param>
1819
/// <returns></returns>
1920
/// <exception cref="ArgumentNullException"></exception>
2021
/// <exception cref="ArgumentException"></exception>
21-
public string HashBCrypt(string plainText);
22+
public string HashBCrypt(string plainText, string salt);
2223

2324
/// <summary>
2425
/// Verfies the hash and password with Brcypt
2526
/// </summary>
2627
/// <param name="plainText"></param>
28+
/// <param name="salt"></param>
2729
/// <param name="hash"></param>
2830
/// <returns></returns>
2931
/// <exception cref="ArgumentNullException"></exception>
3032
/// <exception cref="ArgumentException"></exception>
31-
public bool VerifyBCrypt(string plainText, string hash);
33+
public bool VerifyBCrypt(string plainText, string salt, string hash);
3234
}

0 commit comments

Comments
 (0)