Compare commits

...

6 Commits

Author SHA1 Message Date
Sumit Ghosh
38de4d5964 Updated packages to WebMVC 2021-10-20 16:06:21 +05:30
Sumit Ghosh
5448965cff Updated dockerfile 2021-10-20 16:05:45 +05:30
Sumit Ghosh
5e7de1617e Included file scope namespaces for all files 2021-10-20 16:04:59 +05:30
Sumit Ghosh
610707a5b7 Included globalusing WebMVC 2021-10-20 16:04:13 +05:30
Sumit Ghosh
ab1d9cc897
Updates basket-api to .NET 6 (#1742)
* Use global usings

* Use file-scoped namespaces

* Updates docker images to preview 7

* Created a new migration plan

* Included global usings for identity project

* Updated docker file to preview version to 7

* Updated dockerfiles

* Merged conent from Startup.cs to Program.cs

* Removed Starup.cs

* Removed unnecessary files

* Revert "Removed unnecessary files"

This reverts commit 536bddcd96b54673401cedbe802520dce12b3472.

* Revert "Removed Starup.cs"

This reverts commit 46175d7aa97475d88ec46bce39ed498c7037d924.

* Revert "Merged conent from Startup.cs to Program.cs"

This reverts commit 2766ea86dfef9220fe3f0c27a37a9a6c18153078.

* Removed extra spaces

* Updated basket-api project file

* Update src/Services/Basket/Basket.API/Grpc/BasketService.cs

Co-authored-by: David Pine <david.pine@microsoft.com>

* Apply suggestions from code review

Co-authored-by: David Pine <david.pine@microsoft.com>

* Moved the fully qualified namespace on top

* Updated relevant packages in basket.api project

* Updated relevant packages in identity.api project

Co-authored-by: David Pine <david.pine@microsoft.com>
2021-10-04 19:39:36 +05:30
Josh Coleman
8be1c9cd3e
Seeking feedback: Build and run on .Net 6 preview 6 (#1734)
* Updgrade build and hosting machines to .net6 latest

* Target .net 6

* ILogger is ambiguous?

* More ILogger ambiguity

* Use preview 6... seeing errors in preview 7...

* Of course the SDK version is different :)

* downgrade the last nonworking component

* Only restore the packages we need for the one off service stuck in .net 5

* Downgrade development docker files to use the preview 6 sdk
2021-08-09 19:57:22 +05:30
180 changed files with 3945 additions and 3757 deletions

View File

@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base FROM mcr.microsoft.com/dotnet/nightly/aspnet:6.0.0-preview.7 AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build FROM mcr.microsoft.com/dotnet/nightly/sdk:6.0.100-preview.7 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles # It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles

View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 FROM mcr.microsoft.com/dotnet/nightly/sdk:6.0.100-preview.6
ARG BUILD_CONFIGURATION=Debug ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true ENV DOTNET_USE_POLLING_FILE_WATCHER=true

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssemblyName>Mobile.Shopping.HttpAggregator</AssemblyName> <AssemblyName>Mobile.Shopping.HttpAggregator</AssemblyName>
<RootNamespace>Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator</RootNamespace> <RootNamespace>Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator</RootNamespace>
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath> <DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>

View File

@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base FROM mcr.microsoft.com/dotnet/nightly/aspnet:6.0.0-preview.7 AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build FROM mcr.microsoft.com/dotnet/nightly/sdk:6.0.100-preview.7 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles # It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles

View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 FROM mcr.microsoft.com/dotnet/nightly/sdk:6.0.100-preview.6
ARG BUILD_CONFIGURATION=Debug ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true ENV DOTNET_USE_POLLING_FILE_WATCHER=true

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssemblyName>Web.Shopping.HttpAggregator</AssemblyName> <AssemblyName>Web.Shopping.HttpAggregator</AssemblyName>
<RootNamespace>Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator</RootNamespace> <RootNamespace>Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator</RootNamespace>
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath> <DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBus</RootNamespace> <RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBus</RootNamespace>
</PropertyGroup> </PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ</RootNamespace> <RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ</RootNamespace>
</PropertyGroup> </PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus</RootNamespace> <RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus</RootNamespace>
</PropertyGroup> </PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF</RootNamespace> <RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF</RootNamespace>
</PropertyGroup> </PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks> <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
</PropertyGroup> </PropertyGroup>

View File

@ -1,11 +1,5 @@
using Microsoft.AspNetCore.Mvc.Authorization; namespace Microsoft.eShopOnContainers.Services.Basket.API.Auth.Server;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.eShopOnContainers.Services.Basket.API.Auth.Server
{
public class AuthorizationHeaderParameterOperationFilter : IOperationFilter public class AuthorizationHeaderParameterOperationFilter : IOperationFilter
{ {
public void Apply(OpenApiOperation operation, OperationFilterContext context) public void Apply(OpenApiOperation operation, OperationFilterContext context)
@ -16,8 +10,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Auth.Server
if (isAuthorized && !allowAnonymous) if (isAuthorized && !allowAnonymous)
{ {
if (operation.Parameters == null) operation.Parameters ??= new List<OpenApiParameter>();
operation.Parameters = new List<OpenApiParameter>();
operation.Parameters.Add(new OpenApiParameter operation.Parameters.Add(new OpenApiParameter
@ -30,4 +23,3 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Auth.Server
} }
} }
} }
}

View File

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback> <AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath> <DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks> <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
@ -16,30 +15,36 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.AzureServiceBus" Version="5.0.1" /> <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.12.2" />
<PackageReference Include="Azure.Identity" Version="1.5.0-beta.3" />
<PackageReference Include="AspNetCore.HealthChecks.AzureServiceBus" Version="5.1.1" />
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="5.0.1" /> <PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.Redis" Version="5.0.1" /> <PackageReference Include="AspNetCore.HealthChecks.Redis" Version="5.0.2" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" /> <PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" /> <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0-preview.1" />
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.1" /> <PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.1" />
<PackageReference Include="Azure.Identity" Version="1.4.0" /> <PackageReference Include="Azure.Identity" Version="1.4.0" />
<PackageReference Include="Google.Protobuf" Version="3.14.0" /> <PackageReference Include="Google.Protobuf" Version="3.14.0" />
<PackageReference Include="Grpc.AspNetCore.Server" Version="2.34.0" /> <PackageReference Include="Grpc.AspNetCore.Server" Version="2.34.0" />
<PackageReference Include="Grpc.Tools" Version="2.34.0" PrivateAssets="All" /> <PackageReference Include="Grpc.Tools" Version="2.34.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.16.0" /> <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.18.0" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.16.0" /> <PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.18.0" />
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.1.3" /> <PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="2.0.2-beta2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.2" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0-preview.7.21378.6" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" /> <PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="5.0.2" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0-preview.7.21378.6" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.1.18" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.3" /> <PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="6.0.0-preview.7.21378.6" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.1-dev-00216" /> <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.11.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00834" /> <PackageReference Include="Serilog.AspNetCore" Version="4.1.1-dev-00229" />
<PackageReference Include="Serilog.Sinks.Http" Version="7.2.0" /> <PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.1-dev-00787" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0-dev-00291" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1-dev-00876" />
<PackageReference Include="Serilog.Sinks.Http" Version="8.0.0-beta.9" />
<PackageReference Include="Serilog.Sinks.Seq" Version="4.1.0-dev-00166" /> <PackageReference Include="Serilog.Sinks.Seq" Version="4.1.0-dev-00166" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.2.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -53,5 +58,4 @@
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusServiceBus\EventBusServiceBus.csproj" /> <ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusServiceBus\EventBusServiceBus.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" /> <ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,7 +1,7 @@
namespace Microsoft.eShopOnContainers.Services.Basket.API namespace Microsoft.eShopOnContainers.Services.Basket.API;
{
public class BasketSettings public class BasketSettings
{ {
public string ConnectionString { get; set; } public string ConnectionString { get; set; }
} }
}

View File

@ -1,18 +1,5 @@
using Basket.API.IntegrationEvents.Events; namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers;
using Basket.API.Model;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
using Microsoft.eShopOnContainers.Services.Basket.API.Services;
using Microsoft.Extensions.Logging;
using System;
using System.Net;
using System.Security.Claims;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers
{
[Route("api/v1/[controller]")] [Route("api/v1/[controller]")]
[Authorize] [Authorize]
[ApiController] [ApiController]
@ -100,4 +87,3 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers
await _repository.DeleteBasketAsync(id); await _repository.DeleteBasketAsync(id);
} }
} }
}

View File

@ -1,7 +1,5 @@
using Microsoft.AspNetCore.Mvc; namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers;
namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers
{
public class HomeController : Controller public class HomeController : Controller
{ {
// GET: /<controller>/ // GET: /<controller>/
@ -10,4 +8,4 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers
return new RedirectResult("~/swagger"); return new RedirectResult("~/swagger");
} }
} }
}

View File

@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base FROM mcr.microsoft.com/dotnet/nightly/aspnet:6.0.0-preview.7 AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build FROM mcr.microsoft.com/dotnet/nightly/sdk:6.0.100-preview.7 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles # It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles

View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 FROM mcr.microsoft.com/dotnet/nightly/sdk:6.0.100-preview.6
ARG BUILD_CONFIGURATION=Debug ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true ENV DOTNET_USE_POLLING_FILE_WATCHER=true

View File

@ -0,0 +1,61 @@
global using Autofac.Extensions.DependencyInjection;
global using Autofac;
global using Azure.Core;
global using Azure.Identity;
global using Basket.API.Infrastructure.ActionResults;
global using Basket.API.Infrastructure.Exceptions;
global using Basket.API.Infrastructure.Filters;
global using Basket.API.Infrastructure.Middlewares;
global using Basket.API.IntegrationEvents.EventHandling;
global using Basket.API.IntegrationEvents.Events;
global using Basket.API.Model;
global using Grpc.Core;
global using GrpcBasket;
global using HealthChecks.UI.Client;
global using Microsoft.AspNetCore.Authentication.JwtBearer;
global using Microsoft.AspNetCore.Authorization;
global using Microsoft.AspNetCore.Builder;
global using Microsoft.AspNetCore.Diagnostics.HealthChecks;
global using Microsoft.AspNetCore.Hosting;
global using Microsoft.AspNetCore.Http.Features;
global using Microsoft.AspNetCore.Http;
global using Microsoft.AspNetCore.Mvc.Authorization;
global using Microsoft.AspNetCore.Mvc.Filters;
global using Microsoft.AspNetCore.Mvc;
global using Microsoft.AspNetCore.Server.Kestrel.Core;
global using Microsoft.AspNetCore;
global using Microsoft.Azure.ServiceBus;
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ;
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus;
global using Microsoft.eShopOnContainers.Services.Basket.API.Controllers;
global using Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories;
global using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.EventHandling;
global using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Events;
global using Microsoft.eShopOnContainers.Services.Basket.API.Model;
global using Microsoft.eShopOnContainers.Services.Basket.API.Services;
global using Microsoft.eShopOnContainers.Services.Basket.API;
global using Microsoft.Extensions.Configuration;
global using Microsoft.Extensions.DependencyInjection;
global using Microsoft.Extensions.Diagnostics.HealthChecks;
global using Microsoft.Extensions.Hosting;
global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Options;
global using Microsoft.OpenApi.Models;
global using RabbitMQ.Client;
global using Serilog.Context;
global using Serilog;
global using StackExchange.Redis;
global using Swashbuckle.AspNetCore.SwaggerGen;
global using System.Collections.Generic;
global using System.ComponentModel.DataAnnotations;
global using System.IdentityModel.Tokens.Jwt;
global using System.IO;
global using System.Linq;
global using System.Net;
global using System.Security.Claims;
global using System.Text.Json;
global using System.Threading.Tasks;
global using System;

View File

@ -1,12 +1,5 @@
using Grpc.Core; namespace GrpcBasket;
using Microsoft.AspNetCore.Authorization;
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
using Microsoft.Extensions.Logging;
using System.Linq;
using System.Threading.Tasks;
namespace GrpcBasket
{
public class BasketService : Basket.BasketBase public class BasketService : Basket.BasketBase
{ {
private readonly IBasketRepository _repository; private readonly IBasketRepository _repository;
@ -99,4 +92,3 @@ namespace GrpcBasket
return response; return response;
} }
} }
}

View File

@ -1,8 +1,5 @@
using Microsoft.AspNetCore.Http; namespace Basket.API.Infrastructure.ActionResults;
using Microsoft.AspNetCore.Mvc;
namespace Basket.API.Infrastructure.ActionResults
{
public class InternalServerErrorObjectResult : ObjectResult public class InternalServerErrorObjectResult : ObjectResult
{ {
public InternalServerErrorObjectResult(object error) public InternalServerErrorObjectResult(object error)
@ -11,4 +8,4 @@ namespace Basket.API.Infrastructure.ActionResults
StatusCode = StatusCodes.Status500InternalServerError; StatusCode = StatusCodes.Status500InternalServerError;
} }
} }
}

View File

