refact and login
This commit is contained in:
parent
acc34aeee4
commit
e042e34bf7
78 changed files with 2492 additions and 50576 deletions
|
|
@ -1,46 +1,54 @@
|
|||
using IdentityServer8.EntityFramework.DbContexts;
|
||||
using IdentityServer8.EntityFramework.Entities;
|
||||
using IdentityServer8.EntityFramework.Stores;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Yavsc.Helpers;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Auth;
|
||||
using Yavsc.Server.Helpers;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
[Authorize("AdministratorOnly")]
|
||||
public class ClientController : Controller
|
||||
{
|
||||
private readonly ConfigurationDbContext _context;
|
||||
private readonly ApplicationDbContext context;
|
||||
private readonly ClientStore clientStore;
|
||||
|
||||
public ClientController(ConfigurationDbContext context)
|
||||
public ClientController(ApplicationDbContext context,
|
||||
ClientStore clientStore,
|
||||
|
||||
IdentityServer8.Stores.ValidatingClientStore<ClientStore> validatingClientStore
|
||||
|
||||
|
||||
)
|
||||
{
|
||||
_context = context;
|
||||
this.context = context;
|
||||
this.clientStore = clientStore;
|
||||
}
|
||||
|
||||
// GET: Client
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
return View(await _context.Clients.Include(c=>c.AllowedGrantTypes)
|
||||
.Include(c=>c.RedirectUris).ToListAsync());
|
||||
return View(await context.Clients.Include(c => c.AllowedGrantTypes)
|
||||
.Include(c => c.RedirectUris).ToListAsync());
|
||||
}
|
||||
|
||||
// GET: Client/Details/5
|
||||
public async Task<IActionResult> Details(string id)
|
||||
public async Task<IActionResult> Details(int id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
Client client = await _context.Clients.Include(
|
||||
Client client = await context.Clients.Include(
|
||||
c => c.ClientSecrets
|
||||
).Include(c=>c.AllowedGrantTypes)
|
||||
.Include(c=>c.RedirectUris)
|
||||
.SingleAsync(m => m.ClientId == id);
|
||||
).Include(c => c.AllowedGrantTypes)
|
||||
.Include(c => c.RedirectUris)
|
||||
.Include(c=>c.ClientSecrets)
|
||||
.Include(c=>c.AllowedCorsOrigins)
|
||||
.Include(c=>c.AllowedScopes)
|
||||
.Include(c=>c.IdentityProviderRestrictions)
|
||||
.Include(c=>c.PostLogoutRedirectUris)
|
||||
.SingleAsync(m => m.Id == id);
|
||||
if (client == null)
|
||||
{
|
||||
return NotFound();
|
||||
|
|
@ -51,6 +59,8 @@ namespace Yavsc.Controllers
|
|||
// GET: Client/Create
|
||||
public IActionResult Create()
|
||||
{
|
||||
Secret s;
|
||||
|
||||
SetAppTypesInputValues();
|
||||
return View();
|
||||
}
|
||||
|
|
@ -62,15 +72,30 @@ namespace Yavsc.Controllers
|
|||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(client.ClientId))
|
||||
client.ClientId = Guid.NewGuid().ToString();
|
||||
_context.Clients.Add(client);
|
||||
await _context.SaveChangesAsync();
|
||||
var model = await clientStore.FindClientByIdAsync(client.ClientId);
|
||||
if (model != null)
|
||||
{
|
||||
ModelState.AddModelError("ClientId", "existent");
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
|
||||
context.Clients.Add(client);
|
||||
if (client.ClientSecrets != null)
|
||||
{
|
||||
foreach (var secret in client.ClientSecrets)
|
||||
{
|
||||
context.ClientSecrets.Add(secret);
|
||||
}
|
||||
}
|
||||
await context.SaveChangesAsync();
|
||||
|
||||
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
SetAppTypesInputValues();
|
||||
return View(client);
|
||||
}
|
||||
|
||||
private void SetAppTypesInputValues()
|
||||
{
|
||||
IEnumerable<SelectListItem> types = new SelectListItem[] {
|
||||
|
|
@ -85,14 +110,9 @@ namespace Yavsc.Controllers
|
|||
ViewData["AccessTokenType"] = types;
|
||||
}
|
||||
// GET: Client/Edit/5
|
||||
public async Task<IActionResult> Edit(string id)
|
||||
public async Task<IActionResult> Edit(int id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
Client client = await _context.Clients.SingleAsync(m => m.ClientId == id);
|
||||
Client client = await context.Clients.SingleOrDefaultAsync(m => m.Id == id);
|
||||
if (client == null)
|
||||
{
|
||||
return NotFound();
|
||||
|
|
@ -108,8 +128,16 @@ namespace Yavsc.Controllers
|
|||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Update(client);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
if (client.ClientSecrets != null)
|
||||
{
|
||||
foreach (var secret in client.ClientSecrets)
|
||||
{
|
||||
context.Update(secret);
|
||||
}
|
||||
}
|
||||
context.Update(client);
|
||||
await context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
return View(client);
|
||||
|
|
@ -117,14 +145,10 @@ namespace Yavsc.Controllers
|
|||
|
||||
// GET: Client/Delete/5
|
||||
[ActionName("Delete")]
|
||||
public async Task<IActionResult> Delete(string id)
|
||||
public async Task<IActionResult> Delete(int id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
Client client = await _context.Clients.SingleAsync(m => m.ClientId == id);
|
||||
Client client = await context.Clients.SingleOrDefaultAsync(m => m.Id == id);
|
||||
if (client == null)
|
||||
{
|
||||
return NotFound();
|
||||
|
|
@ -136,11 +160,13 @@ namespace Yavsc.Controllers
|
|||
// POST: Client/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(string id)
|
||||
public async Task<IActionResult> DeleteConfirmed(int id)
|
||||
{
|
||||
Client client = await _context.Clients.SingleAsync(m => m.ClientId == id);
|
||||
_context.Clients.Remove(client);
|
||||
await _context.SaveChangesAsync();
|
||||
Client client = await context.Clients
|
||||
.Include(client => client.ClientSecrets)
|
||||
.SingleAsync(m => m.Id == id);
|
||||
context.Clients.Remove(client);
|
||||
await context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ using IdentityServer8.EntityFramework.Stores;
|
|||
using IdentityServer8.EntityFramework.Services;
|
||||
using IdentityServer8.EntityFramework.Interfaces;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using IdentityServer8.Validation;
|
||||
|
||||
namespace Yavsc.Extensions;
|
||||
|
||||
|
|
@ -103,7 +104,8 @@ public static class HostingExtensions
|
|||
.AddTransient<IBillingService, BillingService>()
|
||||
.AddTransient<IDataStore, FileDataStore>((sp) => new FileDataStore("googledatastore", false))
|
||||
.AddTransient<ICalendarManager, CalendarManager>()
|
||||
.AddTransient<BlogSpotService>();
|
||||
.AddTransient<BlogSpotService>()
|
||||
.AddTransient<ValidatingClientStore<ClientStore>>();
|
||||
|
||||
// TODO for SMS: services.AddTransient<ISmsSender, AuthMessageSender>();
|
||||
|
||||
|
|
@ -280,6 +282,7 @@ public static class HostingExtensions
|
|||
})
|
||||
.AddAspNetIdentity<ApplicationUser>()
|
||||
.AddClientStore<ClientStore>()
|
||||
.AddClientConfigurationValidator<DefaultClientConfigurationValidator>()
|
||||
.AddCorsPolicyService<CorsPolicyService>()
|
||||
.AddResourceStore<ResourceStore>()
|
||||
.AddConfigurationStore(options =>
|
||||
|
|
@ -395,6 +398,7 @@ public static class HostingExtensions
|
|||
app.UseSession();
|
||||
return app;
|
||||
}
|
||||
|
||||
private static void MigrateDatabase(this IApplicationBuilder app)
|
||||
{
|
||||
using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope())
|
||||
|
|
@ -404,8 +408,6 @@ public static class HostingExtensions
|
|||
{
|
||||
foreach (Type contextType in new Type[]
|
||||
{
|
||||
typeof(PersistedGrantDbContext),
|
||||
typeof(ConfigurationDbContext),
|
||||
typeof(ApplicationDbContext)
|
||||
})
|
||||
{
|
||||
|
|
|
|||
4291
src/Yavsc.Org/Migrations/20260209000346_init.Designer.cs
generated
4291
src/Yavsc.Org/Migrations/20260209000346_init.Designer.cs
generated
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,78 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class idResClams : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_IdentityResourceClaim_IdentityResources_IdentityResourceId",
|
||||
table: "IdentityResourceClaim");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_IdentityResourceClaim",
|
||||
table: "IdentityResourceClaim");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "IdentityResourceClaim",
|
||||
newName: "IdentityResourceClaims");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_IdentityResourceClaim_IdentityResourceId",
|
||||
table: "IdentityResourceClaims",
|
||||
newName: "IX_IdentityResourceClaims_IdentityResourceId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_IdentityResourceClaims",
|
||||
table: "IdentityResourceClaims",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityResourceClaims_IdentityResources_IdentityResourceId",
|
||||
table: "IdentityResourceClaims",
|
||||
column: "IdentityResourceId",
|
||||
principalTable: "IdentityResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_IdentityResourceClaims_IdentityResources_IdentityResourceId",
|
||||
table: "IdentityResourceClaims");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_IdentityResourceClaims",
|
||||
table: "IdentityResourceClaims");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "IdentityResourceClaims",
|
||||
newName: "IdentityResourceClaim");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_IdentityResourceClaims_IdentityResourceId",
|
||||
table: "IdentityResourceClaim",
|
||||
newName: "IX_IdentityResourceClaim_IdentityResourceId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_IdentityResourceClaim",
|
||||
table: "IdentityResourceClaim",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityResourceClaim_IdentityResources_IdentityResourceId",
|
||||
table: "IdentityResourceClaim",
|
||||
column: "IdentityResourceId",
|
||||
principalTable: "IdentityResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,78 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class IdentityResourceProperties : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_IdentityResourceProperty_IdentityResources_IdentityResource~",
|
||||
table: "IdentityResourceProperty");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_IdentityResourceProperty",
|
||||
table: "IdentityResourceProperty");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "IdentityResourceProperty",
|
||||
newName: "IdentityResourceProperties");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_IdentityResourceProperty_IdentityResourceId",
|
||||
table: "IdentityResourceProperties",
|
||||
newName: "IX_IdentityResourceProperties_IdentityResourceId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_IdentityResourceProperties",
|
||||
table: "IdentityResourceProperties",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityResourceProperties_IdentityResources_IdentityResour~",
|
||||
table: "IdentityResourceProperties",
|
||||
column: "IdentityResourceId",
|
||||
principalTable: "IdentityResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_IdentityResourceProperties_IdentityResources_IdentityResour~",
|
||||
table: "IdentityResourceProperties");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_IdentityResourceProperties",
|
||||
table: "IdentityResourceProperties");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "IdentityResourceProperties",
|
||||
newName: "IdentityResourceProperty");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_IdentityResourceProperties_IdentityResourceId",
|
||||
table: "IdentityResourceProperty",
|
||||
newName: "IX_IdentityResourceProperty_IdentityResourceId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_IdentityResourceProperty",
|
||||
table: "IdentityResourceProperty",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityResourceProperty_IdentityResources_IdentityResource~",
|
||||
table: "IdentityResourceProperty",
|
||||
column: "IdentityResourceId",
|
||||
principalTable: "IdentityResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,78 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ApiResourceSecrets : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiResourceSecret_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceSecret");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiResourceSecret",
|
||||
table: "ApiResourceSecret");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiResourceSecret",
|
||||
newName: "ApiResourceSecrets");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiResourceSecret_ApiResourceId",
|
||||
table: "ApiResourceSecrets",
|
||||
newName: "IX_ApiResourceSecrets_ApiResourceId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiResourceSecrets",
|
||||
table: "ApiResourceSecrets",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiResourceSecrets_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceSecrets",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiResourceSecrets_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceSecrets");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiResourceSecrets",
|
||||
table: "ApiResourceSecrets");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiResourceSecrets",
|
||||
newName: "ApiResourceSecret");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiResourceSecrets_ApiResourceId",
|
||||
table: "ApiResourceSecret",
|
||||
newName: "IX_ApiResourceSecret_ApiResourceId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiResourceSecret",
|
||||
table: "ApiResourceSecret",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiResourceSecret_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceSecret",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,78 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ApiResourceScopes : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiResourceScope_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceScope");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiResourceScope",
|
||||
table: "ApiResourceScope");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiResourceScope",
|
||||
newName: "ApiResourceScopes");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiResourceScope_ApiResourceId",
|
||||
table: "ApiResourceScopes",
|
||||
newName: "IX_ApiResourceScopes_ApiResourceId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiResourceScopes",
|
||||
table: "ApiResourceScopes",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiResourceScopes_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceScopes",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiResourceScopes_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceScopes");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiResourceScopes",
|
||||
table: "ApiResourceScopes");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiResourceScopes",
|
||||
newName: "ApiResourceScope");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiResourceScopes_ApiResourceId",
|
||||
table: "ApiResourceScope",
|
||||
newName: "IX_ApiResourceScope_ApiResourceId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiResourceScope",
|
||||
table: "ApiResourceScope",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiResourceScope_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceScope",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,78 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ApiResourceClaims : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiResourceClaim_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceClaim");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiResourceClaim",
|
||||
table: "ApiResourceClaim");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiResourceClaim",
|
||||
newName: "ApiResourceClaims");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiResourceClaim_ApiResourceId",
|
||||
table: "ApiResourceClaims",
|
||||
newName: "IX_ApiResourceClaims_ApiResourceId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiResourceClaims",
|
||||
table: "ApiResourceClaims",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiResourceClaims_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceClaims",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiResourceClaims_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceClaims");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiResourceClaims",
|
||||
table: "ApiResourceClaims");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiResourceClaims",
|
||||
newName: "ApiResourceClaim");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiResourceClaims_ApiResourceId",
|
||||
table: "ApiResourceClaim",
|
||||
newName: "IX_ApiResourceClaim_ApiResourceId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiResourceClaim",
|
||||
table: "ApiResourceClaim",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiResourceClaim_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceClaim",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,78 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ApiResourceProperties : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiResourceProperty_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceProperty");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiResourceProperty",
|
||||
table: "ApiResourceProperty");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiResourceProperty",
|
||||
newName: "ApiResourceProperties");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiResourceProperty_ApiResourceId",
|
||||
table: "ApiResourceProperties",
|
||||
newName: "IX_ApiResourceProperties_ApiResourceId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiResourceProperties",
|
||||
table: "ApiResourceProperties",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiResourceProperties_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceProperties",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiResourceProperties_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceProperties");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiResourceProperties",
|
||||
table: "ApiResourceProperties");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiResourceProperties",
|
||||
newName: "ApiResourceProperty");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiResourceProperties_ApiResourceId",
|
||||
table: "ApiResourceProperty",
|
||||
newName: "IX_ApiResourceProperty_ApiResourceId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiResourceProperty",
|
||||
table: "ApiResourceProperty",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiResourceProperty_ApiResources_ApiResourceId",
|
||||
table: "ApiResourceProperty",
|
||||
column: "ApiResourceId",
|
||||
principalTable: "ApiResources",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,78 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ApiScopeClaims : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiScopeClaim_ApiScopes_ScopeId",
|
||||
table: "ApiScopeClaim");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiScopeClaim",
|
||||
table: "ApiScopeClaim");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiScopeClaim",
|
||||
newName: "ApiScopeClaims");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiScopeClaim_ScopeId",
|
||||
table: "ApiScopeClaims",
|
||||
newName: "IX_ApiScopeClaims_ScopeId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiScopeClaims",
|
||||
table: "ApiScopeClaims",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiScopeClaims_ApiScopes_ScopeId",
|
||||
table: "ApiScopeClaims",
|
||||
column: "ScopeId",
|
||||
principalTable: "ApiScopes",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiScopeClaims_ApiScopes_ScopeId",
|
||||
table: "ApiScopeClaims");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiScopeClaims",
|
||||
table: "ApiScopeClaims");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiScopeClaims",
|
||||
newName: "ApiScopeClaim");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiScopeClaims_ScopeId",
|
||||
table: "ApiScopeClaim",
|
||||
newName: "IX_ApiScopeClaim_ScopeId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiScopeClaim",
|
||||
table: "ApiScopeClaim",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiScopeClaim_ApiScopes_ScopeId",
|
||||
table: "ApiScopeClaim",
|
||||
column: "ScopeId",
|
||||
principalTable: "ApiScopes",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,78 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ApiScopeProperties : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiScopeProperty_ApiScopes_ScopeId",
|
||||
table: "ApiScopeProperty");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiScopeProperty",
|
||||
table: "ApiScopeProperty");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiScopeProperty",
|
||||
newName: "ApiScopeProperties");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiScopeProperty_ScopeId",
|
||||
table: "ApiScopeProperties",
|
||||
newName: "IX_ApiScopeProperties_ScopeId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiScopeProperties",
|
||||
table: "ApiScopeProperties",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiScopeProperties_ApiScopes_ScopeId",
|
||||
table: "ApiScopeProperties",
|
||||
column: "ScopeId",
|
||||
principalTable: "ApiScopes",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ApiScopeProperties_ApiScopes_ScopeId",
|
||||
table: "ApiScopeProperties");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_ApiScopeProperties",
|
||||
table: "ApiScopeProperties");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "ApiScopeProperties",
|
||||
newName: "ApiScopeProperty");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_ApiScopeProperties_ScopeId",
|
||||
table: "ApiScopeProperty",
|
||||
newName: "IX_ApiScopeProperty_ScopeId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_ApiScopeProperty",
|
||||
table: "ApiScopeProperty",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ApiScopeProperty_ApiScopes_ScopeId",
|
||||
table: "ApiScopeProperty",
|
||||
column: "ScopeId",
|
||||
principalTable: "ApiScopes",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class article : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Content",
|
||||
table: "Comment",
|
||||
newName: "Article");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Content",
|
||||
table: "BlogSpot",
|
||||
newName: "Article");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MusicalPreference_TendencyId",
|
||||
table: "MusicalPreference",
|
||||
column: "TendencyId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_MusicalPreference_MusicalTendency_TendencyId",
|
||||
table: "MusicalPreference",
|
||||
column: "TendencyId",
|
||||
principalTable: "MusicalTendency",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_MusicalPreference_MusicalTendency_TendencyId",
|
||||
table: "MusicalPreference");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_MusicalPreference_TendencyId",
|
||||
table: "MusicalPreference");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Article",
|
||||
table: "Comment",
|
||||
newName: "Content");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Article",
|
||||
table: "BlogSpot",
|
||||
newName: "Content");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,336 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class identityClientsCleanup : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientClaim");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientCorsOrigins");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientGrantType");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientIdPRestriction");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientPostLogoutRedirectUri");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientProperty");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientRedirectUri");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientScope");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ClientSecret");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Clients");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Clients",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
AbsoluteRefreshTokenLifetime = table.Column<int>(type: "integer", nullable: false),
|
||||
AccessTokenLifetime = table.Column<int>(type: "integer", nullable: false),
|
||||
AccessTokenType = table.Column<int>(type: "integer", nullable: false),
|
||||
AllowAccessTokensViaBrowser = table.Column<bool>(type: "boolean", nullable: false),
|
||||
AllowOfflineAccess = table.Column<bool>(type: "boolean", nullable: false),
|
||||
AllowPlainTextPkce = table.Column<bool>(type: "boolean", nullable: false),
|
||||
AllowRememberConsent = table.Column<bool>(type: "boolean", nullable: false),
|
||||
AllowedIdentityTokenSigningAlgorithms = table.Column<string>(type: "text", nullable: true),
|
||||
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(type: "boolean", nullable: false),
|
||||
AlwaysSendClientClaims = table.Column<bool>(type: "boolean", nullable: false),
|
||||
AuthorizationCodeLifetime = table.Column<int>(type: "integer", nullable: false),
|
||||
BackChannelLogoutSessionRequired = table.Column<bool>(type: "boolean", nullable: false),
|
||||
BackChannelLogoutUri = table.Column<string>(type: "text", nullable: true),
|
||||
ClientClaimsPrefix = table.Column<string>(type: "text", nullable: true),
|
||||
ClientId = table.Column<string>(type: "text", nullable: true),
|
||||
ClientName = table.Column<string>(type: "text", nullable: true),
|
||||
ClientUri = table.Column<string>(type: "text", nullable: true),
|
||||
ConsentLifetime = table.Column<int>(type: "integer", nullable: true),
|
||||
Created = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
Description = table.Column<string>(type: "text", nullable: true),
|
||||
DeviceCodeLifetime = table.Column<int>(type: "integer", nullable: false),
|
||||
EnableLocalLogin = table.Column<bool>(type: "boolean", nullable: false),
|
||||
Enabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||
FrontChannelLogoutSessionRequired = table.Column<bool>(type: "boolean", nullable: false),
|
||||
FrontChannelLogoutUri = table.Column<string>(type: "text", nullable: true),
|
||||
IdentityTokenLifetime = table.Column<int>(type: "integer", nullable: false),
|
||||
IncludeJwtId = table.Column<bool>(type: "boolean", nullable: false),
|
||||
LastAccessed = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||
LogoUri = table.Column<string>(type: "text", nullable: true),
|
||||
NonEditable = table.Column<bool>(type: "boolean", nullable: false),
|
||||
PairWiseSubjectSalt = table.Column<string>(type: "text", nullable: true),
|
||||
ProtocolType = table.Column<string>(type: "text", nullable: true),
|
||||
RefreshTokenExpiration = table.Column<int>(type: "integer", nullable: false),
|
||||
RefreshTokenUsage = table.Column<int>(type: "integer", nullable: false),
|
||||
RequireClientSecret = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RequireConsent = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RequirePkce = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RequireRequestObject = table.Column<bool>(type: "boolean", nullable: false),
|
||||
SlidingRefreshTokenLifetime = table.Column<int>(type: "integer", nullable: false),
|
||||
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(type: "boolean", nullable: false),
|
||||
Updated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||
UserCodeType = table.Column<string>(type: "text", nullable: true),
|
||||
UserSsoLifetime = table.Column<int>(type: "integer", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Clients", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientClaim",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ClientId = table.Column<int>(type: "integer", nullable: false),
|
||||
Type = table.Column<string>(type: "text", nullable: true),
|
||||
Value = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientClaim", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientClaim_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientCorsOrigins",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ClientId = table.Column<int>(type: "integer", nullable: false),
|
||||
Origin = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientCorsOrigins", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientCorsOrigins_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientGrantType",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ClientId = table.Column<int>(type: "integer", nullable: false),
|
||||
GrantType = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientGrantType", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientGrantType_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientIdPRestriction",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ClientId = table.Column<int>(type: "integer", nullable: false),
|
||||
Provider = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientIdPRestriction", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientIdPRestriction_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientPostLogoutRedirectUri",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ClientId = table.Column<int>(type: "integer", nullable: false),
|
||||
PostLogoutRedirectUri = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientPostLogoutRedirectUri", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientPostLogoutRedirectUri_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientProperty",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ClientId = table.Column<int>(type: "integer", nullable: false),
|
||||
Key = table.Column<string>(type: "text", nullable: true),
|
||||
Value = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientProperty", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientProperty_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientRedirectUri",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ClientId = table.Column<int>(type: "integer", nullable: false),
|
||||
RedirectUri = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientRedirectUri", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientRedirectUri_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientScope",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ClientId = table.Column<int>(type: "integer", nullable: false),
|
||||
Scope = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientScope", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientScope_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ClientSecret",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ClientId = table.Column<int>(type: "integer", nullable: false),
|
||||
Created = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
Description = table.Column<string>(type: "text", nullable: true),
|
||||
Expiration = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||
Type = table.Column<string>(type: "text", nullable: true),
|
||||
Value = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ClientSecret", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ClientSecret_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientClaim_ClientId",
|
||||
table: "ClientClaim",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientCorsOrigins_ClientId",
|
||||
table: "ClientCorsOrigins",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientGrantType_ClientId",
|
||||
table: "ClientGrantType",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientIdPRestriction_ClientId",
|
||||
table: "ClientIdPRestriction",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientPostLogoutRedirectUri_ClientId",
|
||||
table: "ClientPostLogoutRedirectUri",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientProperty_ClientId",
|
||||
table: "ClientProperty",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientRedirectUri_ClientId",
|
||||
table: "ClientRedirectUri",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientScope_ClientId",
|
||||
table: "ClientScope",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ClientSecret_ClientId",
|
||||
table: "ClientSecret",
|
||||
column: "ClientId");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -8,12 +8,12 @@ namespace Yavsc.ViewModels
|
|||
[Display(Name="EnroledLabel", ResourceType=typeof(EnrolerViewModel))]
|
||||
public string EnroledUserName { get; set; }
|
||||
|
||||
[YaRequired]
|
||||
[Required]
|
||||
public string EnroledUserId { get; set; }
|
||||
|
||||
|
||||
[Display(Name="RoleNameLabel", ResourceType=typeof(EnrolerViewModel))]
|
||||
[YaRequired]
|
||||
[Required]
|
||||
public string RoleName { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ namespace Yavsc.ViewModels.Gen
|
|||
public class PdfGenerationViewModel
|
||||
{
|
||||
|
||||
[YaRequired]
|
||||
[Required]
|
||||
public string TeXSource { get; set; }
|
||||
[YaRequired]
|
||||
[Required]
|
||||
public string BaseFileName { get; set; }
|
||||
[YaRequired]
|
||||
[Required]
|
||||
public string DestDir { get; set; }
|
||||
public bool Generated { get; set; }
|
||||
public HtmlString GenerationErrorMessage { get; set; }
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace Yavsc.ViewModels.Manage
|
|||
{
|
||||
public class SetFullNameViewModel
|
||||
{
|
||||
[YaRequired]
|
||||
[Required]
|
||||
[Display(Name = "Your full name"), YaStringLength(512)]
|
||||
public string FullName { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,21 @@
|
|||
@model Client
|
||||
|
||||
@{
|
||||
ViewData["Title"] = @Localizer["Create"];
|
||||
}
|
||||
|
||||
<h2>@Localizer["Create"]</h2>
|
||||
|
||||
<form asp-action="Create">
|
||||
<div class="form-horizontal">
|
||||
<h4>Client</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div asp-validation-summary="ModelOnly"
|
||||
class="text-danger"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label asp-for="ClientId" class="col-md-2 control-label"></label>
|
||||
<label asp-for="ClientId"
|
||||
class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="ClientId" class="form-control" />
|
||||
<span asp-validation-for="ClientId" class="text-danger" ></span>
|
||||
<span asp-validation-for="ClientId"
|
||||
class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
@ -28,50 +27,48 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="ClientName" class="col-md-2 control-label"></label>
|
||||
<label asp-for="ClientName"
|
||||
class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="ClientName" class="form-control" />
|
||||
<span asp-validation-for="ClientName" class="text-danger" ></span>
|
||||
<span asp-validation-for="ClientName" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="FrontChannelLogoutUri" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="FrontChannelLogoutUri" class="form-control"></span>
|
||||
<span asp-validation-for="FrontChannelLogoutUri" class="text-danger" ></span>
|
||||
<input asp-for="FrontChannelLogoutUri"
|
||||
class="form-control"></span>
|
||||
<span asp-validation-for="FrontChannelLogoutUri"
|
||||
class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="RedirectUris" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="RedirectUris" class="form-control" />
|
||||
<span asp-validation-for="RedirectUris" class="text-danger" ></span>
|
||||
<div class="form-group">
|
||||
<label asp-for="RedirectUris" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="RedirectUris" class="form-control" />
|
||||
<span asp-validation-for="RedirectUris" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="AbsoluteRefreshTokenLifetime" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="AbsoluteRefreshTokenLifetime" class="form-control" ></span>
|
||||
<span asp-validation-for="AbsoluteRefreshTokenLifetime" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="ClientSecrets" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="ClientSecrets" class="form-control" />
|
||||
<span asp-validation-for="ClientSecrets" class="text-danger" ></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="AccessTokenType" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
@Html.DropDownList("AccessTokenType")
|
||||
<span asp-validation-for="AccessTokenType" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Create" class="btn btn-default" />
|
||||
<div class="form-group">
|
||||
<label asp-for="AbsoluteRefreshTokenLifetime" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="AbsoluteRefreshTokenLifetime" class="form-control"></span>
|
||||
<span asp-validation-for="AbsoluteRefreshTokenLifetime" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="AccessTokenType" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
@Html.DropDownList("AccessTokenType")
|
||||
<span asp-validation-for="AccessTokenType" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Create" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
@model Client
|
||||
|
||||
@{
|
||||
ViewData["Title"] = @Localizer["Delete"];
|
||||
}
|
||||
|
||||
<h2>@Localizer["Delete"]</h2>
|
||||
|
||||
<h3>@Localizer["AreYourSureYouWantToDeleteThis"]</h3>
|
||||
|
|
@ -61,7 +57,7 @@
|
|||
</dd>
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
<form asp-action="Delete" asp-route-id="@Model.Id">
|
||||
<div class="form-actions no-color">
|
||||
<input type="submit" value="Delete" class="btn btn-default" /> |
|
||||
<a asp-action="Index">@Localizer["Back to List"]</a>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
@model Client
|
||||
|
||||
@{
|
||||
ViewData["Title"] = @Localizer["Details"];
|
||||
}
|
||||
|
||||
<h2>@Localizer["Details"]</h2>
|
||||
|
||||
<div>
|
||||
|
|
@ -31,7 +27,6 @@
|
|||
<dt>
|
||||
@Html.DisplayNameFor(model => model.FrontChannelLogoutUri)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.FrontChannelLogoutUri)
|
||||
</dd>
|
||||
<dt>
|
||||
|
|
@ -52,7 +47,14 @@
|
|||
<dt>
|
||||
@Html.DisplayNameFor(model => model.ClientSecrets)
|
||||
</dt>
|
||||
<dd>Count : @Model.ClientSecrets.Count</dd>
|
||||
<dd>
|
||||
<ul>
|
||||
@foreach(var secret in Model.ClientSecrets)
|
||||
{
|
||||
<li>@Html.DisplayForModel(secret)</li>
|
||||
}
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.AccessTokenType)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
@model Client
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h2>@Localizer["Edit"]</h2>
|
||||
|
||||
<form asp-action="Edit">
|
||||
|
|
@ -65,7 +61,7 @@
|
|||
<div class="form-group">
|
||||
<label asp-for="AccessTokenType" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
@Html.DropDownList("Type")
|
||||
@Html.DropDownList("AccessTokenType")
|
||||
<span asp-validation-for="AccessTokenType" class="text-danger" ></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,6 @@
|
|||
@using IdentityServer8.Models
|
||||
@model IEnumerable<IdentityServer8.EntityFramework.Entities.Client>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = @Localizer["Index"];
|
||||
}
|
||||
|
||||
<h2>@Localizer["Index"]</h2>
|
||||
|
||||
<p>
|
||||
|
|
@ -40,43 +36,48 @@
|
|||
<th></th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ClientId)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Enabled)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ClientName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.FrontChannelLogoutUri)
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
@foreach (var uri in item.RedirectUris)
|
||||
{ <li>@uri.RedirectUri</li> }
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.AbsoluteRefreshTokenLifetime)
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
@foreach (var t in item.AllowedGrantTypes)
|
||||
{ <li>@t.GrantType</li> }
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
@Enum.GetName(typeof(AccessTokenType), item.AccessTokenType)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.ClientId">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.ClientId">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.ClientId">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ClientId)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Enabled)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ClientName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.FrontChannelLogoutUri)
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
@foreach (var uri in item.RedirectUris)
|
||||
{
|
||||
<li>@uri.RedirectUri</li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.AbsoluteRefreshTokenLifetime)
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
@foreach (var t in item.AllowedGrantTypes)
|
||||
{
|
||||
<li>@t.GrantType</li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
@Enum.GetName(typeof(AccessTokenType), item.AccessTokenType)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
@model ClientSecret
|
||||
|
||||
<dl class="dl-horizontal">
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.ClientId)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.ClientId)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Created)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Created)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Expiration)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Expiration)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Description)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Description)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Type)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Type)
|
||||
</dd>
|
||||
<dt>
|
||||
@Html.DisplayNameFor(model => model.Value)
|
||||
</dt>
|
||||
<dd>
|
||||
@Html.DisplayFor(model => model.Value)
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
@model ClientSecret
|
||||
|
||||
<div class="form-group">
|
||||
<label asp-for="Description" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
@Html.EditorFor(m => m.Description)
|
||||
<span asp-validation-for="Description" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Value" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
@Html.EditorFor(m => m.Value)
|
||||
<span asp-validation-for="Value" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue