-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from evgomes/net-7-update
.NET 7 Update and Code Refactoring
- Loading branch information
Showing
32 changed files
with
194 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
src/JWTAPI/JWTAPI/Controllers/Resources/RefreshTokenResource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
namespace JWTAPI.Controllers.Resources; | ||
public class RefreshTokenResource | ||
|
||
public record RefreshTokenResource | ||
{ | ||
[Required] | ||
public string Token { get; set; } | ||
public string? Token { get; init; } | ||
|
||
[Required] | ||
[EmailAddress] | ||
[StringLength(255)] | ||
public string UserEmail { get; set; } | ||
public string? UserEmail { get; init; } | ||
} |
5 changes: 3 additions & 2 deletions
5
src/JWTAPI/JWTAPI/Controllers/Resources/RevokeTokenResource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
namespace JWTAPI.Controllers.Resources; | ||
|
||
public class RevokeTokenResource | ||
{ | ||
[Required] | ||
public string Token { get; set; } | ||
public string? Token { get; init; } | ||
|
||
[Required] | ||
public string Email { get; set; } | ||
public string? Email { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
namespace JWTAPI.Controllers.Resources; | ||
|
||
public class AccessTokenResource | ||
{ | ||
public string AccessToken { get; set; } | ||
public string RefreshToken { get; set; } | ||
public long Expiration { get; set; } | ||
public string AccessToken { get; init; } = null!; | ||
public string RefreshToken { get; init; } = null!; | ||
public long Expiration { get; set; } | ||
} |
5 changes: 3 additions & 2 deletions
5
src/JWTAPI/JWTAPI/Controllers/Resources/UserCredentialsResource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
namespace JWTAPI.Controllers.Resources; | ||
|
||
public class UserCredentialsResource | ||
{ | ||
[Required] | ||
[EmailAddress] | ||
[StringLength(255)] | ||
public string Email { get; set; } | ||
public string? Email { get; init; } | ||
|
||
[Required] | ||
[StringLength(32)] | ||
public string Password { get; set; } | ||
public string? Password { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
namespace JWTAPI.Controllers.Resources; | ||
public class UserResource | ||
|
||
public record UserResource | ||
{ | ||
public int Id { get; set; } | ||
public string Email { get; set; } | ||
public IEnumerable<string> Roles { get; set; } | ||
public string Email { get; set; } = null!; | ||
public IEnumerable<string> Roles { get; set; } = new List<string>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/JWTAPI/JWTAPI/Core/Security/Tokens/RefreshTokenWithEmail.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace JWTAPI.Core.Security.Tokens; | ||
public class RefreshTokenWithEmail | ||
{ | ||
public string Email { get; set; } | ||
public RefreshToken RefreshToken { get; set; } | ||
public string Email { get; set; } = null!; | ||
public RefreshToken RefreshToken { get; set; } = null!; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/JWTAPI/JWTAPI/Core/Services/Communication/CreateUserResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/JWTAPI/JWTAPI/Core/Services/Communication/TokenResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<GenerateDocumentationFile>True</GenerateDocumentationFile> | ||
<DocumentationFile>bin\Debug\net7.0\JWTAPI.xml</DocumentationFile> | ||
<NoWarn>1591</NoWarn> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="wwwroot\" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="AutoMapper" Version="10.1.1" /> | ||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.1" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1"> | ||
<PackageReference Include="AutoMapper" Version="12.0.1" /> | ||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.8" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.8" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.8"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.1" /> | ||
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.8" /> | ||
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" /> | ||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.