@ -1,10 +1,5 @@
using System; namespace Basket.API.Infrastructure.Exceptions;
namespace Basket.API.Infrastructure.Exceptions
{
/// <summary>
/// Exception type for app exceptions
/// </summary>
public class BasketDomainException : Exception public class BasketDomainException : Exception
{ {
public BasketDomainException() public BasketDomainException()
@ -18,4 +13,4 @@ namespace Basket.API.Infrastructure.Exceptions
: base(message, innerException) : base(message, innerException)
{ } { }
} }
}

View File

@ -1,14 +1,12 @@
using Microsoft.AspNetCore.Builder; namespace Basket.API.Infrastructure.Middlewares;
using System;
namespace Basket.API.Infrastructure.Middlewares
{
public static class FailingMiddlewareAppBuilderExtensions public static class FailingMiddlewareAppBuilderExtensions
{ {
public static IApplicationBuilder UseFailingMiddleware(this IApplicationBuilder builder) public static IApplicationBuilder UseFailingMiddleware(this IApplicationBuilder builder)
{ {
return UseFailingMiddleware(builder, null); return UseFailingMiddleware(builder, null);
} }
public static IApplicationBuilder UseFailingMiddleware(this IApplicationBuilder builder, Action<FailingOptions> action) public static IApplicationBuilder UseFailingMiddleware(this IApplicationBuilder builder, Action<FailingOptions> action)
{ {
var options = new FailingOptions(); var options = new FailingOptions();
@ -17,4 +15,4 @@ namespace Basket.API.Infrastructure.Middlewares
return builder; return builder;
} }
} }
}

View File

@ -1,15 +1,5 @@
using Basket.API.Infrastructure.ActionResults; namespace Basket.API.Infrastructure.Filters;
using Basket.API.Infrastructure.Exceptions;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System.Net;
namespace Basket.API.Infrastructure.Filters
{
public partial class HttpGlobalExceptionFilter : IExceptionFilter public partial class HttpGlobalExceptionFilter : IExceptionFilter
{ {
private readonly IWebHostEnvironment env; private readonly IWebHostEnvironment env;
@ -55,4 +45,3 @@ namespace Basket.API.Infrastructure.Filters
context.ExceptionHandled = true; context.ExceptionHandled = true;
} }
} }
}

View File

@ -1,9 +1,9 @@
namespace Basket.API.Infrastructure.Filters namespace Basket.API.Infrastructure.Filters;
{
public class JsonErrorResponse public class JsonErrorResponse
{ {
public string[] Messages { get; set; } public string[] Messages { get; set; }
public object DeveloperMessage { get; set; } public object DeveloperMessage { get; set; }
} }
}

View File

@ -1,9 +1,5 @@
using Microsoft.AspNetCore.Mvc; namespace Basket.API.Infrastructure.Filters;
using Microsoft.AspNetCore.Mvc.Filters;
using System.Linq;
namespace Basket.API.Infrastructure.Filters
{
public class ValidateModelStateFilter : ActionFilterAttribute public class ValidateModelStateFilter : ActionFilterAttribute
{ {
public override void OnActionExecuting(ActionExecutingContext context) public override void OnActionExecuting(ActionExecutingContext context)
@ -27,4 +23,4 @@ namespace Basket.API.Infrastructure.Filters
context.Result = new BadRequestObjectResult(json); context.Result = new BadRequestObjectResult(json);
} }
} }
}

View File

@ -1,11 +1,5 @@
using Microsoft.AspNetCore.Authorization; namespace Basket.API.Infrastructure.Filters;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Collections.Generic;
using System.Linq;
namespace Basket.API.Infrastructure.Filters
{
public class AuthorizeCheckOperationFilter : IOperationFilter public class AuthorizeCheckOperationFilter : IOperationFilter
{ {
public void Apply(OpenApiOperation operation, OperationFilterContext context) public void Apply(OpenApiOperation operation, OperationFilterContext context)
@ -33,4 +27,3 @@ namespace Basket.API.Infrastructure.Filters
}; };
} }
} }
}

View File

@ -1,19 +1,13 @@
using Microsoft.AspNetCore.Http; namespace Basket.API.Infrastructure.Middlewares;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
using System.Threading.Tasks;
namespace Basket.API.Infrastructure.Middlewares
{
public class FailingMiddleware public class FailingMiddleware
{ {
private readonly RequestDelegate _next; private readonly RequestDelegate _next;
private bool _mustFail; private bool _mustFail;
private readonly FailingOptions _options; private readonly FailingOptions _options;
private readonly ILogger _logger; private readonly Microsoft.Extensions.Logging.ILogger _logger;
public FailingMiddleware(RequestDelegate next, ILogger<FailingMiddleware> logger, FailingOptions options) public FailingMiddleware(RequestDelegate next, Microsoft.Extensions.Logging.ILogger<FailingMiddleware> logger, FailingOptions options)
{ {
_next = next; _next = next;
_options = options; _options = options;
@ -92,4 +86,3 @@ namespace Basket.API.Infrastructure.Middlewares
|| _options.EndpointPaths.Count == 0); || _options.EndpointPaths.Count == 0);
} }
} }
}

View File

@ -1,7 +1,5 @@
using System.Collections.Generic; namespace Basket.API.Infrastructure.Middlewares;
namespace Basket.API.Infrastructure.Middlewares
{
public class FailingOptions public class FailingOptions
{ {
public string ConfigPath = "/Failing"; public string ConfigPath = "/Failing";
@ -9,4 +7,4 @@ namespace Basket.API.Infrastructure.Middlewares
public List<string> NotFilteredPaths { get; set; } = new List<string>(); public List<string> NotFilteredPaths { get; set; } = new List<string>();
} }
}

View File

@ -1,9 +1,5 @@
using Microsoft.AspNetCore.Builder; namespace Basket.API.Infrastructure.Middlewares;
using Microsoft.AspNetCore.Hosting;
using System;
namespace Basket.API.Infrastructure.Middlewares
{
public class FailingStartupFilter : IStartupFilter public class FailingStartupFilter : IStartupFilter
{ {
private readonly Action<FailingOptions> _options; private readonly Action<FailingOptions> _options;
@ -21,4 +17,4 @@ namespace Basket.API.Infrastructure.Middlewares
}; };
} }
} }
}

View File

@ -1,9 +1,5 @@
using Microsoft.AspNetCore.Hosting; namespace Basket.API.Infrastructure.Middlewares;
using Microsoft.Extensions.DependencyInjection;
using System;
namespace Basket.API.Infrastructure.Middlewares
{
public static class WebHostBuildertExtensions public static class WebHostBuildertExtensions
{ {
public static IWebHostBuilder UseFailing(this IWebHostBuilder builder, Action<FailingOptions> options) public static IWebHostBuilder UseFailing(this IWebHostBuilder builder, Action<FailingOptions> options)
@ -15,4 +11,4 @@ namespace Basket.API.Infrastructure.Middlewares
return builder; return builder;
} }
} }
}

View File

@ -1,13 +1,5 @@
using Microsoft.eShopOnContainers.Services.Basket.API.Model; namespace Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories;
using Microsoft.Extensions.Logging;
using StackExchange.Redis;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Text.Json;
namespace Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories
{
public class RedisBasketRepository : IBasketRepository public class RedisBasketRepository : IBasketRepository
{ {
private readonly ILogger<RedisBasketRepository> _logger; private readonly ILogger<RedisBasketRepository> _logger;
@ -70,4 +62,3 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Reposit
return _redis.GetServer(endpoint.First()); return _redis.GetServer(endpoint.First());
} }
} }
}

View File

@ -1,13 +1,5 @@
using Basket.API.IntegrationEvents.Events; namespace Basket.API.IntegrationEvents.EventHandling;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
using Microsoft.Extensions.Logging;
using Serilog.Context;
using System;
using System.Threading.Tasks;
namespace Basket.API.IntegrationEvents.EventHandling
{
public class OrderStartedIntegrationEventHandler : IIntegrationEventHandler<OrderStartedIntegrationEvent> public class OrderStartedIntegrationEventHandler : IIntegrationEventHandler<OrderStartedIntegrationEvent>
{ {
private readonly IBasketRepository _repository; private readonly IBasketRepository _repository;
@ -31,7 +23,7 @@ namespace Basket.API.IntegrationEvents.EventHandling
} }
} }
} }
}

View File

@ -1,14 +1,5 @@
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.EventHandling;
using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Events;
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
using Microsoft.Extensions.Logging;
using Serilog.Context;
using System;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.EventHandling
{
public class ProductPriceChangedIntegrationEventHandler : IIntegrationEventHandler<ProductPriceChangedIntegrationEvent> public class ProductPriceChangedIntegrationEventHandler : IIntegrationEventHandler<ProductPriceChangedIntegrationEvent>
{ {
private readonly ILogger<ProductPriceChangedIntegrationEventHandler> _logger; private readonly ILogger<ProductPriceChangedIntegrationEventHandler> _logger;
@ -60,5 +51,3 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even
} }
} }
} }
}

View File

@ -1,9 +1,7 @@
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; namespace Basket.API.IntegrationEvents.Events;
namespace Basket.API.IntegrationEvents.Events
{
// Integration Events notes: // Integration Events notes:
// An Event is “something that has happened in the past”, therefore its name has to be // An Event is "something that has happened in the past", therefore its name has to be
// An Integration Event is an event that can cause side effects to other microsrvices, Bounded-Contexts or external systems. // An Integration Event is an event that can cause side effects to other microsrvices, Bounded-Contexts or external systems.
public record OrderStartedIntegrationEvent : IntegrationEvent public record OrderStartedIntegrationEvent : IntegrationEvent
{ {
@ -12,4 +10,4 @@ namespace Basket.API.IntegrationEvents.Events
public OrderStartedIntegrationEvent(string userId) public OrderStartedIntegrationEvent(string userId)
=> UserId = userId; => UserId = userId;
} }
}

View File

@ -1,9 +1,7 @@
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Events;
namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Events
{
// Integration Events notes: // Integration Events notes:
// An Event is “something that has happened in the past”, therefore its name has to be // An Event is "something that has happened in the past", therefore its name has to be
// An Integration Event is an event that can cause side effects to other microsrvices, Bounded-Contexts or external systems. // An Integration Event is an event that can cause side effects to other microsrvices, Bounded-Contexts or external systems.
public record ProductPriceChangedIntegrationEvent : IntegrationEvent public record ProductPriceChangedIntegrationEvent : IntegrationEvent
{ {
@ -20,4 +18,4 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even
OldPrice = oldPrice; OldPrice = oldPrice;
} }
} }
}

View File

@ -1,9 +1,5 @@
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; namespace Basket.API.IntegrationEvents.Events;
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
using System;
namespace Basket.API.IntegrationEvents.Events
{
public record UserCheckoutAcceptedIntegrationEvent : IntegrationEvent public record UserCheckoutAcceptedIntegrationEvent : IntegrationEvent
{ {
public string UserId { get; } public string UserId { get; }
@ -61,4 +57,3 @@ namespace Basket.API.IntegrationEvents.Events
} }
} }
}

View File

@ -1,7 +1,5 @@
using System; namespace Basket.API.Model;
namespace Basket.API.Model
{
public class BasketCheckout public class BasketCheckout
{ {
public string City { get; set; } public string City { get; set; }
@ -28,5 +26,3 @@ namespace Basket.API.Model
public Guid RequestId { get; set; } public Guid RequestId { get; set; }
} }
}

View File

