-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implemented ResetPassword Tokens
- Loading branch information
1 parent
d9fcc33
commit 7bd365c
Showing
23 changed files
with
4,837 additions
and
467 deletions.
There are no files selected for viewing
3,172 changes: 2,971 additions & 201 deletions
3,172
...ices.IdentityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.cs
Large diffs are not rendered by default.
Oops, something went wrong.
1,535 changes: 1,419 additions & 116 deletions
1,535
...ntityMicroservice.Clients/Connected Services/IdentityGeneratedServices/OpenAPI.nswag.json
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
<Platforms>AnyCPU;x64;x86</Platforms> | ||
<Authors>EasyMicroservices</Authors> | ||
<IsPackable>true</IsPackable> | ||
<Version>0.0.0.6</Version> | ||
<Version>0.0.0.7</Version> | ||
<Description>client generated code.</Description> | ||
<Copyright>[email protected]</Copyright> | ||
<PackageTags>microservice,Identity,Identity,client</PackageTags> | ||
|
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
15 changes: 15 additions & 0 deletions
15
...Microservices.IdentityMicroservice.Database/Database/Entities/ResetPasswordTokenEntity.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using EasyMicroservices.Cores.Interfaces; | ||
using EasyMicroservices.IdentityMicroservice.Database.Schemas; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace EasyMicroservices.IdentityMicroservice.Database.Entities | ||
{ | ||
public class ResetPasswordTokenEntity : ResetPasswordTokenSchema, IIdSchema<long> | ||
{ | ||
public long Id { get; set; } | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...yMicroservices.IdentityMicroservice.Database/Database/Schemas/ResetPasswordTokenSchema.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using EasyMicroservices.Cores.Database.Schemas; | ||
using EasyMicroservices.Cores.Interfaces; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace EasyMicroservices.IdentityMicroservice.Database.Schemas | ||
{ | ||
public class ResetPasswordTokenSchema : FullAbilitySchema | ||
{ | ||
public string Token { get; set; } | ||
public bool HasConsumed { get; set; } | ||
public DateTime ExpirationDateTime { get; set; } | ||
} | ||
} |
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
78 changes: 78 additions & 0 deletions
78
...ntityMicroservice.Database/Migrations/20240225190050_AddedResetPasswordTokens.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
67 changes: 67 additions & 0 deletions
67
...vices.IdentityMicroservice.Database/Migrations/20240225190050_AddedResetPasswordTokens.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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace EasyMicroservices.IdentityMicroservice.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddedResetPasswordTokens : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "ResetPasswordToken", | ||
columns: table => new | ||
{ | ||
Id = table.Column<long>(type: "bigint", nullable: false) | ||
.Annotation("SqlServer:Identity", "1, 1"), | ||
CreationDateTime = table.Column<DateTime>(type: "datetime2", nullable: false), | ||
ModificationDateTime = table.Column<DateTime>(type: "datetime2", nullable: true), | ||
IsDeleted = table.Column<bool>(type: "bit", nullable: false), | ||
DeletedDateTime = table.Column<DateTime>(type: "datetime2", nullable: true), | ||
UniqueIdentity = table.Column<string>(type: "nvarchar(450)", nullable: true, collation: "SQL_Latin1_General_CP1_CS_AS"), | ||
Token = table.Column<string>(type: "nvarchar(max)", nullable: true), | ||
HasConsumed = table.Column<bool>(type: "bit", nullable: false), | ||
ExpirationDateTime = table.Column<DateTime>(type: "datetime2", nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_ResetPasswordToken", x => x.Id); | ||
}); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_ResetPasswordToken_CreationDateTime", | ||
table: "ResetPasswordToken", | ||
column: "CreationDateTime"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_ResetPasswordToken_DeletedDateTime", | ||
table: "ResetPasswordToken", | ||
column: "DeletedDateTime"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_ResetPasswordToken_IsDeleted", | ||
table: "ResetPasswordToken", | ||
column: "IsDeleted"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_ResetPasswordToken_ModificationDateTime", | ||
table: "ResetPasswordToken", | ||
column: "ModificationDateTime"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_ResetPasswordToken_UniqueIdentity", | ||
table: "ResetPasswordToken", | ||
column: "UniqueIdentity"); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "ResetPasswordToken"); | ||
} | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
...asyMicroservices.IdentityMicroservice.Database/Migrations/IdentityContextModelSnapshot.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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// <auto-generated /> | ||
using System; | ||
using EasyMicroservices.IdentityMicroservice.Database.Contexts; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | ||
|
||
#nullable disable | ||
|
||
namespace EasyMicroservices.IdentityMicroservice.Migrations | ||
{ | ||
[DbContext(typeof(IdentityContext))] | ||
partial class IdentityContextModelSnapshot : ModelSnapshot | ||
{ | ||
protected override void BuildModel(ModelBuilder modelBuilder) | ||
{ | ||
#pragma warning disable 612, 618 | ||
modelBuilder | ||
.HasAnnotation("ProductVersion", "7.0.15") | ||
.HasAnnotation("Relational:MaxIdentifierLength", 128); | ||
|
||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); | ||
|
||
modelBuilder.Entity("EasyMicroservices.IdentityMicroservice.Database.Entities.ResetPasswordTokenEntity", b => | ||
{ | ||
b.Property<long>("Id") | ||
.ValueGeneratedOnAdd() | ||
.HasColumnType("bigint"); | ||
|
||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id")); | ||
|
||
b.Property<DateTime>("CreationDateTime") | ||
.HasColumnType("datetime2"); | ||
|
||
b.Property<DateTime?>("DeletedDateTime") | ||
.HasColumnType("datetime2"); | ||
|
||
b.Property<DateTime>("ExpirationDateTime") | ||
.HasColumnType("datetime2"); | ||
|
||
b.Property<bool>("HasConsumed") | ||
.HasColumnType("bit"); | ||
|
||
b.Property<bool>("IsDeleted") | ||
.HasColumnType("bit"); | ||
|
||
b.Property<DateTime?>("ModificationDateTime") | ||
.HasColumnType("datetime2"); | ||
|
||
b.Property<string>("Token") | ||
.HasColumnType("nvarchar(max)"); | ||
|
||
b.Property<string>("UniqueIdentity") | ||
.HasColumnType("nvarchar(450)") | ||
.UseCollation("SQL_Latin1_General_CP1_CS_AS"); | ||
|
||
b.HasKey("Id"); | ||
|
||
b.HasIndex("CreationDateTime"); | ||
|
||
b.HasIndex("DeletedDateTime"); | ||
|
||
b.HasIndex("IsDeleted"); | ||
|
||
b.HasIndex("ModificationDateTime"); | ||
|
||
b.HasIndex("UniqueIdentity"); | ||
|
||
b.ToTable("ResetPasswordToken"); | ||
}); | ||
#pragma warning restore 612, 618 | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...yMicroservices.IdentityMicroservice.Domain/Contracts/Common/ResetPasswordTokenContract.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace EasyMicroservices.IdentityMicroservice.Contracts.Common | ||
{ | ||
public class ResetPasswordTokenContract | ||
{ | ||
public long Id { get; set; } | ||
public string Token { get; set; } | ||
public string UniqueIdentity { get; set; } | ||
public bool HasConsumed { get; set; } | ||
public DateTime ExpirationDateTime { get; set; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...dentityMicroservice.Domain/Contracts/Requests/ConsumeResetPasswordTokenRequestContract.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace EasyMicroservices.IdentityMicroservice.Contracts.Requests | ||
{ | ||
public class ConsumeResetPasswordTokenRequestContract | ||
{ | ||
public string Token { get; set; } | ||
public string Password { get; set; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...entityMicroservice.Domain/Contracts/Requests/GenerateResetPasswordTokenRequestContract.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace EasyMicroservices.IdentityMicroservice.Contracts.Requests | ||
{ | ||
public class GenerateResetPasswordTokenRequestContract | ||
{ | ||
public long ExpireTimeInSeconds { get; set; } | ||
public string UniqueIdentity { get; set; } | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...entityMicroservice.Domain/Contracts/Requests/ValidateResetPasswordTokenRequestContract.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace EasyMicroservices.IdentityMicroservice.Contracts.Requests | ||
{ | ||
public class ValidateResetPasswordTokenRequestContract | ||
{ | ||
public string Token { get; set; } | ||
} | ||
} |
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
Oops, something went wrong.