@ -1,8 +1,5 @@
using System.Collections.Generic; namespace Microsoft.eShopOnContainers.Services.Basket.API.Model;
using System.ComponentModel.DataAnnotations;
namespace Microsoft.eShopOnContainers.Services.Basket.API.Model
{
public class BasketItem : IValidatableObject public class BasketItem : IValidatableObject
{ {
public string Id { get; set; } public string Id { get; set; }
@ -12,6 +9,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Model
public decimal OldUnitPrice { get; set; } public decimal OldUnitPrice { get; set; }
public int Quantity { get; set; } public int Quantity { get; set; }
public string PictureUrl { get; set; } public string PictureUrl { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{ {
var results = new List<ValidationResult>(); var results = new List<ValidationResult>();
@ -24,4 +22,3 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Model
return results; return results;
} }
} }
}

View File

@ -1,12 +1,10 @@
using System.Collections.Generic; namespace Microsoft.eShopOnContainers.Services.Basket.API.Model;
namespace Microsoft.eShopOnContainers.Services.Basket.API.Model
{
public class CustomerBasket public class CustomerBasket
{ {
public string BuyerId { get; set; } public string BuyerId { get; set; }
public List<BasketItem> Items { get; set; } = new List<BasketItem>(); public List<BasketItem> Items { get; set; } = new();
public CustomerBasket() public CustomerBasket()
{ {
@ -18,4 +16,4 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Model
BuyerId = customerId; BuyerId = customerId;
} }
} }
}

View File

@ -1,8 +1,5 @@
using System.Collections.Generic; namespace Microsoft.eShopOnContainers.Services.Basket.API.Model;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Basket.API.Model
{
public interface IBasketRepository public interface IBasketRepository
{ {
Task<CustomerBasket> GetBasketAsync(string customerId); Task<CustomerBasket> GetBasketAsync(string customerId);
@ -10,4 +7,4 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Model
Task<CustomerBasket> UpdateBasketAsync(CustomerBasket basket); Task<CustomerBasket> UpdateBasketAsync(CustomerBasket basket);
Task<bool> DeleteBasketAsync(string id); Task<bool> DeleteBasketAsync(string id);
} }
}

View File

@ -1,18 +1,4 @@
using Basket.API.Infrastructure.Middlewares; var configuration = GetConfiguration();
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.eShopOnContainers.Services.Basket.API;
using Microsoft.Extensions.Configuration;
using Azure.Identity;
using Serilog;
using System;
using System.IO;
using System.Net;
using Azure.Core;
var configuration = GetConfiguration();
Log.Logger = CreateSerilogLogger(configuration); Log.Logger = CreateSerilogLogger(configuration);
@ -64,7 +50,7 @@ IWebHost BuildWebHost(IConfiguration configuration, string[] args) =>
.UseSerilog() .UseSerilog()
.Build(); .Build();
ILogger CreateSerilogLogger(IConfiguration configuration) Serilog.ILogger CreateSerilogLogger(IConfiguration configuration)
{ {
var seqServerUrl = configuration["Serilog:SeqServerUrl"]; var seqServerUrl = configuration["Serilog:SeqServerUrl"];
var logstashUrl = configuration["Serilog:LogstashgUrl"]; var logstashUrl = configuration["Serilog:LogstashgUrl"];

View File

@ -1,7 +1,7 @@
namespace Microsoft.eShopOnContainers.Services.Basket.API.Services namespace Microsoft.eShopOnContainers.Services.Basket.API.Services;
{
public interface IIdentityService public interface IIdentityService
{ {
string GetUserIdentity(); string GetUserIdentity();
} }
}

View File

@ -1,9 +1,5 @@
 namespace Microsoft.eShopOnContainers.Services.Basket.API.Services;
using Microsoft.AspNetCore.Http;
using System;
namespace Microsoft.eShopOnContainers.Services.Basket.API.Services
{
public class IdentityService : IIdentityService public class IdentityService : IIdentityService
{ {
private IHttpContextAccessor _context; private IHttpContextAccessor _context;
@ -18,4 +14,4 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Services
return _context.HttpContext.User.FindFirst("sub").Value; return _context.HttpContext.User.FindFirst("sub").Value;
} }
} }
}

View File

@ -1,41 +1,5 @@
using Autofac; namespace Microsoft.eShopOnContainers.Services.Basket.API;
using Autofac.Extensions.DependencyInjection;
using Basket.API.Infrastructure.Filters;
using Basket.API.IntegrationEvents.EventHandling;
using Basket.API.IntegrationEvents.Events;
using GrpcBasket;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.ServiceBus;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus;
using Microsoft.eShopOnContainers.Services.Basket.API.Controllers;
using Microsoft.eShopOnContainers.Services.Basket.API.Infrastructure.Repositories;
using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.EventHandling;
using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Events;
using Microsoft.eShopOnContainers.Services.Basket.API.Model;
using Microsoft.eShopOnContainers.Services.Basket.API.Services;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using RabbitMQ.Client;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.IO;
namespace Microsoft.eShopOnContainers.Services.Basket.API
{
public class Startup public class Startup
{ {
public Startup(IConfiguration configuration) public Startup(IConfiguration configuration)
@ -66,7 +30,6 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
services.AddSwaggerGen(options => services.AddSwaggerGen(options =>
{ {
options.DescribeAllEnumsAsStrings();
options.SwaggerDoc("v1", new OpenApiInfo options.SwaggerDoc("v1", new OpenApiInfo
{ {
Title = "eShopOnContainers - Basket HTTP API", Title = "eShopOnContainers - Basket HTTP API",
@ -360,4 +323,3 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
return services; return services;
} }
} }
}

View File

@ -1,10 +1,6 @@
using Microsoft.AspNetCore.Http; namespace Microsoft.eShopOnContainers.Services.Basket.API;
using Microsoft.AspNetCore.Http.Features;
namespace Microsoft.eShopOnContainers.Services.Basket.API
{
internal class TestHttpResponseTrailersFeature : IHttpResponseTrailersFeature internal class TestHttpResponseTrailersFeature : IHttpResponseTrailersFeature
{ {
public IHeaderDictionary Trailers { get; set; } public IHeaderDictionary Trailers { get; set; }
} }
}

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks> <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<DebugType>portable</DebugType> <DebugType>portable</DebugType>
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Catalog.API</AssemblyName> <AssemblyName>Catalog.API</AssemblyName>

View File

@ -1,9 +1,9 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base FROM mcr.microsoft.com/dotnet/nightly/aspnet:6.0.0-preview.7 AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
EXPOSE 443 EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build FROM mcr.microsoft.com/dotnet/nightly/sdk:6.0.100-preview.7 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles # It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles

View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 FROM mcr.microsoft.com/dotnet/nightly/sdk:6.0.100-preview.6
ARG BUILD_CONFIGURATION=Debug ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true ENV DOTNET_USE_POLLING_FILE_WATCHER=true

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks> <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>

View File

@ -1,8 +1,4 @@
using System.IO; namespace Microsoft.eShopOnContainers.Services.Identity.API.Certificates
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Certificates
{ {
static class Certificate static class Certificate
{ {

View File

@ -1,6 +1,4 @@
using IdentityServer4; using IdentityServer4.Models;
using IdentityServer4.Models;
using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Configuration namespace Microsoft.eShopOnContainers.Services.Identity.API.Configuration
{ {
@ -93,6 +91,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Configuration
ClientName = "MVC Client", ClientName = "MVC Client",
ClientSecrets = new List<Secret> ClientSecrets = new List<Secret>
{ {
new Secret("secret".Sha256()) new Secret("secret".Sha256())
}, },
ClientUri = $"{clientsUrl["Mvc"]}", // public uri of the client ClientUri = $"{clientsUrl["Mvc"]}", // public uri of the client

View File

@ -1,23 +1,4 @@
using IdentityModel; namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers
using IdentityServer4;
using IdentityServer4.Models;
using IdentityServer4.Services;
using IdentityServer4.Stores;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.eShopOnContainers.Services.Identity.API.Models;
using Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels;
using Microsoft.eShopOnContainers.Services.Identity.API.Services;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers
{ {
/// <summary> /// <summary>
/// This sample controller implements a typical login/logout/provision workflow for local accounts. /// This sample controller implements a typical login/logout/provision workflow for local accounts.

View File

@ -1,13 +1,4 @@
using IdentityServer4.Models; namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers
using IdentityServer4.Services;
using IdentityServer4.Stores;
using Microsoft.AspNetCore.Mvc;
using Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels;
using Microsoft.Extensions.Logging;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers
{ {
/// <summary> /// <summary>
/// This controller implements the consent logic /// This controller implements the consent logic

View File

@ -1,12 +1,4 @@
 namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers
using IdentityServer4.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.eShopOnContainers.Services.Identity.API.Models;
using Microsoft.eShopOnContainers.Services.Identity.API.Services;
using Microsoft.Extensions.Options;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers
{ {
public class HomeController : Controller public class HomeController : Controller
{ {

View File

@ -1,8 +1,4 @@
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; namespace Microsoft.eShopOnContainers.Services.Identity.API.Data
using Microsoft.EntityFrameworkCore;
using Microsoft.eShopOnContainers.Services.Identity.API.Models;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Data
{ {
public class ApplicationDbContext : IdentityDbContext<ApplicationUser> public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{ {

View File

@ -1,18 +1,4 @@
using Microsoft.AspNetCore.Hosting; namespace Microsoft.eShopOnContainers.Services.Identity.API.Data
using Microsoft.AspNetCore.Identity;
using Microsoft.eShopOnContainers.Services.Identity.API.Extensions;
using Microsoft.eShopOnContainers.Services.Identity.API.Models;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Data
{ {
@ -58,7 +44,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Data
} }
} }
private IEnumerable<ApplicationUser> GetUsersFromFile(string contentRootPath, ILogger logger) private IEnumerable<ApplicationUser> GetUsersFromFile(string contentRootPath, Microsoft.Extensions.Logging.ILogger logger)
{ {
string csvFileUsers = Path.Combine(contentRootPath, "Setup", "Users.csv"); string csvFileUsers = Path.Combine(contentRootPath, "Setup", "Users.csv");
@ -192,7 +178,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Data
return csvheaders; return csvheaders;
} }
static void GetPreconfiguredImages(string contentRootPath, string webroot, ILogger logger) static void GetPreconfiguredImages(string contentRootPath, string webroot, Microsoft.Extensions.Logging.ILogger logger)
{ {
try try
{ {

View File

@ -1,12 +1,4 @@
using IdentityServer4.EntityFramework.DbContexts; using IdentityServer4.EntityFramework.Entities;
using IdentityServer4.EntityFramework.Entities;
using IdentityServer4.EntityFramework.Mappers;
using Microsoft.EntityFrameworkCore;
using Microsoft.eShopOnContainers.Services.Identity.API.Configuration;
using Microsoft.Extensions.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Data namespace Microsoft.eShopOnContainers.Services.Identity.API.Data
{ {

View File

@ -1,27 +1,21 @@
using IdentityServer4.Models;
using IdentityServer4.Validation;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Devspaces namespace Microsoft.eShopOnContainers.Services.Identity.API.Devspaces
{ {
public class DevspacesRedirectUriValidator : IRedirectUriValidator public class DevspacesRedirectUriValidator : IRedirectUriValidator
{ {
private readonly ILogger _logger; private readonly Microsoft.Extensions.Logging.ILogger _logger;
public DevspacesRedirectUriValidator(ILogger<DevspacesRedirectUriValidator> logger) public DevspacesRedirectUriValidator(ILogger<DevspacesRedirectUriValidator> logger)
{ {
_logger = logger; _logger = logger;
} }
public Task<bool> IsPostLogoutRedirectUriValidAsync(string requestedUri, Client client) public Task<bool> IsPostLogoutRedirectUriValidAsync(string requestedUri, IdentityServer4.Models.Client client)
{ {
_logger.LogInformation("Client {ClientName} used post logout uri {RequestedUri}.", client.ClientName, requestedUri); _logger.LogInformation("Client {ClientName} used post logout uri {RequestedUri}.", client.ClientName, requestedUri);
return Task.FromResult(true); return Task.FromResult(true);
} }
public Task<bool> IsRedirectUriValidAsync(string requestedUri, Client client) public Task<bool> IsRedirectUriValidAsync(string requestedUri, IdentityServer4.Models.Client client)
{ {
_logger.LogInformation("Client {ClientName} used post logout uri {RequestedUri}.", client.ClientName, requestedUri); _logger.LogInformation("Client {ClientName} used post logout uri {RequestedUri}.", client.ClientName, requestedUri);
return Task.FromResult(true); return Task.FromResult(true);

View File

@ -1,6 +1,4 @@
using Microsoft.Extensions.DependencyInjection; namespace Microsoft.eShopOnContainers.Services.Identity.API.Devspaces
namespace Microsoft.eShopOnContainers.Services.Identity.API.Devspaces
{ {
static class IdentityDevspacesBuilderExtensions static class IdentityDevspacesBuilderExtensions
{ {

View File

@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base FROM mcr.microsoft.com/dotnet/nightly/aspnet:6.0.0-preview.7 AS base
WORKDIR /app WORKDIR /app
EXPOSE 80 EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build FROM mcr.microsoft.com/dotnet/nightly/sdk:6.0.100-preview.7 AS build
WORKDIR /src WORKDIR /src
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles # It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles

View File

@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 FROM mcr.microsoft.com/dotnet/nightly/sdk:6.0.100-preview.6
ARG BUILD_CONFIGURATION=Debug ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true ENV DOTNET_USE_POLLING_FILE_WATCHER=true

View File

@ -1,8 +1,4 @@
using System; namespace Microsoft.eShopOnContainers.Services.Identity.API.Extensions
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Extensions
{ {
public static class LinqSelectExtensions public static class LinqSelectExtensions
{ {

View File

@ -1,10 +1,4 @@
using Microsoft.EntityFrameworkCore; namespace Identity.API.Factories
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.eShopOnContainers.Services.Identity.API.Data;
using Microsoft.Extensions.Configuration;
using System.IO;
namespace Identity.API.Factories
{ {
public class ApplicationDbContextFactory : IDesignTimeDbContextFactory<ApplicationDbContext> public class ApplicationDbContextFactory : IDesignTimeDbContextFactory<ApplicationDbContext>
{ {

View File

@ -1,11 +1,4 @@
using IdentityServer4.EntityFramework.DbContexts; namespace Identity.API.Factories
using IdentityServer4.EntityFramework.Options;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
using System.IO;
namespace Identity.API.Factories
{ {
public class ConfigurationDbContextFactory : IDesignTimeDbContextFactory<ConfigurationDbContext> public class ConfigurationDbContextFactory : IDesignTimeDbContextFactory<ConfigurationDbContext>
{ {

View File

@ -1,11 +1,4 @@
using IdentityServer4.EntityFramework.DbContexts; namespace Identity.API.Factories
using IdentityServer4.EntityFramework.Options;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
using System.IO;
namespace Identity.API.Factories
{ {
public class PersistedGrantDbContextFactory : IDesignTimeDbContextFactory<PersistedGrantDbContext> public class PersistedGrantDbContextFactory : IDesignTimeDbContextFactory<PersistedGrantDbContext>
{ {

View File

@ -0,0 +1,183 @@
global using Microsoft.eShopOnContainers.Services.Identity.API.Extensions;
global using System.IO.Compression;
global using Autofac.Extensions.DependencyInjection;
global using Autofac;
global using Azure.Core;
global using Azure.Identity;
global using HealthChecks.UI.Client;
global using IdentityModel;
global using IdentityServer4.EntityFramework.DbContexts;
global using IdentityServer4.EntityFramework.Mappers;
global using IdentityServer4.EntityFramework.Options;
global using IdentityServer4.Models;
global using IdentityServer4.Services;
global using IdentityServer4.Stores;
global using IdentityServer4.Validation;
global using IdentityServer4;
global using Microsoft.AspNetCore.Authentication;
global using Microsoft.AspNetCore.Authorization;
global using Microsoft.AspNetCore.Builder;
global using Microsoft.AspNetCore.Diagnostics.HealthChecks;
global using Microsoft.AspNetCore.Hosting;
global using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
global using Microsoft.AspNetCore.Identity;
global using Microsoft.AspNetCore.Mvc.Rendering;
global using Microsoft.AspNetCore.Mvc;
global using Microsoft.AspNetCore;
global using Microsoft.EntityFrameworkCore.Design;
global using Microsoft.EntityFrameworkCore.Infrastructure;
global using Microsoft.EntityFrameworkCore.Metadata;
global using Microsoft.EntityFrameworkCore.Migrations;
global using Microsoft.EntityFrameworkCore;
global using Microsoft.eShopOnContainers.Services.Identity.API.Certificates;
global using Microsoft.eShopOnContainers.Services.Identity.API.Configuration;
global using Microsoft.eShopOnContainers.Services.Identity.API.Data;
global using Microsoft.eShopOnContainers.Services.Identity.API.Devspaces;
global using Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels;
global using Microsoft.eShopOnContainers.Services.Identity.API.Models;
global using Microsoft.eShopOnContainers.Services.Identity.API.Services;
global using Microsoft.eShopOnContainers.Services.Identity.API;
global using Microsoft.Extensions.Configuration;
global using Microsoft.Extensions.DependencyInjection;
global using Microsoft.Extensions.Diagnostics.HealthChecks;
global using Microsoft.Extensions.Hosting;
global using Microsoft.Extensions.Logging;
global using Microsoft.Extensions.Options;
global using Polly;
global using Serilog;
global using StackExchange.Redis;
global using System.Collections.Generic;
global using System.ComponentModel.DataAnnotations;
global using System.Data.SqlClient;
global using System.IdentityModel.Tokens.Jwt;
global using System.IO;
global using System.Linq;
global using System.Reflection;
global using System.Security.Claims;
global using System.Security.Cryptography.X509Certificates;
global using System.Text.RegularExpressions;
global using System.Threading.Tasks;
global using System;

View File

@ -1,11 +1,3 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Polly;
using System;
using System.Data.SqlClient;
namespace Microsoft.AspNetCore.Hosting namespace Microsoft.AspNetCore.Hosting
{ {
public static class IWebHostExtensions public static class IWebHostExtensions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<UserSecretsId>aspnet-eShopOnContainers.Identity-90487118-103c-4ff0-b9da-e5e26f7ab0c5</UserSecretsId> <UserSecretsId>aspnet-eShopOnContainers.Identity-90487118-103c-4ff0-b9da-e5e26f7ab0c5</UserSecretsId>
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath> <DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks> <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
@ -16,41 +16,44 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="5.0.1" /> <PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="5.0.3" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" /> <PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" /> <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0-preview.1" />
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.1" />
<PackageReference Include="Azure.Identity" Version="1.4.0" />
<PackageReference Include="IdentityServer4.AspNetIdentity" Version="3.1.4" /> <PackageReference Include="IdentityServer4.AspNetIdentity" Version="3.1.4" />
<PackageReference Include="IdentityServer4.EntityFramework.Storage" Version="3.1.4" /> <PackageReference Include="IdentityServer4.EntityFramework.Storage" Version="3.1.4" />
<PackageReference Include="IdentityServer4.EntityFramework" Version="3.1.4" /> <PackageReference Include="IdentityServer4.EntityFramework" Version="3.1.4" />
<PackageReference Include="IdentityServer4.Storage" Version="3.1.4" /> <PackageReference Include="IdentityServer4.Storage" Version="3.1.4" />
<PackageReference Include="IdentityServer4" Version="3.1.4" /> <PackageReference Include="IdentityServer4" Version="3.1.4" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.16.0" /> <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.18.0" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.16.0" /> <PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.18.0" />
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.1.3" /> <PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="2.0.2-beta2" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="5.0.2" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.0-preview.7.21378.6" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.2" /> <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.0-preview.7.21378.6" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" /> <PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.2" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0-preview.7.21378.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.2"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0-preview.7.21378.4">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0-preview.7.21378.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0-preview.7.21378.4" />
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="5.0.2" /> <PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.1.18" />
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="6.0.0-preview.7.21378.6" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.11.1" />
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.113" /> <PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.113" />
<PackageReference Include="Polly" Version="7.2.1" /> <PackageReference Include="Polly" Version="7.2.2" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" /> <PackageReference Include="Serilog.AspNetCore" Version="4.1.1-dev-00229" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.3" /> <PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.1-dev-00787" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.1-dev-00216" /> <PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0-dev-00291" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00834" /> <PackageReference Include="Serilog.Sinks.Console" Version="4.0.1-dev-00876" />
<PackageReference Include="Serilog.Sinks.Http" Version="7.2.0" /> <PackageReference Include="Serilog.Sinks.Http" Version="8.0.0-beta.9" />
<PackageReference Include="Serilog.Sinks.Seq" Version="4.1.0-dev-00166" /> <PackageReference Include="Serilog.Sinks.Seq" Version="5.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.1" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" /> <PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.2.1" />
<PackageReference Include="System.Data.SqlClient" version="4.8.2"/>
<PackageReference Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.2.1" />
<PackageReference Include="Azure.Identity" Version="1.4.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -10,209 +10,258 @@ using Microsoft.eShopOnContainers.Services.Identity.API.Data;
namespace Identity.API.Migrations namespace Identity.API.Migrations
{ {
[DbContext(typeof(ApplicationDbContext))] [DbContext(typeof(ApplicationDbContext))]
[Migration("20190729091724_InitialMigration")] [Migration("20210813072445_InitialMigration")]
partial class InitialMigration partial class InitialMigration
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "3.0.0-preview7.19362.6")
.HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{ {
b.Property<string>("Id"); b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken(); .IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name") b.Property<string>("Name")
.HasMaxLength(256); .HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedName") b.Property<string>("NormalizedName")
.HasMaxLength(256); .HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("NormalizedName") b.HasIndex("NormalizedName")
.IsUnique() .IsUnique()
.HasName("RoleNameIndex") .HasDatabaseName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL"); .HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles"); b.ToTable("AspNetRoles", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType"); b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue"); b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleId") b.Property<string>("RoleId")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("RoleId"); b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims"); b.ToTable("AspNetRoleClaims", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType"); b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue"); b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId") b.Property<string>("UserId")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("UserId"); b.HasIndex("UserId");
b.ToTable("AspNetUserClaims"); b.ToTable("AspNetUserClaims", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{ {
b.Property<string>("LoginProvider"); b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderKey"); b.Property<string>("ProviderKey")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderDisplayName"); b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId") b.Property<string>("UserId")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("LoginProvider", "ProviderKey"); b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId"); b.HasIndex("UserId");
b.ToTable("AspNetUserLogins"); b.ToTable("AspNetUserLogins", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{ {
b.Property<string>("UserId"); b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("RoleId"); b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId"); b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId"); b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles"); b.ToTable("AspNetUserRoles", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{ {
b.Property<string>("UserId"); b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("LoginProvider"); b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("Name"); b.Property<string>("Name")
.HasColumnType("nvarchar(450)");
b.Property<string>("Value"); b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name"); b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens"); b.ToTable("AspNetUserTokens", (string)null);
}); });
modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser", b => modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser", b =>
{ {
b.Property<string>("Id"); b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AccessFailedCount"); b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("CardHolderName") b.Property<string>("CardHolderName")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("CardNumber") b.Property<string>("CardNumber")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CardType"); b.Property<int>("CardType")
.HasColumnType("int");
b.Property<string>("City") b.Property<string>("City")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken(); .IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Country") b.Property<string>("Country")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email") b.Property<string>("Email")
.HasMaxLength(256); .HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("EmailConfirmed"); b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<string>("Expiration") b.Property<string>("Expiration")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName") b.Property<string>("LastName")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("LockoutEnabled"); b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd"); b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("NormalizedEmail") b.Property<string>("NormalizedEmail")
.HasMaxLength(256); .HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedUserName") b.Property<string>("NormalizedUserName")
.HasMaxLength(256); .HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("PasswordHash"); b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber"); b.Property<string>("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property<bool>("PhoneNumberConfirmed"); b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("SecurityNumber") b.Property<string>("SecurityNumber")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SecurityStamp"); b.Property<string>("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property<string>("State") b.Property<string>("State")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Street") b.Property<string>("Street")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled"); b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("UserName") b.Property<string>("UserName")
.HasMaxLength(256); .HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("ZipCode") b.Property<string>("ZipCode")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("NormalizedEmail") b.HasIndex("NormalizedEmail")
.HasName("EmailIndex"); .HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName") b.HasIndex("NormalizedUserName")
.IsUnique() .IsUnique()
.HasName("UserNameIndex") .HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL"); .HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers"); b.ToTable("AspNetUsers", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>

View File

@ -1,6 +1,5 @@
using Microsoft.EntityFrameworkCore.Metadata; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using System;
namespace Identity.API.Migrations namespace Identity.API.Migrations
{ {
@ -12,10 +11,10 @@ namespace Identity.API.Migrations
name: "AspNetRoles", name: "AspNetRoles",
columns: table => new columns: table => new
{ {
Id = table.Column<string>(nullable: false), Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
Name = table.Column<string>(maxLength: 256, nullable: true), Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(maxLength: 256, nullable: true), NormalizedName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true) ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true)
}, },
constraints: table => constraints: table =>
{ {
@ -26,33 +25,33 @@ namespace Identity.API.Migrations
name: "AspNetUsers", name: "AspNetUsers",
columns: table => new columns: table => new
{ {
Id = table.Column<string>(nullable: false), Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
UserName = table.Column<string>(maxLength: 256, nullable: true), CardNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: true), SecurityNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
Email = table.Column<string>(maxLength: 256, nullable: true), Expiration = table.Column<string>(type: "nvarchar(max)", nullable: false),
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true), CardHolderName = table.Column<string>(type: "nvarchar(max)", nullable: false),
EmailConfirmed = table.Column<bool>(nullable: false), CardType = table.Column<int>(type: "int", nullable: false),
PasswordHash = table.Column<string>(nullable: true), Street = table.Column<string>(type: "nvarchar(max)", nullable: false),
SecurityStamp = table.Column<string>(nullable: true), City = table.Column<string>(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column<string>(nullable: true), State = table.Column<string>(type: "nvarchar(max)", nullable: false),
PhoneNumber = table.Column<string>(nullable: true), Country = table.Column<string>(type: "nvarchar(max)", nullable: false),
PhoneNumberConfirmed = table.Column<bool>(nullable: false), ZipCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
TwoFactorEnabled = table.Column<bool>(nullable: false), Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(nullable: true), LastName = table.Column<string>(type: "nvarchar(max)", nullable: false),
LockoutEnabled = table.Column<bool>(nullable: false), UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
AccessFailedCount = table.Column<int>(nullable: false), NormalizedUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
CardNumber = table.Column<string>(nullable: false), Email = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
SecurityNumber = table.Column<string>(nullable: false), NormalizedEmail = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
Expiration = table.Column<string>(nullable: false), EmailConfirmed = table.Column<bool>(type: "bit", nullable: false),
CardHolderName = table.Column<string>(nullable: false), PasswordHash = table.Column<string>(type: "nvarchar(max)", nullable: true),
CardType = table.Column<int>(nullable: false), SecurityStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
Street = table.Column<string>(nullable: false), ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
City = table.Column<string>(nullable: false), PhoneNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
State = table.Column<string>(nullable: false), PhoneNumberConfirmed = table.Column<bool>(type: "bit", nullable: false),
Country = table.Column<string>(nullable: false), TwoFactorEnabled = table.Column<bool>(type: "bit", nullable: false),
ZipCode = table.Column<string>(nullable: false), LockoutEnd = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
Name = table.Column<string>(nullable: false), LockoutEnabled = table.Column<bool>(type: "bit", nullable: false),
LastName = table.Column<string>(nullable: false) AccessFailedCount = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -63,11 +62,11 @@ namespace Identity.API.Migrations
name: "AspNetRoleClaims", name: "AspNetRoleClaims",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
RoleId = table.Column<string>(nullable: false), RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false),
ClaimType = table.Column<string>(nullable: true), ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
ClaimValue = table.Column<string>(nullable: true) ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true)
}, },
constraints: table => constraints: table =>
{ {
@ -84,11 +83,11 @@ namespace Identity.API.Migrations
name: "AspNetUserClaims", name: "AspNetUserClaims",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
UserId = table.Column<string>(nullable: false), UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
ClaimType = table.Column<string>(nullable: true), ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
ClaimValue = table.Column<string>(nullable: true) ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true)
}, },
constraints: table => constraints: table =>
{ {
@ -105,10 +104,10 @@ namespace Identity.API.Migrations
name: "AspNetUserLogins", name: "AspNetUserLogins",
columns: table => new columns: table => new
{ {
LoginProvider = table.Column<string>(nullable: false), LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
ProviderKey = table.Column<string>(nullable: false), ProviderKey = table.Column<string>(type: "nvarchar(450)", nullable: false),
ProviderDisplayName = table.Column<string>(nullable: true), ProviderDisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
UserId = table.Column<string>(nullable: false) UserId = table.Column<string>(type: "nvarchar(450)", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -125,8 +124,8 @@ namespace Identity.API.Migrations
name: "AspNetUserRoles", name: "AspNetUserRoles",
columns: table => new columns: table => new
{ {
UserId = table.Column<string>(nullable: false), UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
RoleId = table.Column<string>(nullable: false) RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -149,10 +148,10 @@ namespace Identity.API.Migrations
name: "AspNetUserTokens", name: "AspNetUserTokens",
columns: table => new columns: table => new
{ {
UserId = table.Column<string>(nullable: false), UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
LoginProvider = table.Column<string>(nullable: false), LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
Name = table.Column<string>(nullable: false), Name = table.Column<string>(type: "nvarchar(450)", nullable: false),
Value = table.Column<string>(nullable: true) Value = table.Column<string>(type: "nvarchar(max)", nullable: true)
}, },
constraints: table => constraints: table =>
{ {

View File

@ -15,202 +15,251 @@ namespace Identity.API.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "3.0.0-preview7.19362.6")
.HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{ {
b.Property<string>("Id"); b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken(); .IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name") b.Property<string>("Name")
.HasMaxLength(256); .HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedName") b.Property<string>("NormalizedName")
.HasMaxLength(256); .HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("NormalizedName") b.HasIndex("NormalizedName")
.IsUnique() .IsUnique()
.HasName("RoleNameIndex") .HasDatabaseName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL"); .HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles"); b.ToTable("AspNetRoles", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType"); b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue"); b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleId") b.Property<string>("RoleId")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("RoleId"); b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims"); b.ToTable("AspNetRoleClaims", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType"); b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClaimValue"); b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId") b.Property<string>("UserId")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("UserId"); b.HasIndex("UserId");
b.ToTable("AspNetUserClaims"); b.ToTable("AspNetUserClaims", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{ {
b.Property<string>("LoginProvider"); b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderKey"); b.Property<string>("ProviderKey")
.HasColumnType("nvarchar(450)");
b.Property<string>("ProviderDisplayName"); b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserId") b.Property<string>("UserId")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(450)");
b.HasKey("LoginProvider", "ProviderKey"); b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId"); b.HasIndex("UserId");
b.ToTable("AspNetUserLogins"); b.ToTable("AspNetUserLogins", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{ {
b.Property<string>("UserId"); b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("RoleId"); b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)");
b.HasKey("UserId", "RoleId"); b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId"); b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles"); b.ToTable("AspNetUserRoles", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{ {
b.Property<string>("UserId"); b.Property<string>("UserId")
.HasColumnType("nvarchar(450)");
b.Property<string>("LoginProvider"); b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
b.Property<string>("Name"); b.Property<string>("Name")
.HasColumnType("nvarchar(450)");
b.Property<string>("Value"); b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("UserId", "LoginProvider", "Name"); b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens"); b.ToTable("AspNetUserTokens", (string)null);
}); });
modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser", b => modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Identity.API.Models.ApplicationUser", b =>
{ {
b.Property<string>("Id"); b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AccessFailedCount"); b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("CardHolderName") b.Property<string>("CardHolderName")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("CardNumber") b.Property<string>("CardNumber")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CardType"); b.Property<int>("CardType")
.HasColumnType("int");
b.Property<string>("City") b.Property<string>("City")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken(); .IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Country") b.Property<string>("Country")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email") b.Property<string>("Email")
.HasMaxLength(256); .HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("EmailConfirmed"); b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<string>("Expiration") b.Property<string>("Expiration")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName") b.Property<string>("LastName")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("LockoutEnabled"); b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd"); b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("NormalizedEmail") b.Property<string>("NormalizedEmail")
.HasMaxLength(256); .HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedUserName") b.Property<string>("NormalizedUserName")
.HasMaxLength(256); .HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("PasswordHash"); b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber"); b.Property<string>("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property<bool>("PhoneNumberConfirmed"); b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("SecurityNumber") b.Property<string>("SecurityNumber")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SecurityStamp"); b.Property<string>("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property<string>("State") b.Property<string>("State")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Street") b.Property<string>("Street")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled"); b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("UserName") b.Property<string>("UserName")
.HasMaxLength(256); .HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("ZipCode") b.Property<string>("ZipCode")
.IsRequired(); .IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("NormalizedEmail") b.HasIndex("NormalizedEmail")
.HasName("EmailIndex"); .HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName") b.HasIndex("NormalizedUserName")
.IsUnique() .IsUnique()
.HasName("UserNameIndex") .HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL"); .HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers"); b.ToTable("AspNetUsers", (string)null);
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>

View File

@ -10,116 +10,140 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Identity.API.Migrations.ConfigurationDb namespace Identity.API.Migrations.ConfigurationDb
{ {
[DbContext(typeof(ConfigurationDbContext))] [DbContext(typeof(ConfigurationDbContext))]
[Migration("20190729092011_InitialConfigurationMigration")] [Migration("20210813072543_InitialMigration")]
partial class InitialConfigurationMigration partial class InitialMigration
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "3.0.0-preview7.19362.6")
.HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<DateTime>("Created"); b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(1000); .HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<string>("DisplayName") b.Property<string>("DisplayName")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("Enabled"); b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<DateTime?>("LastAccessed"); b.Property<DateTime?>("LastAccessed")
.HasColumnType("datetime2");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("NonEditable"); b.Property<bool>("NonEditable")
.HasColumnType("bit");
b.Property<DateTime?>("Updated"); b.Property<DateTime?>("Updated")
.HasColumnType("datetime2");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("Name") b.HasIndex("Name")
.IsUnique(); .IsUnique();
b.ToTable("ApiResources"); b.ToTable("ApiResources", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ApiResourceId"); b.Property<int>("ApiResourceId")
.HasColumnType("int");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ApiResourceId"); b.HasIndex("ApiResourceId");
b.ToTable("ApiClaims"); b.ToTable("ApiClaims", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ApiResourceId"); b.Property<int>("ApiResourceId")
.HasColumnType("int");
b.Property<string>("Key") b.Property<string>("Key")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ApiResourceId"); b.HasIndex("ApiResourceId");
b.ToTable("ApiProperties"); b.ToTable("ApiProperties", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ApiResourceId"); b.Property<int>("ApiResourceId")
.HasColumnType("int");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(1000); .HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<string>("DisplayName") b.Property<string>("DisplayName")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("Emphasize"); b.Property<bool>("Emphasize")
.HasColumnType("bit");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("Required"); b.Property<bool>("Required")
.HasColumnType("bit");
b.Property<bool>("ShowInDiscoveryDocument"); b.Property<bool>("ShowInDiscoveryDocument")
.HasColumnType("bit");
b.HasKey("Id"); b.HasKey("Id");
@ -128,435 +152,538 @@ namespace Identity.API.Migrations.ConfigurationDb
b.HasIndex("Name") b.HasIndex("Name")
.IsUnique(); .IsUnique();
b.ToTable("ApiScopes"); b.ToTable("ApiScopes", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ApiScopeId"); b.Property<int>("ApiScopeId")
.HasColumnType("int");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ApiScopeId"); b.HasIndex("ApiScopeId");
b.ToTable("ApiScopeClaims"); b.ToTable("ApiScopeClaims", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ApiResourceId"); b.Property<int>("ApiResourceId")
.HasColumnType("int");
b.Property<DateTime>("Created"); b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(1000); .HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<DateTime?>("Expiration"); b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasMaxLength(4000); .HasMaxLength(4000)
.HasColumnType("nvarchar(4000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ApiResourceId"); b.HasIndex("ApiResourceId");
b.ToTable("ApiSecrets"); b.ToTable("ApiSecrets", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("AbsoluteRefreshTokenLifetime"); b.Property<int>("AbsoluteRefreshTokenLifetime")
.HasColumnType("int");
b.Property<int>("AccessTokenLifetime"); b.Property<int>("AccessTokenLifetime")
.HasColumnType("int");
b.Property<int>("AccessTokenType"); b.Property<int>("AccessTokenType")
.HasColumnType("int");
b.Property<bool>("AllowAccessTokensViaBrowser"); b.Property<bool>("AllowAccessTokensViaBrowser")
.HasColumnType("bit");
b.Property<bool>("AllowOfflineAccess"); b.Property<bool>("AllowOfflineAccess")
.HasColumnType("bit");
b.Property<bool>("AllowPlainTextPkce"); b.Property<bool>("AllowPlainTextPkce")
.HasColumnType("bit");
b.Property<bool>("AllowRememberConsent"); b.Property<bool>("AllowRememberConsent")
.HasColumnType("bit");
b.Property<bool>("AlwaysIncludeUserClaimsInIdToken"); b.Property<bool>("AlwaysIncludeUserClaimsInIdToken")
.HasColumnType("bit");
b.Property<bool>("AlwaysSendClientClaims"); b.Property<bool>("AlwaysSendClientClaims")
.HasColumnType("bit");
b.Property<int>("AuthorizationCodeLifetime"); b.Property<int>("AuthorizationCodeLifetime")
.HasColumnType("int");
b.Property<bool>("BackChannelLogoutSessionRequired"); b.Property<bool>("BackChannelLogoutSessionRequired")
.HasColumnType("bit");
b.Property<string>("BackChannelLogoutUri") b.Property<string>("BackChannelLogoutUri")
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<string>("ClientClaimsPrefix") b.Property<string>("ClientClaimsPrefix")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ClientId") b.Property<string>("ClientId")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ClientName") b.Property<string>("ClientName")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ClientUri") b.Property<string>("ClientUri")
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<int?>("ConsentLifetime"); b.Property<int?>("ConsentLifetime")
.HasColumnType("int");
b.Property<DateTime>("Created"); b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(1000); .HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<int>("DeviceCodeLifetime"); b.Property<int>("DeviceCodeLifetime")
.HasColumnType("int");
b.Property<bool>("EnableLocalLogin"); b.Property<bool>("EnableLocalLogin")
.HasColumnType("bit");
b.Property<bool>("Enabled"); b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<bool>("FrontChannelLogoutSessionRequired"); b.Property<bool>("FrontChannelLogoutSessionRequired")
.HasColumnType("bit");
b.Property<string>("FrontChannelLogoutUri") b.Property<string>("FrontChannelLogoutUri")
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<int>("IdentityTokenLifetime"); b.Property<int>("IdentityTokenLifetime")
.HasColumnType("int");
b.Property<bool>("IncludeJwtId"); b.Property<bool>("IncludeJwtId")
.HasColumnType("bit");
b.Property<DateTime?>("LastAccessed"); b.Property<DateTime?>("LastAccessed")
.HasColumnType("datetime2");
b.Property<string>("LogoUri") b.Property<string>("LogoUri")
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<bool>("NonEditable"); b.Property<bool>("NonEditable")
.HasColumnType("bit");
b.Property<string>("PairWiseSubjectSalt") b.Property<string>("PairWiseSubjectSalt")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ProtocolType") b.Property<string>("ProtocolType")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<int>("RefreshTokenExpiration"); b.Property<int>("RefreshTokenExpiration")
.HasColumnType("int");
b.Property<int>("RefreshTokenUsage"); b.Property<int>("RefreshTokenUsage")
.HasColumnType("int");
b.Property<bool>("RequireClientSecret"); b.Property<bool>("RequireClientSecret")
.HasColumnType("bit");
b.Property<bool>("RequireConsent"); b.Property<bool>("RequireConsent")
.HasColumnType("bit");
b.Property<bool>("RequirePkce"); b.Property<bool>("RequirePkce")
.HasColumnType("bit");
b.Property<int>("SlidingRefreshTokenLifetime"); b.Property<int>("SlidingRefreshTokenLifetime")
.HasColumnType("int");
b.Property<bool>("UpdateAccessTokenClaimsOnRefresh"); b.Property<bool>("UpdateAccessTokenClaimsOnRefresh")
.HasColumnType("bit");
b.Property<DateTime?>("Updated"); b.Property<DateTime?>("Updated")
.HasColumnType("datetime2");
b.Property<string>("UserCodeType") b.Property<string>("UserCodeType")
.HasMaxLength(100); .HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<int?>("UserSsoLifetime"); b.Property<int?>("UserSsoLifetime")
.HasColumnType("int");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId") b.HasIndex("ClientId")
.IsUnique(); .IsUnique();
b.ToTable("Clients"); b.ToTable("Clients", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientClaims"); b.ToTable("ClientClaims", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("Origin") b.Property<string>("Origin")
.IsRequired() .IsRequired()
.HasMaxLength(150); .HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientCorsOrigins"); b.ToTable("ClientCorsOrigins", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("GrantType") b.Property<string>("GrantType")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientGrantTypes"); b.ToTable("ClientGrantTypes", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("Provider") b.Property<string>("Provider")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientIdPRestrictions"); b.ToTable("ClientIdPRestrictions", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("PostLogoutRedirectUri") b.Property<string>("PostLogoutRedirectUri")
.IsRequired() .IsRequired()
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientPostLogoutRedirectUris"); b.ToTable("ClientPostLogoutRedirectUris", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("Key") b.Property<string>("Key")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientProperties"); b.ToTable("ClientProperties", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("RedirectUri") b.Property<string>("RedirectUri")
.IsRequired() .IsRequired()
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientRedirectUris"); b.ToTable("ClientRedirectUris", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("Scope") b.Property<string>("Scope")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientScopes"); b.ToTable("ClientScopes", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<DateTime>("Created"); b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<DateTime?>("Expiration"); b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasMaxLength(4000); .HasMaxLength(4000)
.HasColumnType("nvarchar(4000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientSecrets"); b.ToTable("ClientSecrets", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("IdentityResourceId"); b.Property<int>("IdentityResourceId")
.HasColumnType("int");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("IdentityResourceId"); b.HasIndex("IdentityResourceId");
b.ToTable("IdentityClaims"); b.ToTable("IdentityClaims", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<DateTime>("Created"); b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(1000); .HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<string>("DisplayName") b.Property<string>("DisplayName")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("Emphasize"); b.Property<bool>("Emphasize")
.HasColumnType("bit");
b.Property<bool>("Enabled"); b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("NonEditable"); b.Property<bool>("NonEditable")
.HasColumnType("bit");
b.Property<bool>("Required"); b.Property<bool>("Required")
.HasColumnType("bit");
b.Property<bool>("ShowInDiscoveryDocument"); b.Property<bool>("ShowInDiscoveryDocument")
.HasColumnType("bit");
b.Property<DateTime?>("Updated"); b.Property<DateTime?>("Updated")
.HasColumnType("datetime2");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("Name") b.HasIndex("Name")
.IsUnique(); .IsUnique();
b.ToTable("IdentityResources"); b.ToTable("IdentityResources", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("IdentityResourceId"); b.Property<int>("IdentityResourceId")
.HasColumnType("int");
b.Property<string>("Key") b.Property<string>("Key")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("IdentityResourceId"); b.HasIndex("IdentityResourceId");
b.ToTable("IdentityProperties"); b.ToTable("IdentityProperties", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b =>
@ -566,6 +693,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ApiResourceId") .HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("ApiResource");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b =>
@ -575,6 +704,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ApiResourceId") .HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("ApiResource");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b =>
@ -584,6 +715,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ApiResourceId") .HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("ApiResource");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b =>
@ -593,6 +726,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ApiScopeId") .HasForeignKey("ApiScopeId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("ApiScope");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b =>
@ -602,6 +737,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ApiResourceId") .HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("ApiResource");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b =>
@ -611,6 +748,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b =>
@ -620,6 +759,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b =>
@ -629,6 +770,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b =>
@ -638,6 +781,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
@ -647,6 +792,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
@ -656,6 +803,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
@ -665,6 +814,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b =>
@ -674,6 +825,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b =>
@ -683,6 +836,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b =>
@ -692,6 +847,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("IdentityResourceId") .HasForeignKey("IdentityResourceId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("IdentityResource");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b =>
@ -701,6 +858,52 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("IdentityResourceId") .HasForeignKey("IdentityResourceId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("IdentityResource");
});
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
{
b.Navigation("Properties");
b.Navigation("Scopes");
b.Navigation("Secrets");
b.Navigation("UserClaims");
});
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b =>
{
b.Navigation("UserClaims");
});
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b =>
{
b.Navigation("AllowedCorsOrigins");
b.Navigation("AllowedGrantTypes");
b.Navigation("AllowedScopes");
b.Navigation("Claims");
b.Navigation("ClientSecrets");
b.Navigation("IdentityProviderRestrictions");
b.Navigation("PostLogoutRedirectUris");
b.Navigation("Properties");
b.Navigation("RedirectUris");
});
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b =>
{
b.Navigation("Properties");
b.Navigation("UserClaims");
}); });
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }

View File

@ -1,10 +1,9 @@
using Microsoft.EntityFrameworkCore.Metadata; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using System;
namespace Identity.API.Migrations.ConfigurationDb namespace Identity.API.Migrations.ConfigurationDb
{ {
public partial class InitialConfigurationMigration : Migration public partial class InitialMigration : Migration
{ {
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
{ {
@ -12,16 +11,16 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ApiResources", name: "ApiResources",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Enabled = table.Column<bool>(nullable: false), Enabled = table.Column<bool>(type: "bit", nullable: false),
Name = table.Column<string>(maxLength: 200, nullable: false), Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true), DisplayName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true), Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
Created = table.Column<DateTime>(nullable: false), Created = table.Column<DateTime>(type: "datetime2", nullable: false),
Updated = table.Column<DateTime>(nullable: true), Updated = table.Column<DateTime>(type: "datetime2", nullable: true),
LastAccessed = table.Column<DateTime>(nullable: true), LastAccessed = table.Column<DateTime>(type: "datetime2", nullable: true),
NonEditable = table.Column<bool>(nullable: false) NonEditable = table.Column<bool>(type: "bit", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -32,49 +31,49 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "Clients", name: "Clients",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Enabled = table.Column<bool>(nullable: false), Enabled = table.Column<bool>(type: "bit", nullable: false),
ClientId = table.Column<string>(maxLength: 200, nullable: false), ClientId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
ProtocolType = table.Column<string>(maxLength: 200, nullable: false), ProtocolType = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
RequireClientSecret = table.Column<bool>(nullable: false), RequireClientSecret = table.Column<bool>(type: "bit", nullable: false),
ClientName = table.Column<string>(maxLength: 200, nullable: true), ClientName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true), Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
ClientUri = table.Column<string>(maxLength: 2000, nullable: true), ClientUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
LogoUri = table.Column<string>(maxLength: 2000, nullable: true), LogoUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
RequireConsent = table.Column<bool>(nullable: false), RequireConsent = table.Column<bool>(type: "bit", nullable: false),
AllowRememberConsent = table.Column<bool>(nullable: false), AllowRememberConsent = table.Column<bool>(type: "bit", nullable: false),
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(nullable: false), AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(type: "bit", nullable: false),
RequirePkce = table.Column<bool>(nullable: false), RequirePkce = table.Column<bool>(type: "bit", nullable: false),
AllowPlainTextPkce = table.Column<bool>(nullable: false), AllowPlainTextPkce = table.Column<bool>(type: "bit", nullable: false),
AllowAccessTokensViaBrowser = table.Column<bool>(nullable: false), AllowAccessTokensViaBrowser = table.Column<bool>(type: "bit", nullable: false),
FrontChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true), FrontChannelLogoutUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
FrontChannelLogoutSessionRequired = table.Column<bool>(nullable: false), FrontChannelLogoutSessionRequired = table.Column<bool>(type: "bit", nullable: false),
BackChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true), BackChannelLogoutUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
BackChannelLogoutSessionRequired = table.Column<bool>(nullable: false), BackChannelLogoutSessionRequired = table.Column<bool>(type: "bit", nullable: false),
AllowOfflineAccess = table.Column<bool>(nullable: false), AllowOfflineAccess = table.Column<bool>(type: "bit", nullable: false),
IdentityTokenLifetime = table.Column<int>(nullable: false), IdentityTokenLifetime = table.Column<int>(type: "int", nullable: false),
AccessTokenLifetime = table.Column<int>(nullable: false), AccessTokenLifetime = table.Column<int>(type: "int", nullable: false),
AuthorizationCodeLifetime = table.Column<int>(nullable: false), AuthorizationCodeLifetime = table.Column<int>(type: "int", nullable: false),
ConsentLifetime = table.Column<int>(nullable: true), ConsentLifetime = table.Column<int>(type: "int", nullable: true),
AbsoluteRefreshTokenLifetime = table.Column<int>(nullable: false), AbsoluteRefreshTokenLifetime = table.Column<int>(type: "int", nullable: false),
SlidingRefreshTokenLifetime = table.Column<int>(nullable: false), SlidingRefreshTokenLifetime = table.Column<int>(type: "int", nullable: false),
RefreshTokenUsage = table.Column<int>(nullable: false), RefreshTokenUsage = table.Column<int>(type: "int", nullable: false),
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(nullable: false), UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(type: "bit", nullable: false),
RefreshTokenExpiration = table.Column<int>(nullable: false), RefreshTokenExpiration = table.Column<int>(type: "int", nullable: false),
AccessTokenType = table.Column<int>(nullable: false), AccessTokenType = table.Column<int>(type: "int", nullable: false),
EnableLocalLogin = table.Column<bool>(nullable: false), EnableLocalLogin = table.Column<bool>(type: "bit", nullable: false),
IncludeJwtId = table.Column<bool>(nullable: false), IncludeJwtId = table.Column<bool>(type: "bit", nullable: false),
AlwaysSendClientClaims = table.Column<bool>(nullable: false), AlwaysSendClientClaims = table.Column<bool>(type: "bit", nullable: false),
ClientClaimsPrefix = table.Column<string>(maxLength: 200, nullable: true), ClientClaimsPrefix = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
PairWiseSubjectSalt = table.Column<string>(maxLength: 200, nullable: true), PairWiseSubjectSalt = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
Created = table.Column<DateTime>(nullable: false), Created = table.Column<DateTime>(type: "datetime2", nullable: false),
Updated = table.Column<DateTime>(nullable: true), Updated = table.Column<DateTime>(type: "datetime2", nullable: true),
LastAccessed = table.Column<DateTime>(nullable: true), LastAccessed = table.Column<DateTime>(type: "datetime2", nullable: true),
UserSsoLifetime = table.Column<int>(nullable: true), UserSsoLifetime = table.Column<int>(type: "int", nullable: true),
UserCodeType = table.Column<string>(maxLength: 100, nullable: true), UserCodeType = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
DeviceCodeLifetime = table.Column<int>(nullable: false), DeviceCodeLifetime = table.Column<int>(type: "int", nullable: false),
NonEditable = table.Column<bool>(nullable: false) NonEditable = table.Column<bool>(type: "bit", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -85,18 +84,18 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "IdentityResources", name: "IdentityResources",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Enabled = table.Column<bool>(nullable: false), Enabled = table.Column<bool>(type: "bit", nullable: false),
Name = table.Column<string>(maxLength: 200, nullable: false), Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true), DisplayName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true), Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
Required = table.Column<bool>(nullable: false), Required = table.Column<bool>(type: "bit", nullable: false),
Emphasize = table.Column<bool>(nullable: false), Emphasize = table.Column<bool>(type: "bit", nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(nullable: false), ShowInDiscoveryDocument = table.Column<bool>(type: "bit", nullable: false),
Created = table.Column<DateTime>(nullable: false), Created = table.Column<DateTime>(type: "datetime2", nullable: false),
Updated = table.Column<DateTime>(nullable: true), Updated = table.Column<DateTime>(type: "datetime2", nullable: true),
NonEditable = table.Column<bool>(nullable: false) NonEditable = table.Column<bool>(type: "bit", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -107,10 +106,10 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ApiClaims", name: "ApiClaims",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Type = table.Column<string>(maxLength: 200, nullable: false), ApiResourceId = table.Column<int>(type: "int", nullable: false),
ApiResourceId = table.Column<int>(nullable: false) Type = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -127,11 +126,11 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ApiProperties", name: "ApiProperties",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Key = table.Column<string>(maxLength: 250, nullable: false), ApiResourceId = table.Column<int>(type: "int", nullable: false),
Value = table.Column<string>(maxLength: 2000, nullable: false), Key = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
ApiResourceId = table.Column<int>(nullable: false) Value = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -148,15 +147,15 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ApiScopes", name: "ApiScopes",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(maxLength: 200, nullable: false), Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
DisplayName = table.Column<string>(maxLength: 200, nullable: true), DisplayName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true), Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
Required = table.Column<bool>(nullable: false), Required = table.Column<bool>(type: "bit", nullable: false),
Emphasize = table.Column<bool>(nullable: false), Emphasize = table.Column<bool>(type: "bit", nullable: false),
ShowInDiscoveryDocument = table.Column<bool>(nullable: false), ShowInDiscoveryDocument = table.Column<bool>(type: "bit", nullable: false),
ApiResourceId = table.Column<int>(nullable: false) ApiResourceId = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -173,14 +172,14 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ApiSecrets", name: "ApiSecrets",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Description = table.Column<string>(maxLength: 1000, nullable: true), ApiResourceId = table.Column<int>(type: "int", nullable: false),
Value = table.Column<string>(maxLength: 4000, nullable: false), Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
Expiration = table.Column<DateTime>(nullable: true), Value = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: false),
Type = table.Column<string>(maxLength: 250, nullable: false), Expiration = table.Column<DateTime>(type: "datetime2", nullable: true),
Created = table.Column<DateTime>(nullable: false), Type = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
ApiResourceId = table.Column<int>(nullable: false) Created = table.Column<DateTime>(type: "datetime2", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -197,11 +196,11 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ClientClaims", name: "ClientClaims",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Type = table.Column<string>(maxLength: 250, nullable: false), Type = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 250, nullable: false), Value = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
ClientId = table.Column<int>(nullable: false) ClientId = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -218,10 +217,10 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ClientCorsOrigins", name: "ClientCorsOrigins",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Origin = table.Column<string>(maxLength: 150, nullable: false), Origin = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
ClientId = table.Column<int>(nullable: false) ClientId = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -238,10 +237,10 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ClientGrantTypes", name: "ClientGrantTypes",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
GrantType = table.Column<string>(maxLength: 250, nullable: false), GrantType = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
ClientId = table.Column<int>(nullable: false) ClientId = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -258,10 +257,10 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ClientIdPRestrictions", name: "ClientIdPRestrictions",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Provider = table.Column<string>(maxLength: 200, nullable: false), Provider = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
ClientId = table.Column<int>(nullable: false) ClientId = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -278,10 +277,10 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ClientPostLogoutRedirectUris", name: "ClientPostLogoutRedirectUris",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
PostLogoutRedirectUri = table.Column<string>(maxLength: 2000, nullable: false), PostLogoutRedirectUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false),
ClientId = table.Column<int>(nullable: false) ClientId = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -298,11 +297,11 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ClientProperties", name: "ClientProperties",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Key = table.Column<string>(maxLength: 250, nullable: false), ClientId = table.Column<int>(type: "int", nullable: false),
Value = table.Column<string>(maxLength: 2000, nullable: false), Key = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
ClientId = table.Column<int>(nullable: false) Value = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -319,10 +318,10 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ClientRedirectUris", name: "ClientRedirectUris",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
RedirectUri = table.Column<string>(maxLength: 2000, nullable: false), RedirectUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false),
ClientId = table.Column<int>(nullable: false) ClientId = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -339,10 +338,10 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ClientScopes", name: "ClientScopes",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Scope = table.Column<string>(maxLength: 200, nullable: false), Scope = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
ClientId = table.Column<int>(nullable: false) ClientId = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -359,14 +358,14 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ClientSecrets", name: "ClientSecrets",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Description = table.Column<string>(maxLength: 2000, nullable: true), ClientId = table.Column<int>(type: "int", nullable: false),
Value = table.Column<string>(maxLength: 4000, nullable: false), Description = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
Expiration = table.Column<DateTime>(nullable: true), Value = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: false),
Type = table.Column<string>(maxLength: 250, nullable: false), Expiration = table.Column<DateTime>(type: "datetime2", nullable: true),
Created = table.Column<DateTime>(nullable: false), Type = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
ClientId = table.Column<int>(nullable: false) Created = table.Column<DateTime>(type: "datetime2", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -383,10 +382,10 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "IdentityClaims", name: "IdentityClaims",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Type = table.Column<string>(maxLength: 200, nullable: false), IdentityResourceId = table.Column<int>(type: "int", nullable: false),
IdentityResourceId = table.Column<int>(nullable: false) Type = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -403,11 +402,11 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "IdentityProperties", name: "IdentityProperties",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Key = table.Column<string>(maxLength: 250, nullable: false), IdentityResourceId = table.Column<int>(type: "int", nullable: false),
Value = table.Column<string>(maxLength: 2000, nullable: false), Key = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
IdentityResourceId = table.Column<int>(nullable: false) Value = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -424,10 +423,10 @@ namespace Identity.API.Migrations.ConfigurationDb
name: "ApiScopeClaims", name: "ApiScopeClaims",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), .Annotation("SqlServer:Identity", "1, 1"),
Type = table.Column<string>(maxLength: 200, nullable: false), ApiScopeId = table.Column<int>(type: "int", nullable: false),
ApiScopeId = table.Column<int>(nullable: false) Type = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false)
}, },
constraints: table => constraints: table =>
{ {

View File

@ -15,109 +15,133 @@ namespace Identity.API.Migrations.ConfigurationDb
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "3.0.0-preview7.19362.6")
.HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<DateTime>("Created"); b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(1000); .HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<string>("DisplayName") b.Property<string>("DisplayName")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("Enabled"); b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<DateTime?>("LastAccessed"); b.Property<DateTime?>("LastAccessed")
.HasColumnType("datetime2");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("NonEditable"); b.Property<bool>("NonEditable")
.HasColumnType("bit");
b.Property<DateTime?>("Updated"); b.Property<DateTime?>("Updated")
.HasColumnType("datetime2");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("Name") b.HasIndex("Name")
.IsUnique(); .IsUnique();
b.ToTable("ApiResources"); b.ToTable("ApiResources", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ApiResourceId"); b.Property<int>("ApiResourceId")
.HasColumnType("int");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ApiResourceId"); b.HasIndex("ApiResourceId");
b.ToTable("ApiClaims"); b.ToTable("ApiClaims", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ApiResourceId"); b.Property<int>("ApiResourceId")
.HasColumnType("int");
b.Property<string>("Key") b.Property<string>("Key")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ApiResourceId"); b.HasIndex("ApiResourceId");
b.ToTable("ApiProperties"); b.ToTable("ApiProperties", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ApiResourceId"); b.Property<int>("ApiResourceId")
.HasColumnType("int");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(1000); .HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<string>("DisplayName") b.Property<string>("DisplayName")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("Emphasize"); b.Property<bool>("Emphasize")
.HasColumnType("bit");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("Required"); b.Property<bool>("Required")
.HasColumnType("bit");
b.Property<bool>("ShowInDiscoveryDocument"); b.Property<bool>("ShowInDiscoveryDocument")
.HasColumnType("bit");
b.HasKey("Id"); b.HasKey("Id");
@ -126,435 +150,538 @@ namespace Identity.API.Migrations.ConfigurationDb
b.HasIndex("Name") b.HasIndex("Name")
.IsUnique(); .IsUnique();
b.ToTable("ApiScopes"); b.ToTable("ApiScopes", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ApiScopeId"); b.Property<int>("ApiScopeId")
.HasColumnType("int");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ApiScopeId"); b.HasIndex("ApiScopeId");
b.ToTable("ApiScopeClaims"); b.ToTable("ApiScopeClaims", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ApiResourceId"); b.Property<int>("ApiResourceId")
.HasColumnType("int");
b.Property<DateTime>("Created"); b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(1000); .HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<DateTime?>("Expiration"); b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasMaxLength(4000); .HasMaxLength(4000)
.HasColumnType("nvarchar(4000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ApiResourceId"); b.HasIndex("ApiResourceId");
b.ToTable("ApiSecrets"); b.ToTable("ApiSecrets", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("AbsoluteRefreshTokenLifetime"); b.Property<int>("AbsoluteRefreshTokenLifetime")
.HasColumnType("int");
b.Property<int>("AccessTokenLifetime"); b.Property<int>("AccessTokenLifetime")
.HasColumnType("int");
b.Property<int>("AccessTokenType"); b.Property<int>("AccessTokenType")
.HasColumnType("int");
b.Property<bool>("AllowAccessTokensViaBrowser"); b.Property<bool>("AllowAccessTokensViaBrowser")
.HasColumnType("bit");
b.Property<bool>("AllowOfflineAccess"); b.Property<bool>("AllowOfflineAccess")
.HasColumnType("bit");
b.Property<bool>("AllowPlainTextPkce"); b.Property<bool>("AllowPlainTextPkce")
.HasColumnType("bit");
b.Property<bool>("AllowRememberConsent"); b.Property<bool>("AllowRememberConsent")
.HasColumnType("bit");
b.Property<bool>("AlwaysIncludeUserClaimsInIdToken"); b.Property<bool>("AlwaysIncludeUserClaimsInIdToken")
.HasColumnType("bit");
b.Property<bool>("AlwaysSendClientClaims"); b.Property<bool>("AlwaysSendClientClaims")
.HasColumnType("bit");
b.Property<int>("AuthorizationCodeLifetime"); b.Property<int>("AuthorizationCodeLifetime")
.HasColumnType("int");
b.Property<bool>("BackChannelLogoutSessionRequired"); b.Property<bool>("BackChannelLogoutSessionRequired")
.HasColumnType("bit");
b.Property<string>("BackChannelLogoutUri") b.Property<string>("BackChannelLogoutUri")
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<string>("ClientClaimsPrefix") b.Property<string>("ClientClaimsPrefix")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ClientId") b.Property<string>("ClientId")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ClientName") b.Property<string>("ClientName")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ClientUri") b.Property<string>("ClientUri")
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<int?>("ConsentLifetime"); b.Property<int?>("ConsentLifetime")
.HasColumnType("int");
b.Property<DateTime>("Created"); b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(1000); .HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<int>("DeviceCodeLifetime"); b.Property<int>("DeviceCodeLifetime")
.HasColumnType("int");
b.Property<bool>("EnableLocalLogin"); b.Property<bool>("EnableLocalLogin")
.HasColumnType("bit");
b.Property<bool>("Enabled"); b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<bool>("FrontChannelLogoutSessionRequired"); b.Property<bool>("FrontChannelLogoutSessionRequired")
.HasColumnType("bit");
b.Property<string>("FrontChannelLogoutUri") b.Property<string>("FrontChannelLogoutUri")
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<int>("IdentityTokenLifetime"); b.Property<int>("IdentityTokenLifetime")
.HasColumnType("int");
b.Property<bool>("IncludeJwtId"); b.Property<bool>("IncludeJwtId")
.HasColumnType("bit");
b.Property<DateTime?>("LastAccessed"); b.Property<DateTime?>("LastAccessed")
.HasColumnType("datetime2");
b.Property<string>("LogoUri") b.Property<string>("LogoUri")
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<bool>("NonEditable"); b.Property<bool>("NonEditable")
.HasColumnType("bit");
b.Property<string>("PairWiseSubjectSalt") b.Property<string>("PairWiseSubjectSalt")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ProtocolType") b.Property<string>("ProtocolType")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<int>("RefreshTokenExpiration"); b.Property<int>("RefreshTokenExpiration")
.HasColumnType("int");
b.Property<int>("RefreshTokenUsage"); b.Property<int>("RefreshTokenUsage")
.HasColumnType("int");
b.Property<bool>("RequireClientSecret"); b.Property<bool>("RequireClientSecret")
.HasColumnType("bit");
b.Property<bool>("RequireConsent"); b.Property<bool>("RequireConsent")
.HasColumnType("bit");
b.Property<bool>("RequirePkce"); b.Property<bool>("RequirePkce")
.HasColumnType("bit");
b.Property<int>("SlidingRefreshTokenLifetime"); b.Property<int>("SlidingRefreshTokenLifetime")
.HasColumnType("int");
b.Property<bool>("UpdateAccessTokenClaimsOnRefresh"); b.Property<bool>("UpdateAccessTokenClaimsOnRefresh")
.HasColumnType("bit");
b.Property<DateTime?>("Updated"); b.Property<DateTime?>("Updated")
.HasColumnType("datetime2");
b.Property<string>("UserCodeType") b.Property<string>("UserCodeType")
.HasMaxLength(100); .HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<int?>("UserSsoLifetime"); b.Property<int?>("UserSsoLifetime")
.HasColumnType("int");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId") b.HasIndex("ClientId")
.IsUnique(); .IsUnique();
b.ToTable("Clients"); b.ToTable("Clients", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientClaims"); b.ToTable("ClientClaims", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("Origin") b.Property<string>("Origin")
.IsRequired() .IsRequired()
.HasMaxLength(150); .HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientCorsOrigins"); b.ToTable("ClientCorsOrigins", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("GrantType") b.Property<string>("GrantType")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientGrantTypes"); b.ToTable("ClientGrantTypes", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("Provider") b.Property<string>("Provider")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientIdPRestrictions"); b.ToTable("ClientIdPRestrictions", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("PostLogoutRedirectUri") b.Property<string>("PostLogoutRedirectUri")
.IsRequired() .IsRequired()
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientPostLogoutRedirectUris"); b.ToTable("ClientPostLogoutRedirectUris", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("Key") b.Property<string>("Key")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientProperties"); b.ToTable("ClientProperties", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("RedirectUri") b.Property<string>("RedirectUri")
.IsRequired() .IsRequired()
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientRedirectUris"); b.ToTable("ClientRedirectUris", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("Scope") b.Property<string>("Scope")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientScopes"); b.ToTable("ClientScopes", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("ClientId"); b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<DateTime>("Created"); b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<DateTime?>("Expiration"); b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasMaxLength(4000); .HasMaxLength(4000)
.HasColumnType("nvarchar(4000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("ClientId"); b.HasIndex("ClientId");
b.ToTable("ClientSecrets"); b.ToTable("ClientSecrets", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("IdentityResourceId"); b.Property<int>("IdentityResourceId")
.HasColumnType("int");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("IdentityResourceId"); b.HasIndex("IdentityResourceId");
b.ToTable("IdentityClaims"); b.ToTable("IdentityClaims", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<DateTime>("Created"); b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(1000); .HasMaxLength(1000)
.HasColumnType("nvarchar(1000)");
b.Property<string>("DisplayName") b.Property<string>("DisplayName")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("Emphasize"); b.Property<bool>("Emphasize")
.HasColumnType("bit");
b.Property<bool>("Enabled"); b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("NonEditable"); b.Property<bool>("NonEditable")
.HasColumnType("bit");
b.Property<bool>("Required"); b.Property<bool>("Required")
.HasColumnType("bit");
b.Property<bool>("ShowInDiscoveryDocument"); b.Property<bool>("ShowInDiscoveryDocument")
.HasColumnType("bit");
b.Property<DateTime?>("Updated"); b.Property<DateTime?>("Updated")
.HasColumnType("datetime2");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("Name") b.HasIndex("Name")
.IsUnique(); .IsUnique();
b.ToTable("IdentityResources"); b.ToTable("IdentityResources", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("IdentityResourceId"); b.Property<int>("IdentityResourceId")
.HasColumnType("int");
b.Property<string>("Key") b.Property<string>("Key")
.IsRequired() .IsRequired()
.HasMaxLength(250); .HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Value") b.Property<string>("Value")
.IsRequired() .IsRequired()
.HasMaxLength(2000); .HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("IdentityResourceId"); b.HasIndex("IdentityResourceId");
b.ToTable("IdentityProperties"); b.ToTable("IdentityProperties", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b =>
@ -564,6 +691,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ApiResourceId") .HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("ApiResource");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b =>
@ -573,6 +702,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ApiResourceId") .HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("ApiResource");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b =>
@ -582,6 +713,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ApiResourceId") .HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("ApiResource");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b =>
@ -591,6 +724,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ApiScopeId") .HasForeignKey("ApiScopeId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("ApiScope");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b =>
@ -600,6 +735,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ApiResourceId") .HasForeignKey("ApiResourceId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("ApiResource");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b =>
@ -609,6 +746,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b =>
@ -618,6 +757,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b =>
@ -627,6 +768,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b =>
@ -636,6 +779,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
@ -645,6 +790,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
@ -654,6 +801,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
@ -663,6 +812,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b =>
@ -672,6 +823,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b =>
@ -681,6 +834,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Client");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b =>
@ -690,6 +845,8 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("IdentityResourceId") .HasForeignKey("IdentityResourceId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("IdentityResource");
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b =>
@ -699,6 +856,52 @@ namespace Identity.API.Migrations.ConfigurationDb
.HasForeignKey("IdentityResourceId") .HasForeignKey("IdentityResourceId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("IdentityResource");
});
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
{
b.Navigation("Properties");
b.Navigation("Scopes");
b.Navigation("Secrets");
b.Navigation("UserClaims");
});
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b =>
{
b.Navigation("UserClaims");
});
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b =>
{
b.Navigation("AllowedCorsOrigins");
b.Navigation("AllowedGrantTypes");
b.Navigation("AllowedScopes");
b.Navigation("Claims");
b.Navigation("ClientSecrets");
b.Navigation("IdentityProviderRestrictions");
b.Navigation("PostLogoutRedirectUris");
b.Navigation("Properties");
b.Navigation("RedirectUris");
});
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b =>
{
b.Navigation("Properties");
b.Navigation("UserClaims");
}); });
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }

View File

@ -1,65 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
using System;
namespace Identity.API.Migrations.PersistedGrantDb
{
public partial class InitialPersistedGrantMigration : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DeviceCodes",
columns: table => new
{
UserCode = table.Column<string>(maxLength: 200, nullable: false),
DeviceCode = table.Column<string>(maxLength: 200, nullable: false),
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
Expiration = table.Column<DateTime>(nullable: false),
Data = table.Column<string>(maxLength: 50000, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DeviceCodes", x => x.UserCode);
});
migrationBuilder.CreateTable(
name: "PersistedGrants",
columns: table => new
{
Key = table.Column<string>(maxLength: 200, nullable: false),
Type = table.Column<string>(maxLength: 50, nullable: false),
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
ClientId = table.Column<string>(maxLength: 200, nullable: false),
CreationTime = table.Column<DateTime>(nullable: false),
Expiration = table.Column<DateTime>(nullable: true),
Data = table.Column<string>(maxLength: 50000, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PersistedGrants", x => x.Key);
});
migrationBuilder.CreateIndex(
name: "IX_DeviceCodes_DeviceCode",
table: "DeviceCodes",
column: "DeviceCode",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_PersistedGrants_SubjectId_ClientId_Type",
table: "PersistedGrants",
columns: new[] { "SubjectId", "ClientId", "Type" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DeviceCodes");
migrationBuilder.DropTable(
name: "PersistedGrants");
}
}
}

View File

@ -10,79 +10,97 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Identity.API.Migrations.PersistedGrantDb namespace Identity.API.Migrations.PersistedGrantDb
{ {
[DbContext(typeof(PersistedGrantDbContext))] [DbContext(typeof(PersistedGrantDbContext))]
[Migration("20190729092100_InitialPersistedGrantMigration")] [Migration("20210813072513_InitialMigration")]
partial class InitialPersistedGrantMigration partial class InitialMigration
{ {
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "3.0.0-preview7.19362.6")
.HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b =>
{ {
b.Property<string>("UserCode") b.Property<string>("UserCode")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ClientId") b.Property<string>("ClientId")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime>("CreationTime"); b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2");
b.Property<string>("Data") b.Property<string>("Data")
.IsRequired() .IsRequired()
.HasMaxLength(50000); .HasMaxLength(50000)
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceCode") b.Property<string>("DeviceCode")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime?>("Expiration") b.Property<DateTime?>("Expiration")
.IsRequired(); .IsRequired()
.HasColumnType("datetime2");
b.Property<string>("SubjectId") b.Property<string>("SubjectId")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("UserCode"); b.HasKey("UserCode");
b.HasIndex("DeviceCode") b.HasIndex("DeviceCode")
.IsUnique(); .IsUnique();
b.ToTable("DeviceCodes"); b.HasIndex("Expiration");
b.ToTable("DeviceCodes", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
{ {
b.Property<string>("Key") b.Property<string>("Key")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ClientId") b.Property<string>("ClientId")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime>("CreationTime"); b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2");
b.Property<string>("Data") b.Property<string>("Data")
.IsRequired() .IsRequired()
.HasMaxLength(50000); .HasMaxLength(50000)
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("Expiration"); b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
b.Property<string>("SubjectId") b.Property<string>("SubjectId")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(50); .HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Key"); b.HasKey("Key");
b.HasIndex("Expiration");
b.HasIndex("SubjectId", "ClientId", "Type"); b.HasIndex("SubjectId", "ClientId", "Type");
b.ToTable("PersistedGrants"); b.ToTable("PersistedGrants", (string)null);
}); });
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }

View File

@ -0,0 +1,75 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Identity.API.Migrations.PersistedGrantDb
{
public partial class InitialMigration : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DeviceCodes",
columns: table => new
{
UserCode = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
DeviceCode = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
SubjectId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
ClientId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
Expiration = table.Column<DateTime>(type: "datetime2", nullable: false),
Data = table.Column<string>(type: "nvarchar(max)", maxLength: 50000, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DeviceCodes", x => x.UserCode);
});
migrationBuilder.CreateTable(
name: "PersistedGrants",
columns: table => new
{
Key = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
Type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
SubjectId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
ClientId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
Expiration = table.Column<DateTime>(type: "datetime2", nullable: true),
Data = table.Column<string>(type: "nvarchar(max)", maxLength: 50000, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PersistedGrants", x => x.Key);
});
migrationBuilder.CreateIndex(
name: "IX_DeviceCodes_DeviceCode",
table: "DeviceCodes",
column: "DeviceCode",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_DeviceCodes_Expiration",
table: "DeviceCodes",
column: "Expiration");
migrationBuilder.CreateIndex(
name: "IX_PersistedGrants_Expiration",
table: "PersistedGrants",
column: "Expiration");
migrationBuilder.CreateIndex(
name: "IX_PersistedGrants_SubjectId_ClientId_Type",
table: "PersistedGrants",
columns: new[] { "SubjectId", "ClientId", "Type" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DeviceCodes");
migrationBuilder.DropTable(
name: "PersistedGrants");
}
}
}

View File

@ -15,72 +15,90 @@ namespace Identity.API.Migrations.PersistedGrantDb
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "3.0.0-preview7.19362.6")
.HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "6.0.0-preview.7.21378.4")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b =>
{ {
b.Property<string>("UserCode") b.Property<string>("UserCode")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ClientId") b.Property<string>("ClientId")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime>("CreationTime"); b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2");
b.Property<string>("Data") b.Property<string>("Data")
.IsRequired() .IsRequired()
.HasMaxLength(50000); .HasMaxLength(50000)
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceCode") b.Property<string>("DeviceCode")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime?>("Expiration") b.Property<DateTime?>("Expiration")
.IsRequired(); .IsRequired()
.HasColumnType("datetime2");
b.Property<string>("SubjectId") b.Property<string>("SubjectId")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.HasKey("UserCode"); b.HasKey("UserCode");
b.HasIndex("DeviceCode") b.HasIndex("DeviceCode")
.IsUnique(); .IsUnique();
b.ToTable("DeviceCodes"); b.HasIndex("Expiration");
b.ToTable("DeviceCodes", (string)null);
}); });
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
{ {
b.Property<string>("Key") b.Property<string>("Key")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("ClientId") b.Property<string>("ClientId")
.IsRequired() .IsRequired()
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<DateTime>("CreationTime"); b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2");
b.Property<string>("Data") b.Property<string>("Data")
.IsRequired() .IsRequired()
.HasMaxLength(50000); .HasMaxLength(50000)
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("Expiration"); b.Property<DateTime?>("Expiration")
.HasColumnType("datetime2");
b.Property<string>("SubjectId") b.Property<string>("SubjectId")
.HasMaxLength(200); .HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("Type") b.Property<string>("Type")
.IsRequired() .IsRequired()
.HasMaxLength(50); .HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Key"); b.HasKey("Key");
b.HasIndex("Expiration");
b.HasIndex("SubjectId", "ClientId", "Type"); b.HasIndex("SubjectId", "ClientId", "Type");
b.ToTable("PersistedGrants"); b.ToTable("PersistedGrants", (string)null);
}); });
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }

View File

@ -1,6 +1,4 @@
using System.Collections.Generic; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
{ {
public record ConsentInputModel public record ConsentInputModel
{ {

View File

@ -1,6 +1,4 @@
using IdentityServer4.Models; using IdentityServer4.Models;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
{ {

View File

@ -1,6 +1,4 @@
using System.ComponentModel.DataAnnotations; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
{ {
public record ForgotPasswordViewModel public record ForgotPasswordViewModel
{ {

View File

@ -1,6 +1,4 @@
using System.ComponentModel.DataAnnotations; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
{ {
public record LoginViewModel public record LoginViewModel
{ {

View File

@ -1,6 +1,4 @@
using System.ComponentModel.DataAnnotations; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
{ {
public record RegisterViewModel public record RegisterViewModel
{ {

View File

@ -1,6 +1,4 @@
using System.ComponentModel.DataAnnotations; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
{ {
public record ResetPasswordViewModel public record ResetPasswordViewModel
{ {

View File

@ -1,7 +1,4 @@
using Microsoft.AspNetCore.Mvc.Rendering; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
{ {
public record SendCodeViewModel public record SendCodeViewModel
{ {

View File

@ -1,6 +1,4 @@
using System.ComponentModel.DataAnnotations; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
{ {
public record VerifyCodeViewModel public record VerifyCodeViewModel
{ {

View File

@ -1,7 +1,4 @@
using Microsoft.AspNetCore.Identity; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models
using System.ComponentModel.DataAnnotations;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models
{ {
// Add profile data for application users by adding properties to the ApplicationUser class // Add profile data for application users by adding properties to the ApplicationUser class
public class ApplicationUser : IdentityUser public class ApplicationUser : IdentityUser

View File

@ -1,9 +1,5 @@
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using IdentityServer4.Models;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models namespace Microsoft.eShopOnContainers.Services.Identity.API.Models
{ {
public record ErrorViewModel public record ErrorViewModel

View File

@ -1,6 +1,4 @@
using System.ComponentModel.DataAnnotations; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
{ {
public record AddPhoneNumberViewModel public record AddPhoneNumberViewModel
{ {

View File

@ -1,6 +1,4 @@
using System.ComponentModel.DataAnnotations; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
{ {
public record ChangePasswordViewModel public record ChangePasswordViewModel
{ {

View File

@ -1,7 +1,4 @@
using Microsoft.AspNetCore.Mvc.Rendering; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
{ {
public record ConfigureTwoFactorViewModel public record ConfigureTwoFactorViewModel
{ {

View File

@ -1,7 +1,4 @@
using Microsoft.AspNetCore.Identity; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
{ {
public record IndexViewModel public record IndexViewModel
{ {

View File

@ -1,6 +1,4 @@
using System.ComponentModel.DataAnnotations; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
{ {
public record SetPasswordViewModel public record SetPasswordViewModel
{ {

View File

@ -1,6 +1,4 @@
using System.ComponentModel.DataAnnotations; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
{ {
public record VerifyPhoneNumberViewModel public record VerifyPhoneNumberViewModel
{ {

Some files were not shown because too many files have changed in this diff Show More