diff --git a/README.md b/README.md index 6bb6c6bff..a282b927e 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,6 @@ The application is written in the **Asp.Net Core MVC - using .NET Core 3.1** -**NOTE:** Currently works only with **IdentityServer4 version 3** 🚀 - ## Requirements - [Install](https://www.microsoft.com/net/download/windows#/current) the latest .NET Core 3.x SDK (using older versions may lead to 502.5 errors when hosted on IIS or application exiting immediately after starting when self-hosted) @@ -22,11 +20,23 @@ The application is written in the **Asp.Net Core MVC - using .NET Core 3.1** - Install the dotnet new template: +### Stable version 1.0.0 works with **IdentityServer4 version 3** 🚀 + ```sh dotnet new -i Skoruba.IdentityServer4.Admin.Templates::1.0.0 ``` -- Create new project: +### Beta version 2.0.0 works with **IdentityServer4 version 4** 🚀 + +- 🔒 **NOTE:** This version affects your database data if you use the default database migrations that are part of the project - double check the migrations according to your database provider and create a database backup + +- The source code for version **2.0.0** is available in the branch [release/2.0.0-beta1](https://github.com/skoruba/IdentityServer4.Admin/tree/release/2.0.0-beta1) + +```sh +dotnet new -i Skoruba.IdentityServer4.Admin.Templates::2.0.0-beta1 +``` + +### Create new project: ```sh dotnet new skoruba.is4admin --name MyProject --title MyProject --adminemail "admin@example.com" --adminpassword "Pa$$word123" --adminrole MyRole --adminclientid MyClientId --adminclientsecret MyClientSecret --dockersupport true @@ -161,11 +171,20 @@ docker-compose up -d ### Docker images - Docker images will be available also in [docker hub](https://hub.docker.com/u/skoruba) - AdminUI: + - **Stable version:** - `skoruba/identityserver4-admin:1.0.0` + - **Beta version:** + - `skoruba/identityserver4-admin:2.0.0-beta1` - Admin Api: + - **Stable version:** - `skoruba/identityserver4-admin-api:1.0.0` + - **Beta version:** + - `skoruba/identityserver4-admin-api:2.0.0-beta1` - STS: + - **Stable version:** - `skoruba/identityserver4-sts-identity:1.0.0` + - **Beta version:** + - `skoruba/identityserver4-sts-identity:2.0.0-beta1` ### Publish Docker images to Docker hub - Check the script in `build/publish-docker-images.ps1` - change the profile name according to your requirements. @@ -722,7 +741,7 @@ It is possible to define the configuration according the client type - by defaul - [x] Protect keys for dataprotection from Azure Key Vault ([#715](https://github.com/skoruba/IdentityServer4.Admin/pull/715)) ### 2.0.0 -- [ ] Update to IdentityServer4 version 4 ([#633](https://github.com/skoruba/IdentityServer4.Admin/issues/633)) +- [x] Update to IdentityServer4 version 4 ([#633](https://github.com/skoruba/IdentityServer4.Admin/issues/633)) ### 3.0.0: diff --git a/build/add-migrations.ps1 b/build/add-migrations.ps1 index cca076e0a..b9d56693c 100644 --- a/build/add-migrations.ps1 +++ b/build/add-migrations.ps1 @@ -1,4 +1,4 @@ -param([string] $migration = 'DbInit', [string] $migrationProviderName = 'All') +param([string] $migration = 'DbInit', [string] $migrationProviderName = 'All', [string] $targetContext = 'All') $projectName = "Skoruba.IdentityServer4"; $currentPath = Get-Location Set-Location "../src/$projectName.Admin" @@ -12,7 +12,7 @@ $targetContexts = @{ IdentityServerConfigurationDbContext = "Migrations\IdentityServerConfiguration"; IdentityServerPersistedGrantDbContext = "Migrations\IdentityServerGrants"; AdminAuditLogDbContext = "Migrations\AuditLogging"; - IdentityServerDataProtectionDbContext = "Migrations\DataProtection"; + IdentityServerDataProtectionDbContext = "Migrations\DataProtection"; } #Initialize the db providers and it's respective projects @@ -41,10 +41,14 @@ foreach ($provider in $dpProviders.Keys) { $settings | set-content appsettings.json if ((Test-Path $projectPath) -eq $true) { foreach ($context in $targetContexts.Keys) { - $migrationPath = $targetContexts[$context]; + + if ($targetContext -eq 'All' -or $context -eq $targetContext) { - Write-Host "Migrating context " $context - dotnet ef migrations add $migration -c $context -o $migrationPath -p $projectPath + $migrationPath = $targetContexts[$context]; + + Write-Host "Migrating context " $context + dotnet ef migrations add $migration -c $context -o $migrationPath -p $projectPath + } } } diff --git a/build/rollback-migrations.ps1 b/build/rollback-migrations.ps1 new file mode 100644 index 000000000..500b7b5a3 --- /dev/null +++ b/build/rollback-migrations.ps1 @@ -0,0 +1,59 @@ +param([string] $migration = 'DbInit', [string] $migrationProviderName = 'All', [string] $targetContext = 'All') +$projectName = "Skoruba.IdentityServer4"; +$currentPath = Get-Location +Set-Location "../src/$projectName.Admin" +Copy-Item appsettings.json -Destination appsettings-backup.json +$settings = Get-Content appsettings.json -raw + +#Initialze db context and define the target directory +$targetContexts = @{ + AdminIdentityDbContext = "Migrations\Identity" + AdminLogDbContext = "Migrations\Logging"; + IdentityServerConfigurationDbContext = "Migrations\IdentityServerConfiguration"; + IdentityServerPersistedGrantDbContext = "Migrations\IdentityServerGrants"; + AdminAuditLogDbContext = "Migrations\AuditLogging"; + IdentityServerDataProtectionDbContext = "Migrations\DataProtection"; +} + +#Initialize the db providers and it's respective projects +$dpProviders = @{ + SqlServer = "..\..\src\$projectName.Admin.EntityFramework.SqlServer\$projectName.Admin.EntityFramework.SqlServer.csproj"; + PostgreSQL = "..\..\src\$projectName.Admin.EntityFramework.PostgreSQL\$projectName.Admin.EntityFramework.PostgreSQL.csproj"; + MySql = "..\..\src\$projectName.Admin.EntityFramework.MySql\$projectName.Admin.EntityFramework.MySql.csproj"; +} + +#Fix issue when the tools is not installed and the nuget package does not work see https://github.com/MicrosoftDocs/azure-docs/issues/40048 +Write-Host "Updating donet ef tools" +$env:Path += " % USERPROFILE % \.dotnet\tools"; +dotnet tool update --global dotnet-ef + +Write-Host "Start migrate projects" +foreach ($provider in $dpProviders.Keys) { + + if ($migrationProviderName -eq 'All' -or $migrationProviderName -eq $provider) { + + $projectPath = (Get-Item -Path $dpProviders[$provider] -Verbose).FullName; + Write-Host "Generate migration for db provider:" $provider ", for project path - " $projectPath + + $providerName = '"ProviderType": "' + $provider + '"' + + $settings = $settings -replace '"ProviderType".*', $providerName + $settings | set-content appsettings.json + if ((Test-Path $projectPath) -eq $true) { + foreach ($context in $targetContexts.Keys) { + + if ($targetContext -eq 'All' -or $context -eq $targetContext) { + + Write-Host "Migrating context " $context + dotnet ef database update $migration -c $context -p $projectPath + } + } + } + + } +} + +Remove-Item appsettings.json +Copy-Item appsettings-backup.json -Destination appsettings.json +Remove-Item appsettings-backup.json +Set-Location $currentPath diff --git a/docker-compose.yml b/docker-compose.yml index abec58d02..2d8991a87 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -93,7 +93,6 @@ services: - 'ConnectionStrings__IdentityDbConnection=Server=db;Database=IdentityServer4Admin;User Id=sa;Password=${DB_PASSWORD:-Password_123};MultipleActiveResultSets=true' - 'ConnectionStrings__DataProtectionDbConnection=Server=db;Database=IdentityServer4Admin;User Id=sa;Password=${DB_PASSWORD:-Password_123};MultipleActiveResultSets=true' - 'AdminConfiguration__IdentityAdminBaseUrl=https://admin.skoruba.local' - - 'AdvancedConfiguration__PublicOrigin=https://sts.skoruba.local' - 'AdvancedConfiguration__IssuerUri=https://sts.skoruba.local' - DockerConfiguration__UpdateCaCertificate=true - ASPNETCORE_ENVIRONMENT=Development diff --git a/shared/identityserverdata.json b/shared/identityserverdata.json index b2d5c7ad6..04997e008 100644 --- a/shared/identityserverdata.json +++ b/shared/identityserverdata.json @@ -61,19 +61,22 @@ ] } ], + "ApiScopes": [ + { + "Name": "skoruba_identity_admin_api", + "DisplayName": "skoruba_identity_admin_api", + "Required": true, + "UserClaims": [ + "role", + "name" + ] + } + ], "ApiResources": [ { "Name": "skoruba_identity_admin_api", "Scopes": [ - { - "Name": "skoruba_identity_admin_api", - "DisplayName": "skoruba_identity_admin_api", - "Required": true, - "UserClaims": [ - "role", - "name" - ] - } + "skoruba_identity_admin_api" ] } ], diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Controllers/ApiResourcesController.cs b/src/Skoruba.IdentityServer4.Admin.Api/Controllers/ApiResourcesController.cs index 3cea3bc3c..a0de1d023 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Controllers/ApiResourcesController.cs +++ b/src/Skoruba.IdentityServer4.Admin.Api/Controllers/ApiResourcesController.cs @@ -1,250 +1,185 @@ -using System.Threading.Tasks; -using IdentityServer4.AccessTokenValidation; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Skoruba.IdentityServer4.Admin.Api.Configuration.Constants; -using Skoruba.IdentityServer4.Admin.Api.Dtos.ApiResources; -using Skoruba.IdentityServer4.Admin.Api.ExceptionHandling; -using Skoruba.IdentityServer4.Admin.Api.Mappers; -using Skoruba.IdentityServer4.Admin.Api.Resources; -using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; -using Skoruba.IdentityServer4.Admin.BusinessLogic.Services.Interfaces; - -namespace Skoruba.IdentityServer4.Admin.Api.Controllers -{ - [Route("api/[controller]")] - [ApiController] - [TypeFilter(typeof(ControllerExceptionFilterAttribute))] - [Produces("application/json", "application/problem+json")] - [Authorize(Policy = AuthorizationConsts.AdministrationPolicy)] - public class ApiResourcesController : ControllerBase - { - private readonly IApiResourceService _apiResourceService; - private readonly IApiErrorResources _errorResources; - - public ApiResourcesController(IApiResourceService apiResourceService, IApiErrorResources errorResources) - { - _apiResourceService = apiResourceService; - _errorResources = errorResources; - } - - [HttpGet] - public async Task> Get(string searchText, int page = 1, int pageSize = 10) - { - var apiResourcesDto = await _apiResourceService.GetApiResourcesAsync(searchText, page, pageSize); - var apiResourcesApiDto = apiResourcesDto.ToApiResourceApiModel(); - - return Ok(apiResourcesApiDto); - } - - [HttpGet("{id}")] - public async Task> Get(int id) - { - var apiResourceDto = await _apiResourceService.GetApiResourceAsync(id); - var apiResourceApiDto = apiResourceDto.ToApiResourceApiModel(); - - return Ok(apiResourceApiDto); - } - +using System.Threading.Tasks; +using IdentityServer4.AccessTokenValidation; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Skoruba.IdentityServer4.Admin.Api.Configuration.Constants; +using Skoruba.IdentityServer4.Admin.Api.Dtos.ApiResources; +using Skoruba.IdentityServer4.Admin.Api.ExceptionHandling; +using Skoruba.IdentityServer4.Admin.Api.Mappers; +using Skoruba.IdentityServer4.Admin.Api.Resources; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Services.Interfaces; + +namespace Skoruba.IdentityServer4.Admin.Api.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [TypeFilter(typeof(ControllerExceptionFilterAttribute))] + [Produces("application/json", "application/problem+json")] + [Authorize(Policy = AuthorizationConsts.AdministrationPolicy)] + public class ApiResourcesController : ControllerBase + { + private readonly IApiResourceService _apiResourceService; + private readonly IApiErrorResources _errorResources; + + public ApiResourcesController(IApiResourceService apiResourceService, IApiErrorResources errorResources) + { + _apiResourceService = apiResourceService; + _errorResources = errorResources; + } + + [HttpGet] + public async Task> Get(string searchText, int page = 1, int pageSize = 10) + { + var apiResourcesDto = await _apiResourceService.GetApiResourcesAsync(searchText, page, pageSize); + var apiResourcesApiDto = apiResourcesDto.ToApiResourceApiModel(); + + return Ok(apiResourcesApiDto); + } + + [HttpGet("{id}")] + public async Task> Get(int id) + { + var apiResourceDto = await _apiResourceService.GetApiResourceAsync(id); + var apiResourceApiDto = apiResourceDto.ToApiResourceApiModel(); + + return Ok(apiResourceApiDto); + } + [HttpPost] - [ProducesResponseType(201)] - [ProducesResponseType(400)] - public async Task Post([FromBody]ApiResourceApiDto apiResourceApi) - { - var apiResourceDto = apiResourceApi.ToApiResourceApiModel(); - - if (!apiResourceDto.Id.Equals(default)) - { - return BadRequest(_errorResources.CannotSetId()); - } - - var apiResourceId = await _apiResourceService.AddApiResourceAsync(apiResourceDto); - apiResourceApi.Id = apiResourceId; - - return CreatedAtAction(nameof(Get), new { id = apiResourceId }, apiResourceApi); - } - - [HttpPut] - public async Task Put([FromBody]ApiResourceApiDto apiResourceApi) - { - var apiResourceDto = apiResourceApi.ToApiResourceApiModel(); - - await _apiResourceService.GetApiResourceAsync(apiResourceDto.Id); - await _apiResourceService.UpdateApiResourceAsync(apiResourceDto); - - return Ok(); - } - - [HttpDelete("{id}")] - public async Task Delete(int id) - { - var apiResourceDto = new ApiResourceDto { Id = id }; - - await _apiResourceService.GetApiResourceAsync(apiResourceDto.Id); - await _apiResourceService.DeleteApiResourceAsync(apiResourceDto); - - return Ok(); - } - - [HttpGet("{id}/Scopes")] - public async Task> GetScopes(int id, int page = 1, int pageSize = 10) - { - var apiScopesDto = await _apiResourceService.GetApiScopesAsync(id, page, pageSize); - var apiScopesApiDto = apiScopesDto.ToApiResourceApiModel(); - - return Ok(apiScopesApiDto); - } - - [HttpGet("{id}/Scopes/{scopeId}")] - public async Task> GetScope(int id, int scopeId) - { - var apiScopesDto = await _apiResourceService.GetApiScopeAsync(id, scopeId); - var apiScopeApiDto = apiScopesDto.ToApiResourceApiModel(); - - return Ok(apiScopeApiDto); - } - - [HttpPost("{id}/Scopes")] - [ProducesResponseType(201)] - [ProducesResponseType(400)] - public async Task PostScope(int id, [FromBody]ApiScopeApiDto apiScopeApi) - { - var apiScope = apiScopeApi.ToApiResourceApiModel(); - apiScope.ApiResourceId = id; - - if (!apiScope.ApiScopeId.Equals(default)) - { - return BadRequest(_errorResources.CannotSetId()); - } - - await _apiResourceService.GetApiResourceAsync(apiScope.ApiResourceId); - var scopeId = await _apiResourceService.AddApiScopeAsync(apiScope); - apiScope.ApiScopeId = scopeId; - - return CreatedAtAction(nameof(GetScope), new { id, scopeId }, apiScope); - } - - [HttpPut("{id}/Scopes")] - public async Task PutScope(int id, [FromBody]ApiScopeApiDto apiScopeApi) - { - var apiScope = apiScopeApi.ToApiResourceApiModel(); - apiScope.ApiResourceId = id; - - await _apiResourceService.GetApiResourceAsync(apiScope.ApiResourceId); - await _apiResourceService.GetApiScopeAsync(apiScope.ApiResourceId, apiScope.ApiScopeId); - - await _apiResourceService.UpdateApiScopeAsync(apiScope); - - return Ok(); - } - - [HttpDelete("{id}/Scopes/{apiScopeId}")] - public async Task DeleteScope(int id, int apiScopeId) - { - var apiScope = new ApiScopesDto { ApiResourceId = id, ApiScopeId = apiScopeId }; - - await _apiResourceService.GetApiResourceAsync(apiScope.ApiResourceId); - await _apiResourceService.GetApiScopeAsync(apiScope.ApiResourceId, apiScope.ApiScopeId); - - await _apiResourceService.DeleteApiScopeAsync(apiScope); - - return Ok(); - } - - [HttpGet("{id}/Secrets")] - public async Task> GetSecrets(int id, int page = 1, int pageSize = 10) - { - var apiSecretsDto = await _apiResourceService.GetApiSecretsAsync(id, page, pageSize); - var apiSecretsApiDto = apiSecretsDto.ToApiResourceApiModel(); - - return Ok(apiSecretsApiDto); - } - - [HttpGet("Secrets/{secretId}")] - public async Task> GetSecret(int secretId) - { - var apiSecretsDto = await _apiResourceService.GetApiSecretAsync(secretId); - var apiSecretApiDto = apiSecretsDto.ToApiResourceApiModel(); - - return Ok(apiSecretApiDto); - } - + [ProducesResponseType(201)] + [ProducesResponseType(400)] + public async Task Post([FromBody]ApiResourceApiDto apiResourceApi) + { + var apiResourceDto = apiResourceApi.ToApiResourceApiModel(); + + if (!apiResourceDto.Id.Equals(default)) + { + return BadRequest(_errorResources.CannotSetId()); + } + + var apiResourceId = await _apiResourceService.AddApiResourceAsync(apiResourceDto); + apiResourceApi.Id = apiResourceId; + + return CreatedAtAction(nameof(Get), new { id = apiResourceId }, apiResourceApi); + } + + [HttpPut] + public async Task Put([FromBody]ApiResourceApiDto apiResourceApi) + { + var apiResourceDto = apiResourceApi.ToApiResourceApiModel(); + + await _apiResourceService.GetApiResourceAsync(apiResourceDto.Id); + await _apiResourceService.UpdateApiResourceAsync(apiResourceDto); + + return Ok(); + } + + [HttpDelete("{id}")] + public async Task Delete(int id) + { + var apiResourceDto = new ApiResourceDto { Id = id }; + + await _apiResourceService.GetApiResourceAsync(apiResourceDto.Id); + await _apiResourceService.DeleteApiResourceAsync(apiResourceDto); + + return Ok(); + } + + [HttpGet("{id}/Secrets")] + public async Task> GetSecrets(int id, int page = 1, int pageSize = 10) + { + var apiSecretsDto = await _apiResourceService.GetApiSecretsAsync(id, page, pageSize); + var apiSecretsApiDto = apiSecretsDto.ToApiResourceApiModel(); + + return Ok(apiSecretsApiDto); + } + + [HttpGet("Secrets/{secretId}")] + public async Task> GetSecret(int secretId) + { + var apiSecretsDto = await _apiResourceService.GetApiSecretAsync(secretId); + var apiSecretApiDto = apiSecretsDto.ToApiResourceApiModel(); + + return Ok(apiSecretApiDto); + } + [HttpPost("{id}/Secrets")] - [ProducesResponseType(201)] - [ProducesResponseType(400)] - public async Task PostSecret(int id, [FromBody]ApiSecretApiDto clientSecretApi) - { - var secretsDto = clientSecretApi.ToApiResourceApiModel(); - secretsDto.ApiResourceId = id; - - if (!secretsDto.ApiSecretId.Equals(default)) - { - return BadRequest(_errorResources.CannotSetId()); - } - + [ProducesResponseType(201)] + [ProducesResponseType(400)] + public async Task PostSecret(int id, [FromBody]ApiSecretApiDto clientSecretApi) + { + var secretsDto = clientSecretApi.ToApiResourceApiModel(); + secretsDto.ApiResourceId = id; + + if (!secretsDto.ApiSecretId.Equals(default)) + { + return BadRequest(_errorResources.CannotSetId()); + } + var secretId = await _apiResourceService.AddApiSecretAsync(secretsDto); clientSecretApi.Id = secretId; - return CreatedAtAction(nameof(GetSecret), new { secretId }, clientSecretApi); - } - - [HttpDelete("Secrets/{secretId}")] - public async Task DeleteSecret(int secretId) - { - var apiSecret = new ApiSecretsDto { ApiSecretId = secretId }; - - await _apiResourceService.GetApiSecretAsync(apiSecret.ApiSecretId); - await _apiResourceService.DeleteApiSecretAsync(apiSecret); - - return Ok(); - } - - [HttpGet("{id}/Properties")] - public async Task> GetProperties(int id, int page = 1, int pageSize = 10) - { - var apiResourcePropertiesDto = await _apiResourceService.GetApiResourcePropertiesAsync(id, page, pageSize); - var apiResourcePropertiesApiDto = apiResourcePropertiesDto.ToApiResourceApiModel(); - - return Ok(apiResourcePropertiesApiDto); - } - - [HttpGet("Properties/{propertyId}")] - public async Task> GetProperty(int propertyId) - { - var apiResourcePropertiesDto = await _apiResourceService.GetApiResourcePropertyAsync(propertyId); - var apiResourcePropertyApiDto = apiResourcePropertiesDto.ToApiResourceApiModel(); - - return Ok(apiResourcePropertyApiDto); - } - + return CreatedAtAction(nameof(GetSecret), new { secretId }, clientSecretApi); + } + + [HttpDelete("Secrets/{secretId}")] + public async Task DeleteSecret(int secretId) + { + var apiSecret = new ApiSecretsDto { ApiSecretId = secretId }; + + await _apiResourceService.GetApiSecretAsync(apiSecret.ApiSecretId); + await _apiResourceService.DeleteApiSecretAsync(apiSecret); + + return Ok(); + } + + [HttpGet("{id}/Properties")] + public async Task> GetProperties(int id, int page = 1, int pageSize = 10) + { + var apiResourcePropertiesDto = await _apiResourceService.GetApiResourcePropertiesAsync(id, page, pageSize); + var apiResourcePropertiesApiDto = apiResourcePropertiesDto.ToApiResourceApiModel(); + + return Ok(apiResourcePropertiesApiDto); + } + + [HttpGet("Properties/{propertyId}")] + public async Task> GetProperty(int propertyId) + { + var apiResourcePropertiesDto = await _apiResourceService.GetApiResourcePropertyAsync(propertyId); + var apiResourcePropertyApiDto = apiResourcePropertiesDto.ToApiResourceApiModel(); + + return Ok(apiResourcePropertyApiDto); + } + [HttpPost("{id}/Properties")] - [ProducesResponseType(201)] - [ProducesResponseType(400)] - public async Task PostProperty(int id, [FromBody]ApiResourcePropertyApiDto apiPropertyApi) - { - var apiResourcePropertiesDto = apiPropertyApi.ToApiResourceApiModel(); - apiResourcePropertiesDto.ApiResourceId = id; - - if (!apiResourcePropertiesDto.ApiResourcePropertyId.Equals(default)) - { - return BadRequest(_errorResources.CannotSetId()); - } - + [ProducesResponseType(201)] + [ProducesResponseType(400)] + public async Task PostProperty(int id, [FromBody]ApiResourcePropertyApiDto apiPropertyApi) + { + var apiResourcePropertiesDto = apiPropertyApi.ToApiResourceApiModel(); + apiResourcePropertiesDto.ApiResourceId = id; + + if (!apiResourcePropertiesDto.ApiResourcePropertyId.Equals(default)) + { + return BadRequest(_errorResources.CannotSetId()); + } + var propertyId = await _apiResourceService.AddApiResourcePropertyAsync(apiResourcePropertiesDto); apiPropertyApi.Id = propertyId; - return CreatedAtAction(nameof(GetProperty), new { propertyId }, apiPropertyApi); - } - - [HttpDelete("Properties/{propertyId}")] - public async Task DeleteProperty(int propertyId) - { - var apiResourceProperty = new ApiResourcePropertiesDto { ApiResourcePropertyId = propertyId }; - - await _apiResourceService.GetApiResourcePropertyAsync(apiResourceProperty.ApiResourcePropertyId); - await _apiResourceService.DeleteApiResourcePropertyAsync(apiResourceProperty); - - return Ok(); - } - } + return CreatedAtAction(nameof(GetProperty), new { propertyId }, apiPropertyApi); + } + + [HttpDelete("Properties/{propertyId}")] + public async Task DeleteProperty(int propertyId) + { + var apiResourceProperty = new ApiResourcePropertiesDto { ApiResourcePropertyId = propertyId }; + + await _apiResourceService.GetApiResourcePropertyAsync(apiResourceProperty.ApiResourcePropertyId); + await _apiResourceService.DeleteApiResourcePropertyAsync(apiResourceProperty); + + return Ok(); + } + } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Controllers/ApiScopesController.cs b/src/Skoruba.IdentityServer4.Admin.Api/Controllers/ApiScopesController.cs new file mode 100644 index 000000000..30e845abe --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.Api/Controllers/ApiScopesController.cs @@ -0,0 +1,140 @@ +using System.Threading.Tasks; +using IdentityServer4.AccessTokenValidation; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Skoruba.IdentityServer4.Admin.Api.Configuration.Constants; +using Skoruba.IdentityServer4.Admin.Api.Dtos.ApiResources; +using Skoruba.IdentityServer4.Admin.Api.Dtos.ApiScopes; +using Skoruba.IdentityServer4.Admin.Api.ExceptionHandling; +using Skoruba.IdentityServer4.Admin.Api.Mappers; +using Skoruba.IdentityServer4.Admin.Api.Resources; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Services.Interfaces; + +namespace Skoruba.IdentityServer4.Admin.Api.Controllers +{ + [Route("api/[controller]")] + [ApiController] + [TypeFilter(typeof(ControllerExceptionFilterAttribute))] + [Produces("application/json", "application/problem+json")] + [Authorize(Policy = AuthorizationConsts.AdministrationPolicy)] + public class ApiScopesController : ControllerBase + { + private readonly IApiErrorResources _errorResources; + private readonly IApiScopeService _apiScopeService; + + public ApiScopesController(IApiErrorResources errorResources, IApiScopeService apiScopeService) + { + _errorResources = errorResources; + _apiScopeService = apiScopeService; + } + + [HttpGet] + public async Task> GetScopes(string search, int page = 1, int pageSize = 10) + { + var apiScopesDto = await _apiScopeService.GetApiScopesAsync(search, page, pageSize); + var apiScopesApiDto = apiScopesDto.ToApiScopeApiModel(); + + return Ok(apiScopesApiDto); + } + + [HttpGet("{id}")] + public async Task> GetScope(int id) + { + var apiScopesDto = await _apiScopeService.GetApiScopeAsync(id); + var apiScopeApiDto = apiScopesDto.ToApiScopeApiModel(); + + return Ok(apiScopeApiDto); + } + + [HttpGet("{id}/Properties")] + public async Task> GetScopeProperties(int id, int page = 1, int pageSize = 10) + { + var apiScopePropertiesDto = await _apiScopeService.GetApiScopePropertiesAsync(id, page, pageSize); + var apiScopePropertiesApiDto = apiScopePropertiesDto.ToApiScopeApiModel(); + + return Ok(apiScopePropertiesApiDto); + } + + [HttpPost] + [ProducesResponseType(201)] + [ProducesResponseType(400)] + public async Task PostScope([FromBody]ApiScopeApiDto apiScopeApi) + { + var apiScope = apiScopeApi.ToApiScopeApiModel(); + + if (!apiScope.Id.Equals(default)) + { + return BadRequest(_errorResources.CannotSetId()); + } + + var id = await _apiScopeService.AddApiScopeAsync(apiScope); + apiScope.Id = id; + + return CreatedAtAction(nameof(GetScope), new {scopeId = id}, apiScope); + } + + [HttpPost("{id}/Properties")] + [ProducesResponseType(201)] + [ProducesResponseType(400)] + public async Task PostProperty(int id, [FromBody]ApiScopePropertyApiDto apiScopePropertyApi) + { + var apiResourcePropertiesDto = apiScopePropertyApi.ToApiScopeApiModel(); + apiResourcePropertiesDto.ApiScopeId = id; + + if (!apiResourcePropertiesDto.ApiScopePropertyId.Equals(default)) + { + return BadRequest(_errorResources.CannotSetId()); + } + + var propertyId = await _apiScopeService.AddApiScopePropertyAsync(apiResourcePropertiesDto); + apiScopePropertyApi.Id = propertyId; + + return CreatedAtAction(nameof(GetProperty), new { propertyId }, apiScopePropertyApi); + } + + [HttpGet("Properties/{propertyId}")] + public async Task> GetProperty(int propertyId) + { + var apiScopePropertyAsync = await _apiScopeService.GetApiScopePropertyAsync(propertyId); + var resourcePropertyApiDto = apiScopePropertyAsync.ToApiScopeApiModel(); + + return Ok(resourcePropertyApiDto); + } + + [HttpDelete("Properties/{propertyId}")] + public async Task DeleteProperty(int propertyId) + { + var apiScopePropertiesDto = new ApiScopePropertiesDto { ApiScopePropertyId = propertyId }; + + await _apiScopeService.GetApiScopePropertyAsync(apiScopePropertiesDto.ApiScopePropertyId); + await _apiScopeService.DeleteApiScopePropertyAsync(apiScopePropertiesDto); + + return Ok(); + } + + [HttpPut] + public async Task PutScope([FromBody]ApiScopeApiDto apiScopeApi) + { + var apiScope = apiScopeApi.ToApiScopeApiModel(); + + await _apiScopeService.GetApiScopeAsync(apiScope.Id); + + await _apiScopeService.UpdateApiScopeAsync(apiScope); + + return Ok(); + } + + [HttpDelete("{id}")] + public async Task DeleteScope(int id) + { + var apiScope = new ApiScopeDto { Id = id }; + + await _apiScopeService.GetApiScopeAsync(apiScope.Id); + + await _apiScopeService.DeleteApiScopeAsync(apiScope); + + return Ok(); + } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiResources/ApiResourceApiDto.cs b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiResources/ApiResourceApiDto.cs index 2b778f150..da9abd3e9 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiResources/ApiResourceApiDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiResources/ApiResourceApiDto.cs @@ -8,6 +8,8 @@ public class ApiResourceApiDto public ApiResourceApiDto() { UserClaims = new List(); + Scopes = new List(); + AllowedAccessTokenSigningAlgorithms = new List(); } public int Id { get; set; } @@ -21,6 +23,12 @@ public ApiResourceApiDto() public bool Enabled { get; set; } = true; + public bool ShowInDiscoveryDocument { get; set; } + public List UserClaims { get; set; } + + public List AllowedAccessTokenSigningAlgorithms { get; set; } + + public List Scopes { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiResources/ApiScopeApiDto.cs b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopeApiDto.cs similarity index 85% rename from src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiResources/ApiScopeApiDto.cs rename to src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopeApiDto.cs index b53bb72a6..f2e5a341f 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiResources/ApiScopeApiDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopeApiDto.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -namespace Skoruba.IdentityServer4.Admin.Api.Dtos.ApiResources +namespace Skoruba.IdentityServer4.Admin.Api.Dtos.ApiScopes { public class ApiScopeApiDto { @@ -25,6 +25,8 @@ public ApiScopeApiDto() public bool Emphasize { get; set; } + public bool Enabled { get; set; } = true; + public List UserClaims { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopePropertiesApiDto.cs b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopePropertiesApiDto.cs new file mode 100644 index 000000000..d80db30af --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopePropertiesApiDto.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; + +namespace Skoruba.IdentityServer4.Admin.Api.Dtos.ApiScopes +{ + public class ApiScopePropertiesApiDto + { + public ApiScopePropertiesApiDto() + { + ApiScopeProperties = new List(); + } + + public List ApiScopeProperties { get; set; } = new List(); + + public int TotalCount { get; set; } + + public int PageSize { get; set; } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopePropertyApiDto.cs b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopePropertyApiDto.cs new file mode 100644 index 000000000..f42636571 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopePropertyApiDto.cs @@ -0,0 +1,9 @@ +namespace Skoruba.IdentityServer4.Admin.Api.Dtos.ApiScopes +{ + public class ApiScopePropertyApiDto + { + public int Id { get; set; } + public string Key { get; set; } + public string Value { get; set; } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiResources/ApiScopesApiDto.cs b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopesApiDto.cs similarity index 84% rename from src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiResources/ApiScopesApiDto.cs rename to src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopesApiDto.cs index 51056753f..9a759ce05 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiResources/ApiScopesApiDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/ApiScopes/ApiScopesApiDto.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Skoruba.IdentityServer4.Admin.Api.Dtos.ApiResources +namespace Skoruba.IdentityServer4.Admin.Api.Dtos.ApiScopes { public class ApiScopesApiDto { diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/Clients/ClientApiDto.cs b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/Clients/ClientApiDto.cs index a10f11ef4..34d56c39a 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/Clients/ClientApiDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/Clients/ClientApiDto.cs @@ -94,5 +94,9 @@ public ClientApiDto() public int? UserSsoLifetime { get; set; } public string UserCodeType { get; set; } public int DeviceCodeLifetime { get; set; } = 300; + + public bool RequireRequestObject { get; set; } + + public List AllowedIdentityTokenSigningAlgorithms { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/PersistedGrants/PersistedGrantApiDto.cs b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/PersistedGrants/PersistedGrantApiDto.cs index 8678ec955..45e9b743c 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Dtos/PersistedGrants/PersistedGrantApiDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.Api/Dtos/PersistedGrants/PersistedGrantApiDto.cs @@ -12,5 +12,8 @@ public class PersistedGrantApiDto public DateTime CreationTime { get; set; } public DateTime? Expiration { get; set; } public string Data { get; set; } + public DateTime? ConsumedTime { get; set; } + public string SessionId { get; set; } + public string Description { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Mappers/ApiResourceApiMapperProfile.cs b/src/Skoruba.IdentityServer4.Admin.Api/Mappers/ApiResourceApiMapperProfile.cs index 69f1ad939..7444be73f 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Mappers/ApiResourceApiMapperProfile.cs +++ b/src/Skoruba.IdentityServer4.Admin.Api/Mappers/ApiResourceApiMapperProfile.cs @@ -15,17 +15,6 @@ public ApiResourceApiMapperProfile() CreateMap(MemberList.Destination) .ReverseMap(); - // Api Scopes - CreateMap(MemberList.Destination) - .ReverseMap(); - - CreateMap(MemberList.Destination) - .ReverseMap(); - - CreateMap(MemberList.Destination) - .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.ApiScopeId)) - .ReverseMap(); - // Api Secrets CreateMap(MemberList.Destination) .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.ApiSecretId)) diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Mappers/ApiScopeApiMapperProfile.cs b/src/Skoruba.IdentityServer4.Admin.Api/Mappers/ApiScopeApiMapperProfile.cs new file mode 100644 index 000000000..f373acf7e --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.Api/Mappers/ApiScopeApiMapperProfile.cs @@ -0,0 +1,30 @@ +using AutoMapper; +using Skoruba.IdentityServer4.Admin.Api.Dtos.ApiScopes; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; + +namespace Skoruba.IdentityServer4.Admin.Api.Mappers +{ + public class ApiScopeApiMapperProfile : Profile + { + public ApiScopeApiMapperProfile() + { + // Api Scopes + CreateMap(MemberList.Destination) + .ReverseMap(); + + CreateMap(MemberList.Destination) + .ReverseMap(); + + // Api Scope Properties + CreateMap(MemberList.Destination) + .ReverseMap(); + + CreateMap(MemberList.Destination) + .ReverseMap(); + + CreateMap(MemberList.Destination) + .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.ApiScopePropertyId)) + .ReverseMap(); + } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Mappers/ApiScopeApiMappers.cs b/src/Skoruba.IdentityServer4.Admin.Api/Mappers/ApiScopeApiMappers.cs new file mode 100644 index 000000000..47c7cbab0 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.Api/Mappers/ApiScopeApiMappers.cs @@ -0,0 +1,20 @@ +using AutoMapper; + +namespace Skoruba.IdentityServer4.Admin.Api.Mappers +{ + public static class ApiScopeApiMappers + { + static ApiScopeApiMappers() + { + Mapper = new MapperConfiguration(cfg => cfg.AddProfile()) + .CreateMapper(); + } + + internal static IMapper Mapper { get; } + + public static T ToApiScopeApiModel(this object source) + { + return Mapper.Map(source); + } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj b/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj index faadd0986..228cd021b 100644 --- a/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj +++ b/src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 1.0.0 + 2.0.0-beta1 Jan Škoruba InProcess 1cc472a2-4e4b-48ce-846b-5219f71fc643 @@ -16,34 +16,34 @@ - - - - + + + + - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - + + + - + @@ -75,3 +75,4 @@ + diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Dtos/Grant/PersistedGrantDto.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Dtos/Grant/PersistedGrantDto.cs index 59ab8668a..3f2293c37 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Dtos/Grant/PersistedGrantDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Dtos/Grant/PersistedGrantDto.cs @@ -2,15 +2,18 @@ namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.Dtos.Grant { - public class PersistedGrantDto - { - public string Key { get; set; } - public string Type { get; set; } - public string SubjectId { get; set; } - public string SubjectName { get; set; } - public string ClientId { get; set; } - public DateTime CreationTime { get; set; } - public DateTime? Expiration { get; set; } - public string Data { get; set; } - } + public class PersistedGrantDto + { + public string Key { get; set; } + public string Type { get; set; } + public string SubjectId { get; set; } + public string SubjectName { get; set; } + public string ClientId { get; set; } + public DateTime CreationTime { get; set; } + public DateTime? Expiration { get; set; } + public string Data { get; set; } + public DateTime? ConsumedTime { get; set; } + public string SessionId { get; set; } + public string Description { get; set; } + } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj index 03879551b..746cf4ee3 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 1.0.0 + 2.0.0-beta1 Jan Škoruba Business Logic layer for the administration of the Asp.Net Core Identity and IdentityServer4 IdentityServer4 Admin OpenIDConnect OAuth2 Identity @@ -12,8 +12,8 @@ - - + + @@ -33,3 +33,4 @@ + diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj index 679154900..27791119f 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared/Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 1.0.0 + 2.0.0-beta1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity Shared Business Logic layer for the administration of the IdentityServer4 and Asp.Net Core Identity @@ -16,3 +16,4 @@ + diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiResourceDto.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiResourceDto.cs index 7fe17e0ce..5cb18cb18 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiResourceDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiResourceDto.cs @@ -8,6 +8,8 @@ public class ApiResourceDto public ApiResourceDto() { UserClaims = new List(); + Scopes = new List(); + AllowedAccessTokenSigningAlgorithms = new List(); } public int Id { get; set; } @@ -24,5 +26,15 @@ public ApiResourceDto() public List UserClaims { get; set; } public string UserClaimsItems { get; set; } + + public bool ShowInDiscoveryDocument { get; set; } + + public List AllowedAccessTokenSigningAlgorithms { get; set; } + + public string AllowedAccessTokenSigningAlgorithmsItems { get; set; } + + public List Scopes { get; set; } + + public string ScopesItems { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopeDto.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopeDto.cs index 905fc5c02..490460109 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopeDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopeDto.cs @@ -26,5 +26,11 @@ public ApiScopeDto() public bool Emphasize { get; set; } public List UserClaims { get; set; } + + public string UserClaimsItems { get; set; } + + public bool Enabled { get; set; } = true; + + public List ApiScopeProperties { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopePropertiesDto.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopePropertiesDto.cs new file mode 100644 index 000000000..32072ea66 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopePropertiesDto.cs @@ -0,0 +1,26 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration +{ + public class ApiScopePropertiesDto + { + public int ApiScopePropertyId { get; set; } + + public int ApiScopeId { get; set; } + + public string ApiScopeName { get; set; } + + [Required] + public string Key { get; set; } + + [Required] + public string Value { get; set; } + + public List ApiScopeProperties { get; set; } = new List(); + + public int TotalCount { get; set; } + + public int PageSize { get; set; } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopePropertyDto.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopePropertyDto.cs new file mode 100644 index 000000000..673f55fe0 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopePropertyDto.cs @@ -0,0 +1,9 @@ +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration +{ + public class ApiScopePropertyDto + { + public int Id { get; set; } + public string Key { get; set; } + public string Value { get; set; } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopesDto.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopesDto.cs index cbfa15c58..7216f4217 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopesDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ApiScopesDto.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration { @@ -8,36 +7,12 @@ public class ApiScopesDto public ApiScopesDto() { Scopes = new List(); - UserClaims = new List(); } - - public int ApiResourceId { get; set; } - - public string ResourceName { get; set; } - - public bool ShowInDiscoveryDocument { get; set; } = true; - - public int ApiScopeId { get; set; } - - [Required] - public string Name { get; set; } - - public string DisplayName { get; set; } - - public string Description { get; set; } - - public bool Required { get; set; } - - public bool Emphasize { get; set; } - + public int PageSize { get; set; } public int TotalCount { get; set; } public List Scopes { get; set; } - - public List UserClaims { get; set; } - - public string UserClaimsItems { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ClientDto.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ClientDto.cs index d11d5a61c..55c75283d 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ClientDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Configuration/ClientDto.cs @@ -112,5 +112,11 @@ public ClientDto() public int DeviceCodeLifetime { get; set; } = 300; public bool NonEditable { get; set; } + + public bool RequireRequestObject { get; set; } + + public List AllowedIdentityTokenSigningAlgorithms { get; set; } + + public string AllowedIdentityTokenSigningAlgorithmsItems { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Grant/PersistedGrantDto.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Grant/PersistedGrantDto.cs index c1cc47f1c..91d3ded55 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Grant/PersistedGrantDto.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Dtos/Grant/PersistedGrantDto.cs @@ -12,5 +12,8 @@ public class PersistedGrantDto public DateTime CreationTime { get; set; } public DateTime? Expiration { get; set; } public string Data { get; set; } + public DateTime? ConsumedTime { get; set; } + public string SessionId { get; set; } + public string Description { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopeAddedEvent.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopeAddedEvent.cs similarity index 71% rename from src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopeAddedEvent.cs rename to src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopeAddedEvent.cs index 1376c4566..a4127b9ec 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopeAddedEvent.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopeAddedEvent.cs @@ -1,13 +1,13 @@ using Skoruba.AuditLogging.Events; using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; -namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiResource +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiScope { public class ApiScopeAddedEvent : AuditEvent { - public ApiScopesDto ApiScope { get; set; } + public ApiScopeDto ApiScope { get; set; } - public ApiScopeAddedEvent(ApiScopesDto apiScope) + public ApiScopeAddedEvent(ApiScopeDto apiScope) { ApiScope = apiScope; } diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopeDeletedEvent.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopeDeletedEvent.cs similarity index 71% rename from src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopeDeletedEvent.cs rename to src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopeDeletedEvent.cs index db8407d0d..11ac421f4 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopeDeletedEvent.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopeDeletedEvent.cs @@ -1,13 +1,13 @@ using Skoruba.AuditLogging.Events; using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; -namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiResource +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiScope { public class ApiScopeDeletedEvent : AuditEvent { - public ApiScopesDto ApiScope { get; set; } + public ApiScopeDto ApiScope { get; set; } - public ApiScopeDeletedEvent(ApiScopesDto apiScope) + public ApiScopeDeletedEvent(ApiScopeDto apiScope) { ApiScope = apiScope; } diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopePropertiesRequestedEvent.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopePropertiesRequestedEvent.cs new file mode 100644 index 000000000..fc113d7cf --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopePropertiesRequestedEvent.cs @@ -0,0 +1,17 @@ +using Skoruba.AuditLogging.Events; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiScope +{ + public class ApiScopePropertiesRequestedEvent : AuditEvent + { + public ApiScopePropertiesRequestedEvent(int apiScopeId, ApiScopePropertiesDto apiScopeProperties) + { + ApiScopeId = apiScopeId; + ApiResourceProperties = apiScopeProperties; + } + + public int ApiScopeId { get; set; } + public ApiScopePropertiesDto ApiResourceProperties { get; } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopePropertyAddedEvent.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopePropertyAddedEvent.cs new file mode 100644 index 000000000..f6b3e4cfb --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopePropertyAddedEvent.cs @@ -0,0 +1,15 @@ +using Skoruba.AuditLogging.Events; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiScope +{ + public class ApiScopePropertyAddedEvent : AuditEvent + { + public ApiScopePropertyAddedEvent(ApiScopePropertiesDto apiScopeProperty) + { + ApiScopeProperty = apiScopeProperty; + } + + public ApiScopePropertiesDto ApiScopeProperty { get; set; } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopePropertyDeletedEvent.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopePropertyDeletedEvent.cs new file mode 100644 index 000000000..50654abcd --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopePropertyDeletedEvent.cs @@ -0,0 +1,15 @@ +using Skoruba.AuditLogging.Events; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiScope +{ + public class ApiScopePropertyDeletedEvent : AuditEvent + { + public ApiScopePropertyDeletedEvent(ApiScopePropertiesDto apiScopeProperty) + { + ApiScopeProperty = apiScopeProperty; + } + + public ApiScopePropertiesDto ApiScopeProperty { get; set; } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopePropertyRequestedEvent.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopePropertyRequestedEvent.cs new file mode 100644 index 000000000..df30c587c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopePropertyRequestedEvent.cs @@ -0,0 +1,18 @@ +using Skoruba.AuditLogging.Events; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiScope +{ + public class ApiScopePropertyRequestedEvent : AuditEvent + { + public ApiScopePropertyRequestedEvent(int apiScopePropertyId, ApiScopePropertiesDto apiScopeProperty) + { + ApiScopePropertyId = apiScopePropertyId; + ApiScopeProperty = apiScopeProperty; + } + + public int ApiScopePropertyId { get; set; } + + public ApiScopePropertiesDto ApiScopeProperty { get; set; } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopeRequestedEvent.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopeRequestedEvent.cs similarity index 70% rename from src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopeRequestedEvent.cs rename to src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopeRequestedEvent.cs index 5886f3e17..a83f97f40 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopeRequestedEvent.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopeRequestedEvent.cs @@ -1,13 +1,13 @@ using Skoruba.AuditLogging.Events; using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; -namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiResource +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiScope { public class ApiScopeRequestedEvent : AuditEvent { - public ApiScopesDto ApiScopes { get; set; } + public ApiScopeDto ApiScopes { get; set; } - public ApiScopeRequestedEvent(ApiScopesDto apiScopes) + public ApiScopeRequestedEvent(ApiScopeDto apiScopes) { ApiScopes = apiScopes; } diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopeUpdatedEvent.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopeUpdatedEvent.cs similarity index 62% rename from src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopeUpdatedEvent.cs rename to src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopeUpdatedEvent.cs index 6580a6d34..8e451662f 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopeUpdatedEvent.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopeUpdatedEvent.cs @@ -1,14 +1,14 @@ using Skoruba.AuditLogging.Events; using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; -namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiResource +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiScope { public class ApiScopeUpdatedEvent : AuditEvent { - public ApiScopesDto OriginalApiScope { get; set; } - public ApiScopesDto ApiScope { get; set; } + public ApiScopeDto OriginalApiScope { get; set; } + public ApiScopeDto ApiScope { get; set; } - public ApiScopeUpdatedEvent(ApiScopesDto originalApiScope, ApiScopesDto apiScope) + public ApiScopeUpdatedEvent(ApiScopeDto originalApiScope, ApiScopeDto apiScope) { OriginalApiScope = originalApiScope; ApiScope = apiScope; diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopesRequestedEvent.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopesRequestedEvent.cs similarity index 97% rename from src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopesRequestedEvent.cs rename to src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopesRequestedEvent.cs index f5eaace1b..b69944b11 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiResource/ApiScopesRequestedEvent.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Events/ApiScope/ApiScopesRequestedEvent.cs @@ -1,7 +1,7 @@ using Skoruba.AuditLogging.Events; using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; -namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiResource +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiScope { public class ApiScopesRequestedEvent : AuditEvent { diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Extensions/AdminServicesExtensions.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Extensions/AdminServicesExtensions.cs index 55e49cfe7..a5ffa2496 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Extensions/AdminServicesExtensions.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Extensions/AdminServicesExtensions.cs @@ -27,18 +27,21 @@ public static IServiceCollection AddAdminServices>(); services.AddTransient>(); services.AddTransient>(); + services.AddTransient>(); services.AddTransient>(); services.AddTransient>(); //Services services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); //Resources services.AddScoped(); + services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiResourceMapperProfile.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiResourceMapperProfile.cs index 40269e396..dbe5f0d2c 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiResourceMapperProfile.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiResourceMapperProfile.cs @@ -7,6 +7,7 @@ using AutoMapper; using IdentityServer4.EntityFramework.Entities; using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Mappers.Converters; using Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.Common; namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Mappers @@ -17,22 +18,18 @@ public ApiResourceMapperProfile() { // entity to model CreateMap(MemberList.Destination) - .ForMember(x => x.UserClaims, opts => opts.MapFrom(src => src.UserClaims.Select(x => x.Type))); - - CreateMap(MemberList.Destination) - .ForMember(x => x.UserClaims, opt => opt.MapFrom(src => src.UserClaims.Select(x => x.Type))) - .ForMember(x => x.ApiResourceId, opt => opt.MapFrom(src => src.ApiResource.Id)) - .ForMember(x => x.ApiScopeId, opt => opt.MapFrom(src => src.Id)); - - CreateMap(MemberList.Destination) - .ForMember(x => x.UserClaims, opt => opt.MapFrom(src => src.UserClaims.Select(x => x.Type))); - - CreateMap(MemberList.Destination) + .ForMember(x => x.UserClaims, opts => opts.MapFrom(src => src.UserClaims.Select(x => x.Type))) + .ForMember(x => x.Scopes, opts => opts.MapFrom(src => src.Scopes.Select(x => x.Scope))) + .ForMember(x => x.AllowedAccessTokenSigningAlgorithms, + opts => opts.ConvertUsing(AllowedSigningAlgorithmsConverter.Converter, + x => x.AllowedAccessTokenSigningAlgorithms)); + + CreateMap(MemberList.Destination) .ForMember(dest => dest.Type, opt => opt.Condition(srs => srs != null)) .ForMember(x => x.ApiSecretId, opt => opt.MapFrom(x => x.Id)) .ForMember(x => x.ApiResourceId, opt => opt.MapFrom(x => x.ApiResource.Id)); - CreateMap(MemberList.Destination) + CreateMap(MemberList.Destination) .ForMember(dest => dest.Type, opt => opt.Condition(srs => srs != null)); CreateMap(MemberList.Destination) @@ -47,10 +44,7 @@ public ApiResourceMapperProfile() CreateMap, ApiResourcesDto>(MemberList.Destination) .ForMember(x => x.ApiResources, opt => opt.MapFrom(src => src.Data)); - CreateMap, ApiScopesDto>(MemberList.Destination) - .ForMember(x => x.Scopes, opt => opt.MapFrom(src => src.Data)); - - CreateMap, ApiSecretsDto>(MemberList.Destination) + CreateMap, ApiSecretsDto>(MemberList.Destination) .ForMember(x => x.ApiSecrets, opt => opt.MapFrom(src => src.Data)); CreateMap, ApiResourcePropertiesDto>(MemberList.Destination) @@ -58,19 +52,16 @@ public ApiResourceMapperProfile() // model to entity CreateMap(MemberList.Source) - .ForMember(x => x.UserClaims, opts => opts.MapFrom(src => src.UserClaims.Select(x => new ApiResourceClaim { Type = x }))); + .ForMember(x => x.UserClaims, opts => opts.MapFrom(src => src.UserClaims.Select(x => new ApiResourceClaim { Type = x }))) + .ForMember(x => x.Scopes, opts => opts.MapFrom(src => src.Scopes.Select(x => new ApiResourceScope { Scope = x}))) + .ForMember(x => x.AllowedAccessTokenSigningAlgorithms, + opts => opts.ConvertUsing(AllowedSigningAlgorithmsConverter.Converter, + x => x.AllowedAccessTokenSigningAlgorithms)); - CreateMap(MemberList.Source) + CreateMap(MemberList.Source) .ForMember(x => x.ApiResource, opts => opts.MapFrom(src => new ApiResource() { Id = src.ApiResourceId })) .ForMember(x => x.Id, opt => opt.MapFrom(src => src.ApiSecretId)); - CreateMap(MemberList.Source) - .ForMember(x => x.UserClaims, opts => opts.MapFrom(src => src.UserClaims.Select(x => new ApiScopeClaim { Type = x }))) - .ForMember(x => x.Id, opt => opt.MapFrom(src => src.ApiScopeId)); - - CreateMap(MemberList.Source) - .ForMember(x => x.UserClaims, opts => opts.MapFrom(src => src.UserClaims.Select(x => new ApiScopeClaim { Type = x }))); - CreateMap(MemberList.Source) .ForMember(x => x.ApiResource, dto => dto.MapFrom(src => new ApiResource() { Id = src.ApiResourceId })) .ForMember(x => x.Id, opt => opt.MapFrom(src => src.ApiResourcePropertyId)); diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiResourceMappers.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiResourceMappers.cs index e5d5295cd..b49def1af 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiResourceMappers.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiResourceMappers.cs @@ -35,22 +35,12 @@ public static ApiResourcePropertiesDto ToModel(this ApiResourceProperty apiResou return Mapper.Map(apiResourceProperty); } - public static ApiSecretsDto ToModel(this PagedList secrets) + public static ApiSecretsDto ToModel(this PagedList secrets) { return secrets == null ? null : Mapper.Map(secrets); } - public static ApiScopesDto ToModel(this PagedList scopes) - { - return scopes == null ? null : Mapper.Map(scopes); - } - - public static ApiScopesDto ToModel(this ApiScope resource) - { - return resource == null ? null : Mapper.Map(resource); - } - - public static ApiSecretsDto ToModel(this ApiSecret resource) + public static ApiSecretsDto ToModel(this ApiResourceSecret resource) { return resource == null ? null : Mapper.Map(resource); } @@ -60,14 +50,9 @@ public static ApiResource ToEntity(this ApiResourceDto resource) return resource == null ? null : Mapper.Map(resource); } - public static ApiSecret ToEntity(this ApiSecretsDto resource) - { - return resource == null ? null : Mapper.Map(resource); - } - - public static ApiScope ToEntity(this ApiScopesDto resource) + public static ApiResourceSecret ToEntity(this ApiSecretsDto resource) { - return resource == null ? null : Mapper.Map(resource); + return resource == null ? null : Mapper.Map(resource); } public static ApiResourceProperty ToEntity(this ApiResourcePropertiesDto apiResourceProperties) diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiScopeMapperProfile.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiScopeMapperProfile.cs new file mode 100644 index 000000000..aac2b982a --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiScopeMapperProfile.cs @@ -0,0 +1,47 @@ +// Based on the IdentityServer4.EntityFramework - authors - Brock Allen & Dominick Baier. +// https://github.com/IdentityServer/IdentityServer4.EntityFramework + +// Modified by Jan Škoruba + +using System.Linq; +using AutoMapper; +using IdentityServer4.EntityFramework.Entities; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; +using Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.Common; + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Mappers +{ + public class ApiScopeMapperProfile : Profile + { + public ApiScopeMapperProfile() + { + // entity to model + CreateMap(MemberList.Destination) + .ForMember(x => x.UserClaims, opt => opt.MapFrom(src => src.UserClaims.Select(x => x.Type))); + + CreateMap(MemberList.Destination) + .ReverseMap(); + + CreateMap(MemberList.Destination) + .ForMember(dest => dest.Key, opt => opt.Condition(srs => srs != null)) + .ForMember(x => x.ApiScopePropertyId, opt => opt.MapFrom(x => x.Id)) + .ForMember(x => x.ApiScopeId, opt => opt.MapFrom(x => x.Scope.Id)); + + // PagedLists + CreateMap, ApiScopesDto>(MemberList.Destination) + .ForMember(x => x.Scopes, opt => opt.MapFrom(src => src.Data)); + + CreateMap, ApiScopePropertiesDto>(MemberList.Destination) + .ForMember(x => x.ApiScopeProperties, opt => opt.MapFrom(src => src.Data)); + + // model to entity + CreateMap(MemberList.Source) + .ForMember(x => x.UserClaims, opts => opts.MapFrom(src => src.UserClaims.Select(x => new ApiScopeClaim { Type = x }))); + + CreateMap(MemberList.Source) + .ForMember(x => x.Scope, dto => dto.MapFrom(src => new ApiScope { Id = src.ApiScopeId })) + .ForMember(x => x.ScopeId, dto => dto.MapFrom(src => src.ApiScopeId)) + .ForMember(x => x.Id, opt => opt.MapFrom(src => src.ApiScopePropertyId)); + } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiScopeMappers.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiScopeMappers.cs new file mode 100644 index 000000000..0bcf58023 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ApiScopeMappers.cs @@ -0,0 +1,48 @@ +using AutoMapper; +using IdentityServer4.EntityFramework.Entities; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; +using Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.Common; + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Mappers +{ + public static class ApiScopeMappers + { + static ApiScopeMappers() + { + Mapper = new MapperConfiguration(cfg => cfg.AddProfile()) + .CreateMapper(); + } + + internal static IMapper Mapper { get; } + + public static ApiScopesDto ToModel(this PagedList scopes) + { + return scopes == null ? null : Mapper.Map(scopes); + } + + public static ApiScopeDto ToModel(this ApiScope resource) + { + return resource == null ? null : Mapper.Map(resource); + } + + public static ApiScope ToEntity(this ApiScopeDto resource) + { + return resource == null ? null : Mapper.Map(resource); + } + + public static ApiScopeProperty ToEntity(this ApiScopePropertiesDto resource) + { + return resource == null ? null : Mapper.Map(resource); + } + + public static ApiScopePropertiesDto ToModel(this PagedList scope) + { + return scope == null ? null : Mapper.Map(scope); + } + + public static ApiScopePropertiesDto ToModel(this ApiScopeProperty scope) + { + return scope == null ? null : Mapper.Map(scope); + } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ClientMapperProfile.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ClientMapperProfile.cs index b283fe522..be9e50069 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ClientMapperProfile.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/ClientMapperProfile.cs @@ -6,6 +6,7 @@ using AutoMapper; using IdentityServer4.EntityFramework.Entities; using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Mappers.Converters; using Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.Dtos.Common; using Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.Common; @@ -18,7 +19,9 @@ public ClientMapperProfile() // entity to model CreateMap(MemberList.Destination) .ForMember(dest => dest.ProtocolType, opt => opt.Condition(srs => srs != null)) - .ReverseMap(); + .ForMember(x => x.AllowedIdentityTokenSigningAlgorithms, opts => opts.ConvertUsing(AllowedSigningAlgorithmsConverter.Converter, x => x.AllowedIdentityTokenSigningAlgorithms)) + .ReverseMap() + .ForMember(x => x.AllowedIdentityTokenSigningAlgorithms, opts => opts.ConvertUsing(AllowedSigningAlgorithmsConverter.Converter, x => x.AllowedIdentityTokenSigningAlgorithms)); CreateMap(MemberList.Destination) .ReverseMap(); diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/Converters/AllowedSigningAlgorithmsConverter.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/Converters/AllowedSigningAlgorithmsConverter.cs new file mode 100644 index 000000000..732a545ed --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/Converters/AllowedSigningAlgorithmsConverter.cs @@ -0,0 +1,42 @@ +// 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. + +// Modified by Jan Škoruba - original file: https://github.com/IdentityServer/IdentityServer4/blob/main/src/EntityFramework.Storage/src/Mappers/AllowedSigningAlgorithmsConverter.cs + +using System; +using System.Collections.Generic; +using System.Linq; +using AutoMapper; + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Mappers.Converters +{ + public class AllowedSigningAlgorithmsConverter : + IValueConverter, string>, + IValueConverter> + { + public static AllowedSigningAlgorithmsConverter Converter = new AllowedSigningAlgorithmsConverter(); + + public string Convert(List sourceMember, ResolutionContext context) + { + if (sourceMember == null || !sourceMember.Any()) + { + return null; + } + return sourceMember.Aggregate((x, y) => $"{x},{y}"); + } + + public List Convert(string sourceMember, ResolutionContext context) + { + var list = new List(); + if (!String.IsNullOrWhiteSpace(sourceMember)) + { + sourceMember = sourceMember.Trim(); + foreach (var item in sourceMember.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Distinct()) + { + list.Add(item); + } + } + return list; + } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/IdentityResourceMapperProfile.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/IdentityResourceMapperProfile.cs index 9be6dafc8..4afe97aef 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/IdentityResourceMapperProfile.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Mappers/IdentityResourceMapperProfile.cs @@ -36,7 +36,7 @@ public IdentityResourceMapperProfile() // model to entity CreateMap(MemberList.Source) - .ForMember(x => x.UserClaims, opts => opts.MapFrom(src => src.UserClaims.Select(x => new IdentityClaim { Type = x }))); + .ForMember(x => x.UserClaims, opts => opts.MapFrom(src => src.UserClaims.Select(x => new IdentityResourceClaim { Type = x }))); CreateMap(MemberList.Source) .ForMember(x => x.IdentityResource, dto => dto.MapFrom(src => new IdentityResource() { Id = src.IdentityResourceId })) diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiResourceServiceResource.Designer.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiResourceServiceResource.Designer.cs index e7c0c8baf..bc97e8ebc 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiResourceServiceResource.Designer.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiResourceServiceResource.Designer.cs @@ -19,7 +19,7 @@ namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Resources { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class ApiResourceServiceResource { @@ -114,33 +114,6 @@ internal static string ApiResourcePropertyExistsValue { } } - /// - /// Looks up a localized string similar to Api Scope with id {0} doesn't exist. - /// - internal static string ApiScopeDoesNotExist { - get { - return ResourceManager.GetString("ApiScopeDoesNotExist", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Api Scope already exists. - /// - internal static string ApiScopeExistsKey { - get { - return ResourceManager.GetString("ApiScopeExistsKey", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Api Scope ({0}) already exists. - /// - internal static string ApiScopeExistsValue { - get { - return ResourceManager.GetString("ApiScopeExistsValue", resourceCulture); - } - } - /// /// Looks up a localized string similar to Api Secret with id {0} doesn't exist. /// diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiResourceServiceResource.resx b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiResourceServiceResource.resx index fe4ff1e4a..6ae0a4ee8 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiResourceServiceResource.resx +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiResourceServiceResource.resx @@ -135,15 +135,6 @@ Api Resource Property with key ({0}) already exists - - Api Scope with id {0} doesn't exist - - - Api Scope already exists - - - Api Scope ({0}) already exists - Api Secret with id {0} doesn't exist diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiResourceServiceResources.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiResourceServiceResources.cs index e298474da..c62db7ba5 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiResourceServiceResources.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiResourceServiceResources.cs @@ -31,33 +31,6 @@ public virtual ResourceMessage ApiResourceExistsKey() }; } - public virtual ResourceMessage ApiScopeDoesNotExist() - { - return new ResourceMessage() - { - Code = nameof(ApiScopeDoesNotExist), - Description = ApiResourceServiceResource.ApiScopeDoesNotExist - }; - } - - public virtual ResourceMessage ApiScopeExistsValue() - { - return new ResourceMessage() - { - Code = nameof(ApiScopeExistsValue), - Description = ApiResourceServiceResource.ApiScopeExistsValue - }; - } - - public virtual ResourceMessage ApiScopeExistsKey() - { - return new ResourceMessage() - { - Code = nameof(ApiScopeExistsKey), - Description = ApiResourceServiceResource.ApiScopeExistsKey - }; - } - public virtual ResourceMessage ApiSecretDoesNotExist() { return new ResourceMessage() diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiScopeServiceResource.Designer.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiScopeServiceResource.Designer.cs new file mode 100644 index 000000000..881151a92 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiScopeServiceResource.Designer.cs @@ -0,0 +1,117 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class ApiScopeServiceResource { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal ApiScopeServiceResource() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Skoruba.IdentityServer4.Admin.BusinessLogic.Resources.ApiScopeServiceResource", typeof(ApiScopeServiceResource).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Api Scope with id {0} doesn't exist. + /// + public static string ApiScopeDoesNotExist { + get { + return ResourceManager.GetString("ApiScopeDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Api Scope already exists. + /// + public static string ApiScopeExistsKey { + get { + return ResourceManager.GetString("ApiScopeExistsKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Api Scope ({0}) already exists. + /// + public static string ApiScopeExistsValue { + get { + return ResourceManager.GetString("ApiScopeExistsValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Api Scope Property with id {0} doesn't exist. + /// + public static string ApiScopePropertyDoesNotExist { + get { + return ResourceManager.GetString("ApiScopePropertyDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Api Scope Property already exists. + /// + public static string ApiScopePropertyExistsKey { + get { + return ResourceManager.GetString("ApiScopePropertyExistsKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Api Scope Property ({0}) already exists. + /// + public static string ApiScopePropertyExistsValue { + get { + return ResourceManager.GetString("ApiScopePropertyExistsValue", resourceCulture); + } + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiScopeServiceResource.resx b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiScopeServiceResource.resx new file mode 100644 index 000000000..afe458470 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiScopeServiceResource.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Api Scope with id {0} doesn't exist + + + Api Scope already exists + + + Api Scope ({0}) already exists + + + Api Scope Property with id {0} doesn't exist + + + Api Scope Property already exists + + + Api Scope Property ({0}) already exists + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiScopeServiceResources.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiScopeServiceResources.cs new file mode 100644 index 000000000..1356b610f --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/ApiScopeServiceResources.cs @@ -0,0 +1,61 @@ +using Skoruba.IdentityServer4.Admin.BusinessLogic.Helpers; + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Resources +{ + public class ApiScopeServiceResources : IApiScopeServiceResources + { + public virtual ResourceMessage ApiScopeDoesNotExist() + { + return new ResourceMessage() + { + Code = nameof(ApiScopeDoesNotExist), + Description = ApiScopeServiceResource.ApiScopeDoesNotExist + }; + } + + public virtual ResourceMessage ApiScopeExistsValue() + { + return new ResourceMessage() + { + Code = nameof(ApiScopeExistsValue), + Description = ApiScopeServiceResource.ApiScopeExistsValue + }; + } + + public virtual ResourceMessage ApiScopeExistsKey() + { + return new ResourceMessage() + { + Code = nameof(ApiScopeExistsKey), + Description = ApiScopeServiceResource.ApiScopeExistsKey + }; + } + + public ResourceMessage ApiScopePropertyExistsValue() + { + return new ResourceMessage() + { + Code = nameof(ApiScopePropertyExistsValue), + Description = ApiScopeServiceResource.ApiScopePropertyExistsValue + }; + } + + public ResourceMessage ApiScopePropertyDoesNotExist() + { + return new ResourceMessage() + { + Code = nameof(ApiScopePropertyDoesNotExist), + Description = ApiScopeServiceResource.ApiScopePropertyDoesNotExist + }; + } + + public ResourceMessage ApiScopePropertyExistsKey() + { + return new ResourceMessage() + { + Code = nameof(ApiScopePropertyExistsKey), + Description = ApiScopeServiceResource.ApiScopePropertyExistsKey + }; + } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/IApiResourceServiceResources.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/IApiResourceServiceResources.cs index 36adde013..6e2db856c 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/IApiResourceServiceResources.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/IApiResourceServiceResources.cs @@ -7,9 +7,6 @@ public interface IApiResourceServiceResources ResourceMessage ApiResourceDoesNotExist(); ResourceMessage ApiResourceExistsValue(); ResourceMessage ApiResourceExistsKey(); - ResourceMessage ApiScopeDoesNotExist(); - ResourceMessage ApiScopeExistsValue(); - ResourceMessage ApiScopeExistsKey(); ResourceMessage ApiSecretDoesNotExist(); ResourceMessage ApiResourcePropertyDoesNotExist(); ResourceMessage ApiResourcePropertyExistsKey(); diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/IApiScopeServiceResources.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/IApiScopeServiceResources.cs new file mode 100644 index 000000000..d75e0358d --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Resources/IApiScopeServiceResources.cs @@ -0,0 +1,14 @@ +using Skoruba.IdentityServer4.Admin.BusinessLogic.Helpers; + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Resources +{ + public interface IApiScopeServiceResources + { + ResourceMessage ApiScopeDoesNotExist(); + ResourceMessage ApiScopeExistsValue(); + ResourceMessage ApiScopeExistsKey(); + ResourceMessage ApiScopePropertyExistsValue(); + ResourceMessage ApiScopePropertyDoesNotExist(); + ResourceMessage ApiScopePropertyExistsKey(); + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ApiResourceService.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ApiResourceService.cs index cc5d51ab6..5c3923983 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ApiResourceService.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ApiResourceService.cs @@ -195,73 +195,6 @@ public virtual async Task CanInsertApiResourceAsync(ApiResourceDto apiReso return await ApiResourceRepository.CanInsertApiResourceAsync(resource); } - public virtual async Task GetApiScopesAsync(int apiResourceId, int page = 1, int pageSize = 10) - { - var apiResource = await ApiResourceRepository.GetApiResourceAsync(apiResourceId); - if (apiResource == null) throw new UserFriendlyErrorPageException(string.Format(ApiResourceServiceResources.ApiResourceDoesNotExist().Description, apiResourceId), ApiResourceServiceResources.ApiResourceDoesNotExist().Description); - - var pagedList = await ApiResourceRepository.GetApiScopesAsync(apiResourceId, page, pageSize); - - var apiScopesDto = pagedList.ToModel(); - apiScopesDto.ApiResourceId = apiResourceId; - apiScopesDto.ResourceName = await GetApiResourceNameAsync(apiResourceId); - - await AuditEventLogger.LogEventAsync(new ApiScopesRequestedEvent(apiScopesDto)); - - return apiScopesDto; - } - - public virtual async Task GetApiScopeAsync(int apiResourceId, int apiScopeId) - { - var apiResource = await ApiResourceRepository.GetApiResourceAsync(apiResourceId); - if (apiResource == null) throw new UserFriendlyErrorPageException(string.Format(ApiResourceServiceResources.ApiResourceDoesNotExist().Description, apiResourceId), ApiResourceServiceResources.ApiResourceDoesNotExist().Description); - - var apiScope = await ApiResourceRepository.GetApiScopeAsync(apiResourceId, apiScopeId); - if (apiScope == null) throw new UserFriendlyErrorPageException(string.Format(ApiResourceServiceResources.ApiScopeDoesNotExist().Description, apiScopeId), ApiResourceServiceResources.ApiScopeDoesNotExist().Description); - - var apiScopesDto = apiScope.ToModel(); - apiScopesDto.ResourceName = await GetApiResourceNameAsync(apiResourceId); - - await AuditEventLogger.LogEventAsync(new ApiScopeRequestedEvent(apiScopesDto)); - - return apiScopesDto; - } - - public virtual async Task AddApiScopeAsync(ApiScopesDto apiScope) - { - var canInsert = await CanInsertApiScopeAsync(apiScope); - if (!canInsert) - { - await BuildApiScopesViewModelAsync(apiScope); - throw new UserFriendlyViewException(string.Format(ApiResourceServiceResources.ApiScopeExistsValue().Description, apiScope.Name), ApiResourceServiceResources.ApiScopeExistsKey().Description, apiScope); - } - - var scope = apiScope.ToEntity(); - - var added = await ApiResourceRepository.AddApiScopeAsync(apiScope.ApiResourceId, scope); - - await AuditEventLogger.LogEventAsync(new ApiScopeAddedEvent(apiScope)); - - return added; - } - - public virtual ApiScopesDto BuildApiScopeViewModel(ApiScopesDto apiScope) - { - ComboBoxHelpers.PopulateValuesToList(apiScope.UserClaimsItems, apiScope.UserClaims); - - return apiScope; - } - - private async Task BuildApiScopesViewModelAsync(ApiScopesDto apiScope) - { - if (apiScope.ApiScopeId == 0) - { - var apiScopesDto = await GetApiScopesAsync(apiScope.ApiResourceId); - apiScope.Scopes.AddRange(apiScopesDto.Scopes); - apiScope.TotalCount = apiScopesDto.TotalCount; - } - } - private async Task BuildApiResourcePropertiesViewModelAsync(ApiResourcePropertiesDto apiResourceProperties) { var apiResourcePropertiesDto = await GetApiResourcePropertiesAsync(apiResourceProperties.ApiResourceId); @@ -269,37 +202,6 @@ private async Task BuildApiResourcePropertiesViewModelAsync(ApiResourcePropertie apiResourceProperties.TotalCount = apiResourcePropertiesDto.TotalCount; } - public virtual async Task UpdateApiScopeAsync(ApiScopesDto apiScope) - { - var canInsert = await CanInsertApiScopeAsync(apiScope); - if (!canInsert) - { - await BuildApiScopesViewModelAsync(apiScope); - throw new UserFriendlyViewException(string.Format(ApiResourceServiceResources.ApiScopeExistsValue().Description, apiScope.Name), ApiResourceServiceResources.ApiScopeExistsKey().Description, apiScope); - } - - var scope = apiScope.ToEntity(); - - var originalApiScope = await GetApiScopeAsync(apiScope.ApiResourceId, apiScope.ApiScopeId); - - var updated = await ApiResourceRepository.UpdateApiScopeAsync(apiScope.ApiResourceId, scope); - - await AuditEventLogger.LogEventAsync(new ApiScopeUpdatedEvent(originalApiScope, apiScope)); - - return updated; - } - - public virtual async Task DeleteApiScopeAsync(ApiScopesDto apiScope) - { - var scope = apiScope.ToEntity(); - - var deleted = await ApiResourceRepository.DeleteApiScopeAsync(scope); - - await AuditEventLogger.LogEventAsync(new ApiScopeDeletedEvent(apiScope)); - - return deleted; - } - public virtual async Task GetApiSecretsAsync(int apiResourceId, int page = 1, int pageSize = 10) { var apiResource = await ApiResourceRepository.GetApiResourceAsync(apiResourceId); @@ -351,13 +253,6 @@ public virtual async Task DeleteApiSecretAsync(ApiSecretsDto apiSecret) return deleted; } - public virtual async Task CanInsertApiScopeAsync(ApiScopesDto apiScopes) - { - var apiScope = apiScopes.ToEntity(); - - return await ApiResourceRepository.CanInsertApiScopeAsync(apiScope); - } - public virtual async Task GetApiResourceNameAsync(int apiResourceId) { return await ApiResourceRepository.GetApiResourceNameAsync(apiResourceId); diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ApiScopeService.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ApiScopeService.cs new file mode 100644 index 000000000..8655d7a47 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ApiScopeService.cs @@ -0,0 +1,196 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using IdentityServer4.EntityFramework.Entities; +using Skoruba.AuditLogging.Services; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Events.ApiScope; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Helpers; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Mappers; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Resources; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Services.Interfaces; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Shared.ExceptionHandling; +using Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.Common; +using Skoruba.IdentityServer4.Admin.EntityFramework.Repositories.Interfaces; + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Services +{ + public class ApiScopeService : IApiScopeService + { + protected readonly IApiScopeRepository ApiScopeRepository; + protected readonly IApiScopeServiceResources ApiScopeServiceResources; + protected readonly IAuditEventLogger AuditEventLogger; + + public ApiScopeService(IApiScopeServiceResources apiScopeServiceResources, IApiScopeRepository apiScopeRepository, IAuditEventLogger auditEventLogger) + { + ApiScopeRepository = apiScopeRepository; + AuditEventLogger = auditEventLogger; + ApiScopeServiceResources = apiScopeServiceResources; + + } + + public virtual async Task GetApiScopesAsync(string search, int page = 1, int pageSize = 10) + { + var pagedList = await ApiScopeRepository.GetApiScopesAsync(search, page, pageSize); + + var apiScopesDto = pagedList.ToModel(); + + await AuditEventLogger.LogEventAsync(new ApiScopesRequestedEvent(apiScopesDto)); + + return apiScopesDto; + } + + public virtual async Task> GetApiScopesNameAsync(string scope, int limit = 0) + { + var scopes = await ApiScopeRepository.GetApiScopesNameAsync(scope, limit); + + return scopes; + } + + public virtual async Task GetApiScopePropertiesAsync(int apiScopeId, int page = 1, int pageSize = 10) + { + var apiScope = await ApiScopeRepository.GetApiScopeAsync(apiScopeId); + if (apiScope == null) + throw new UserFriendlyErrorPageException(string.Format(ApiScopeServiceResources.ApiScopeDoesNotExist().Description, apiScopeId), ApiScopeServiceResources.ApiScopeDoesNotExist().Description); + + PagedList pagedList = await ApiScopeRepository.GetApiScopePropertiesAsync(apiScopeId, page, pageSize); + var apiScopePropertiesDto = pagedList.ToModel(); + apiScopePropertiesDto.ApiScopeId = apiScopeId; + apiScopePropertiesDto.ApiScopeName = await ApiScopeRepository.GetApiScopeNameAsync(apiScopeId); + + await AuditEventLogger.LogEventAsync(new ApiScopePropertiesRequestedEvent(apiScopeId, apiScopePropertiesDto)); + + return apiScopePropertiesDto; + } + + public virtual async Task GetApiScopeAsync(int apiScopeId) + { + var apiScope = await ApiScopeRepository.GetApiScopeAsync(apiScopeId); + if (apiScope == null) throw new UserFriendlyErrorPageException(string.Format(ApiScopeServiceResources.ApiScopeDoesNotExist().Description, apiScopeId), ApiScopeServiceResources.ApiScopeDoesNotExist().Description); + + var apiScopeDto = apiScope.ToModel(); + + await AuditEventLogger.LogEventAsync(new ApiScopeRequestedEvent(apiScopeDto)); + + return apiScopeDto; + } + + public virtual async Task AddApiScopeAsync(ApiScopeDto apiScope) + { + var canInsert = await CanInsertApiScopeAsync(apiScope); + if (!canInsert) + { + throw new UserFriendlyViewException(string.Format(ApiScopeServiceResources.ApiScopeExistsValue().Description, apiScope.Name), ApiScopeServiceResources.ApiScopeExistsKey().Description, apiScope); + } + + var scope = apiScope.ToEntity(); + + var added = await ApiScopeRepository.AddApiScopeAsync(scope); + + await AuditEventLogger.LogEventAsync(new ApiScopeAddedEvent(apiScope)); + + return added; + } + + public virtual ApiScopeDto BuildApiScopeViewModel(ApiScopeDto apiScope) + { + ComboBoxHelpers.PopulateValuesToList(apiScope.UserClaimsItems, apiScope.UserClaims); + + return apiScope; + } + + public virtual async Task UpdateApiScopeAsync(ApiScopeDto apiScope) + { + var canInsert = await CanInsertApiScopeAsync(apiScope); + if (!canInsert) + { + throw new UserFriendlyViewException(string.Format(ApiScopeServiceResources.ApiScopeExistsValue().Description, apiScope.Name), ApiScopeServiceResources.ApiScopeExistsKey().Description, apiScope); + } + + var scope = apiScope.ToEntity(); + + var originalApiScope = await GetApiScopeAsync(apiScope.Id); + + var updated = await ApiScopeRepository.UpdateApiScopeAsync(scope); + + await AuditEventLogger.LogEventAsync(new ApiScopeUpdatedEvent(originalApiScope, apiScope)); + + return updated; + } + + public virtual async Task DeleteApiScopeAsync(ApiScopeDto apiScope) + { + var scope = apiScope.ToEntity(); + + var deleted = await ApiScopeRepository.DeleteApiScopeAsync(scope); + + await AuditEventLogger.LogEventAsync(new ApiScopeDeletedEvent(apiScope)); + + return deleted; + } + + public virtual async Task CanInsertApiScopeAsync(ApiScopeDto apiScopeDto) + { + var apiScope = apiScopeDto.ToEntity(); + + return await ApiScopeRepository.CanInsertApiScopeAsync(apiScope); + } + + public virtual async Task GetApiScopePropertyAsync(int apiScopePropertyId) + { + var apiScopeProperty = await ApiScopeRepository.GetApiScopePropertyAsync(apiScopePropertyId); + if (apiScopeProperty == null) throw new UserFriendlyErrorPageException(string.Format(ApiScopeServiceResources.ApiScopePropertyDoesNotExist().Description, apiScopePropertyId)); + + var apiScopePropertiesDto = apiScopeProperty.ToModel(); + apiScopePropertiesDto.ApiScopeId = apiScopeProperty.ScopeId; + apiScopePropertiesDto.ApiScopeName = await ApiScopeRepository.GetApiScopeNameAsync(apiScopeProperty.ScopeId); + + await AuditEventLogger.LogEventAsync(new ApiScopePropertyRequestedEvent(apiScopePropertyId, apiScopePropertiesDto)); + + return apiScopePropertiesDto; + } + + private async Task BuildApiScopePropertiesViewModelAsync(ApiScopePropertiesDto apiScopeProperties) + { + var apiResourcePropertiesDto = await GetApiScopePropertiesAsync(apiScopeProperties.ApiScopeId); + apiScopeProperties.ApiScopeProperties.AddRange(apiResourcePropertiesDto.ApiScopeProperties); + apiScopeProperties.TotalCount = apiResourcePropertiesDto.TotalCount; + } + + public virtual async Task AddApiScopePropertyAsync(ApiScopePropertiesDto apiScopeProperties) + { + var canInsert = await CanInsertApiScopePropertyAsync(apiScopeProperties); + if (!canInsert) + { + await BuildApiScopePropertiesViewModelAsync(apiScopeProperties); + throw new UserFriendlyViewException(string.Format(ApiScopeServiceResources.ApiScopePropertyExistsValue().Description, apiScopeProperties.Key), ApiScopeServiceResources.ApiScopePropertyExistsKey().Description, apiScopeProperties); + } + + var apiScopeProperty = apiScopeProperties.ToEntity(); + + var saved = await ApiScopeRepository.AddApiScopePropertyAsync(apiScopeProperties.ApiScopeId, apiScopeProperty); + + await AuditEventLogger.LogEventAsync(new ApiScopePropertyAddedEvent(apiScopeProperties)); + + return saved; + } + + public virtual async Task DeleteApiScopePropertyAsync(ApiScopePropertiesDto apiScopeProperty) + { + var propertyEntity = apiScopeProperty.ToEntity(); + + var deleted = await ApiScopeRepository.DeleteApiScopePropertyAsync(propertyEntity); + + await AuditEventLogger.LogEventAsync(new ApiScopePropertyDeletedEvent(apiScopeProperty)); + + return deleted; + } + + public virtual async Task CanInsertApiScopePropertyAsync(ApiScopePropertiesDto apiResourceProperty) + { + var resource = apiResourceProperty.ToEntity(); + + return await ApiScopeRepository.CanInsertApiScopePropertyAsync(resource); + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ClientService.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ClientService.cs index 5d40295d8..0a9567e52 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ClientService.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/ClientService.cs @@ -88,6 +88,7 @@ private void PopulateClientRelations(ClientDto client) ComboBoxHelpers.PopulateValuesToList(client.RedirectUrisItems, client.RedirectUris); ComboBoxHelpers.PopulateValuesToList(client.AllowedCorsOriginsItems, client.AllowedCorsOrigins); ComboBoxHelpers.PopulateValuesToList(client.AllowedGrantTypesItems, client.AllowedGrantTypes); + ComboBoxHelpers.PopulateValuesToList(client.AllowedIdentityTokenSigningAlgorithmsItems, client.AllowedIdentityTokenSigningAlgorithms); } public virtual ClientCloneDto BuildClientCloneViewModel(int id, ClientDto clientDto) @@ -273,6 +274,13 @@ public virtual List GetAccessTokenTypes() return accessTokenTypes; } + public virtual List GetSigningAlgorithms(string algorithm, int limit = 0) + { + var signingAlgorithms = ClientRepository.GetSigningAlgorithms(algorithm, limit); + + return signingAlgorithms; + } + public virtual List GetTokenExpirations() { var tokenExpirations = ClientRepository.GetTokenExpirations().ToModel(); diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IApiResourceService.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IApiResourceService.cs index d38677247..cf7a304b5 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IApiResourceService.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IApiResourceService.cs @@ -7,8 +7,6 @@ public interface IApiResourceService { ApiSecretsDto BuildApiSecretsViewModel(ApiSecretsDto apiSecrets); - ApiScopesDto BuildApiScopeViewModel(ApiScopesDto apiScope); - Task GetApiResourcesAsync(string search, int page = 1, int pageSize = 10); Task GetApiResourcePropertiesAsync(int apiResourceId, int page = 1, int pageSize = 10); @@ -30,17 +28,7 @@ public interface IApiResourceService Task DeleteApiResourceAsync(ApiResourceDto apiResource); Task CanInsertApiResourceAsync(ApiResourceDto apiResource); - - Task GetApiScopesAsync(int apiResourceId, int page = 1, int pageSize = 10); - - Task GetApiScopeAsync(int apiResourceId, int apiScopeId); - - Task AddApiScopeAsync(ApiScopesDto apiScope); - - Task UpdateApiScopeAsync(ApiScopesDto apiScope); - - Task DeleteApiScopeAsync(ApiScopesDto apiScope); - + Task GetApiSecretsAsync(int apiResourceId, int page = 1, int pageSize = 10); Task AddApiSecretAsync(ApiSecretsDto apiSecret); @@ -49,8 +37,6 @@ public interface IApiResourceService Task DeleteApiSecretAsync(ApiSecretsDto apiSecret); - Task CanInsertApiScopeAsync(ApiScopesDto apiScopes); - Task GetApiResourceNameAsync(int apiResourceId); } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IApiScopeService.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IApiScopeService.cs new file mode 100644 index 000000000..d667e5601 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IApiScopeService.cs @@ -0,0 +1,35 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using Skoruba.IdentityServer4.Admin.BusinessLogic.Dtos.Configuration; + +namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Services.Interfaces +{ + public interface IApiScopeService + { + ApiScopeDto BuildApiScopeViewModel(ApiScopeDto apiScope); + + Task GetApiScopesAsync(string search, int page = 1, int pageSize = 10); + + Task> GetApiScopesNameAsync(string scope, int limit = 0); + + Task GetApiScopeAsync(int apiScopeId); + + Task AddApiScopeAsync(ApiScopeDto apiScope); + + Task UpdateApiScopeAsync(ApiScopeDto apiScope); + + Task DeleteApiScopeAsync(ApiScopeDto apiScope); + + Task CanInsertApiScopeAsync(ApiScopeDto apiScopes); + + Task GetApiScopePropertiesAsync(int apiScopeId, int page = 1, int pageSize = 10); + + Task AddApiScopePropertyAsync(ApiScopePropertiesDto apiScopeProperties); + + Task DeleteApiScopePropertyAsync(ApiScopePropertiesDto apiScopeProperty); + + Task GetApiScopePropertyAsync(int apiScopePropertyId); + + Task CanInsertApiScopePropertyAsync(ApiScopePropertiesDto apiResourceProperty); + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IClientService.cs b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IClientService.cs index 97778ef4f..5accdf139 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IClientService.cs +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Services/Interfaces/IClientService.cs @@ -67,6 +67,8 @@ public interface IClientService Task DeleteClientPropertyAsync(ClientPropertiesDto clientProperty); + List GetSigningAlgorithms(string algorithm, int limit = 0); + List GetProtocolTypes(); } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj index 2b2a6c430..f8e930b6b 100644 --- a/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj +++ b/src/Skoruba.IdentityServer4.Admin.BusinessLogic/Skoruba.IdentityServer4.Admin.BusinessLogic.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 1.0.0 + 2.0.0-beta1 Jan Škoruba Business Logic layer for the administration of the IdentityServer4 IdentityServer4 Admin OpenIDConnect OAuth2 Identity @@ -12,7 +12,7 @@ - + @@ -21,11 +21,21 @@ + + ApiResourceServiceResource.resx + True + True + True True ApiResourceServiceResource.resx + + True + True + ApiScopeServiceResource.resx + True True @@ -38,6 +48,10 @@ ResXFileCodeGenerator ApiResourceServiceResource.Designer.cs + + PublicResXFileCodeGenerator + ApiScopeServiceResource.Designer.cs + ResXFileCodeGenerator IdentityResourceServiceResource.Designer.cs @@ -49,3 +63,4 @@ + diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj index 2365d8c50..ab785884d 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions/Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 1.0.0 + 2.0.0-beta1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity EntityFramework extensions for the administration of the IdentityServer4 and Asp.Net Core Identity @@ -16,3 +16,4 @@ + diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj index 33ea01380..897b368ca 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Identity/Skoruba.IdentityServer4.Admin.EntityFramework.Identity.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 1.0.0 + 2.0.0-beta1 Jan Škoruba Entity Framework layer for the administration of the Asp.Net Core Identity and IdentityServer4 IdentityServer4 Admin OpenIDConnect OAuth2 Identity @@ -12,8 +12,8 @@ - - + + @@ -25,3 +25,4 @@ + diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20201108173253_UpdateIdentityServerToVersion4.Designer.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20201108173253_UpdateIdentityServerToVersion4.Designer.cs new file mode 100644 index 000000000..728930f44 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20201108173253_UpdateIdentityServerToVersion4.Designer.cs @@ -0,0 +1,882 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Skoruba.IdentityServer4.Admin.EntityFramework.Shared.DbContexts; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.MySql.Migrations.IdentityServerConfiguration +{ + [DbContext(typeof(IdentityServerConfigurationDbContext))] + [Migration("20201108173253_UpdateIdentityServerToVersion4")] + partial class UpdateIdentityServerToVersion4 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.9") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("NonEditable") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.Property("Updated") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ApiResources"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ApiResourceId") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceClaims"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ApiResourceId") + .HasColumnType("int"); + + b.Property("Key") + .IsRequired() + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceProperties"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ApiResourceId") + .HasColumnType("int"); + + b.Property("Scope") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceScopes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ApiResourceId") + .HasColumnType("int"); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") + .HasMaxLength(1000); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(4000); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceSecrets"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ApiScopes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ScopeId") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ScopeId"); + + b.ToTable("ApiScopeClaims"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Key") + .IsRequired() + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("ScopeId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ScopeId"); + + b.ToTable("ApiScopeProperties"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("ClientName") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") + .HasMaxLength(2000); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") + .HasMaxLength(1000); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("LogoUri") + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") + .HasMaxLength(2000); + + b.Property("NonEditable") + .HasColumnType("tinyint(1)"); + + b.Property("PairWiseSubjectSalt") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("Updated") + .HasColumnType("datetime(6)"); + + b.Property("UserCodeType") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId") + .IsUnique(); + + b.ToTable("Clients"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientClaims"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("Origin") + .IsRequired() + .HasColumnType("varchar(150) CHARACTER SET utf8mb4") + .HasMaxLength(150); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientCorsOrigins"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("GrantType") + .IsRequired() + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientGrantTypes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("Provider") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientIdPRestrictions"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("PostLogoutRedirectUri") + .IsRequired() + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("Key") + .IsRequired() + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientProperties"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("RedirectUri") + .IsRequired() + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientRedirectUris"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("Scope") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientScopes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(4000); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientSecrets"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("NonEditable") + .HasColumnType("tinyint(1)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.Property("Updated") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("IdentityResources"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("IdentityResourceId") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("IdentityResourceId"); + + b.ToTable("IdentityResourceClaims"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("IdentityResourceId") + .HasColumnType("int"); + + b.Property("Key") + .IsRequired() + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("IdentityResourceId"); + + b.ToTable("IdentityResourceProperties"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + .WithMany("UserClaims") + .HasForeignKey("ScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + .WithMany("Properties") + .HasForeignKey("ScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20201108173253_UpdateIdentityServerToVersion4.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20201108173253_UpdateIdentityServerToVersion4.cs new file mode 100644 index 000000000..553d990a6 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/20201108173253_UpdateIdentityServerToVersion4.cs @@ -0,0 +1,561 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.MySql.Migrations.IdentityServerConfiguration +{ + public partial class UpdateIdentityServerToVersion4 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_ApiClaims_ApiResources_ApiResourceId", + table: "ApiClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiProperties_ApiResources_ApiResourceId", + table: "ApiProperties"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiScopes_ApiResources_ApiResourceId", + table: "ApiScopes"); + + migrationBuilder.DropForeignKey( + name: "FK_IdentityProperties_IdentityResources_IdentityResourceId", + table: "IdentityProperties"); + + migrationBuilder.DropIndex( + name: "IX_ApiScopes_ApiResourceId", + table: "ApiScopes"); + + migrationBuilder.DropIndex( + name: "IX_ApiScopeClaims_ApiScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityProperties", + table: "IdentityProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_ApiProperties", + table: "ApiProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_ApiClaims", + table: "ApiClaims"); + + migrationBuilder.RenameTable( + name: "IdentityProperties", + newName: "IdentityResourceProperties"); + + migrationBuilder.RenameTable( + name: "ApiProperties", + newName: "ApiResourceProperties"); + + migrationBuilder.RenameTable( + name: "ApiClaims", + newName: "ApiResourceClaims"); + + migrationBuilder.RenameIndex( + name: "IX_IdentityProperties_IdentityResourceId", + table: "IdentityResourceProperties", + newName: "IX_IdentityResourceProperties_IdentityResourceId"); + + migrationBuilder.RenameIndex( + name: "IX_ApiProperties_ApiResourceId", + table: "ApiResourceProperties", + newName: "IX_ApiResourceProperties_ApiResourceId"); + + migrationBuilder.RenameIndex( + name: "IX_ApiClaims_ApiResourceId", + table: "ApiResourceClaims", + newName: "IX_ApiResourceClaims_ApiResourceId"); + + migrationBuilder.AddColumn( + name: "AllowedIdentityTokenSigningAlgorithms", + table: "Clients", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "RequireRequestObject", + table: "Clients", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "Enabled", + table: "ApiScopes", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "ScopeId", + table: "ApiScopeClaims", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "AllowedAccessTokenSigningAlgorithms", + table: "ApiResources", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "ShowInDiscoveryDocument", + table: "ApiResources", + nullable: false, + defaultValue: false); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityResourceProperties", + table: "IdentityResourceProperties", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_ApiResourceProperties", + table: "ApiResourceProperties", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_ApiResourceClaims", + table: "ApiResourceClaims", + column: "Id"); + + migrationBuilder.CreateTable( + name: "ApiResourceScopes", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Scope = table.Column(maxLength: 200, nullable: false), + ApiResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiResourceScopes", x => x.Id); + table.ForeignKey( + name: "FK_ApiResourceScopes_ApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ApiResourceSecrets", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Description = table.Column(maxLength: 1000, nullable: true), + Value = table.Column(maxLength: 4000, nullable: false), + Expiration = table.Column(nullable: true), + Type = table.Column(maxLength: 250, nullable: false), + Created = table.Column(nullable: false), + ApiResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiResourceSecrets", x => x.Id); + table.ForeignKey( + name: "FK_ApiResourceSecrets_ApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ApiScopeProperties", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Key = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 2000, nullable: false), + ScopeId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiScopeProperties", x => x.Id); + table.ForeignKey( + name: "FK_ApiScopeProperties_ApiScopes_ScopeId", + column: x => x.ScopeId, + principalTable: "ApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityResourceClaims", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Type = table.Column(maxLength: 200, nullable: false), + IdentityResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityResourceClaims", x => x.Id); + table.ForeignKey( + name: "FK_IdentityResourceClaims_IdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_ApiScopeClaims_ScopeId", + table: "ApiScopeClaims", + column: "ScopeId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiResourceScopes_ApiResourceId", + table: "ApiResourceScopes", + column: "ApiResourceId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiResourceSecrets_ApiResourceId", + table: "ApiResourceSecrets", + column: "ApiResourceId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiScopeProperties_ScopeId", + table: "ApiScopeProperties", + column: "ScopeId"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityResourceClaims_IdentityResourceId", + table: "IdentityResourceClaims", + column: "IdentityResourceId"); + + migrationBuilder.AddForeignKey( + name: "FK_ApiResourceClaims_ApiResources_ApiResourceId", + table: "ApiResourceClaims", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_ApiResourceProperties_ApiResources_ApiResourceId", + table: "ApiResourceProperties", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + // migrate data + + migrationBuilder.Sql(@"INSERT INTO `ApiResourceSecrets` + (`Id`, `Description`, `Value`, `Expiration`, `Type`, `Created`, `ApiResourceId`) +SELECT + `Id`, `Description`, `Value`, `Expiration`, `Type`, `Created`, `ApiResourceId` +FROM `ApiSecrets`;"); + + migrationBuilder.Sql(@"INSERT INTO `IdentityResourceClaims` + (`Id`, `Type`, `IdentityResourceId`) +SELECT + `Id`, `Type`, `IdentityResourceId` +FROM `IdentityClaims`;"); + + migrationBuilder.Sql(@"INSERT INTO `ApiResourceScopes` + (`Scope`, `ApiResourceId`) +SELECT + `Name`, `ApiResourceId` +FROM `ApiScopes`;"); + + migrationBuilder.Sql(@"UPDATE `ApiScopeClaims` SET `ScopeId` = `ApiScopeId`"); + + migrationBuilder.Sql(@"UPDATE `ApiScopes` SET `Enabled` = 1"); + + migrationBuilder.DropTable( + name: "ApiSecrets"); + + migrationBuilder.DropTable( + name: "IdentityClaims"); + + migrationBuilder.DropColumn( + name: "ApiResourceId", + table: "ApiScopes"); + + migrationBuilder.DropColumn( + name: "ApiScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.AddForeignKey( + name: "FK_ApiScopeClaims_ApiScopes_ScopeId", + table: "ApiScopeClaims", + column: "ScopeId", + principalTable: "ApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_IdentityResourceProperties_IdentityResources_IdentityResourc~", + table: "IdentityResourceProperties", + column: "IdentityResourceId", + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_ApiResourceClaims_ApiResources_ApiResourceId", + table: "ApiResourceClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiResourceProperties_ApiResources_ApiResourceId", + table: "ApiResourceProperties"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiScopeClaims_ApiScopes_ScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_IdentityResourceProperties_IdentityResources_IdentityResourc~", + table: "IdentityResourceProperties"); + + migrationBuilder.DropIndex( + name: "IX_ApiScopeClaims_ScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityResourceProperties", + table: "IdentityResourceProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_ApiResourceProperties", + table: "ApiResourceProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_ApiResourceClaims", + table: "ApiResourceClaims"); + + migrationBuilder.RenameTable( + name: "IdentityResourceProperties", + newName: "IdentityProperties"); + + migrationBuilder.RenameTable( + name: "ApiResourceProperties", + newName: "ApiProperties"); + + migrationBuilder.RenameTable( + name: "ApiResourceClaims", + newName: "ApiClaims"); + + migrationBuilder.RenameIndex( + name: "IX_IdentityResourceProperties_IdentityResourceId", + table: "IdentityProperties", + newName: "IX_IdentityProperties_IdentityResourceId"); + + migrationBuilder.RenameIndex( + name: "IX_ApiResourceProperties_ApiResourceId", + table: "ApiProperties", + newName: "IX_ApiProperties_ApiResourceId"); + + migrationBuilder.RenameIndex( + name: "IX_ApiResourceClaims_ApiResourceId", + table: "ApiClaims", + newName: "IX_ApiClaims_ApiResourceId"); + + migrationBuilder.AddColumn( + name: "ApiResourceId", + table: "ApiScopes", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "ApiScopeId", + table: "ApiScopeClaims", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityProperties", + table: "IdentityProperties", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_ApiProperties", + table: "ApiProperties", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_ApiClaims", + table: "ApiClaims", + column: "Id"); + + migrationBuilder.CreateTable( + name: "ApiSecrets", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ApiResourceId = table.Column(type: "int", nullable: false), + Created = table.Column(type: "datetime(6)", nullable: false), + Description = table.Column(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: true), + Expiration = table.Column(type: "datetime(6)", nullable: true), + Type = table.Column(type: "varchar(250) CHARACTER SET utf8mb4", maxLength: 250, nullable: false), + Value = table.Column(type: "longtext CHARACTER SET utf8mb4", maxLength: 4000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiSecrets", x => x.Id); + table.ForeignKey( + name: "FK_ApiSecrets_ApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityClaims", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + IdentityResourceId = table.Column(type: "int", nullable: false), + Type = table.Column(type: "varchar(200) CHARACTER SET utf8mb4", maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityClaims", x => x.Id); + table.ForeignKey( + name: "FK_IdentityClaims_IdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_ApiScopes_ApiResourceId", + table: "ApiScopes", + column: "ApiResourceId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiScopeClaims_ApiScopeId", + table: "ApiScopeClaims", + column: "ApiScopeId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiSecrets_ApiResourceId", + table: "ApiSecrets", + column: "ApiResourceId"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityClaims_IdentityResourceId", + table: "IdentityClaims", + column: "IdentityResourceId"); + + migrationBuilder.AddForeignKey( + name: "FK_ApiClaims_ApiResources_ApiResourceId", + table: "ApiClaims", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_ApiProperties_ApiResources_ApiResourceId", + table: "ApiProperties", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + // Rollback data back + migrationBuilder.Sql(@"INSERT INTO `ApiSecrets` + (`Id`, `Description`, `Value`, `Expiration`, `Type`, `Created`, `ApiResourceId`) +SELECT + Id, `Description`, `Value`, `Expiration`, `Type`, `Created`, `ApiResourceId` +FROM `ApiResourceSecrets`"); + + migrationBuilder.Sql(@"INSERT INTO `IdentityClaims` + (`Id`, `Type`, `IdentityResourceId`) +SELECT + `Id`, `Type`, `IdentityResourceId` +FROM `IdentityResourceClaims`"); + + migrationBuilder.Sql(@"UPDATE `ApiScopes` asp + INNER JOIN `ApiResourceScopes` arc + ON arc.`Id` = asp.`Id` +SET asp.`ApiResourceId` = arc.`ApiResourceId`;"); + + migrationBuilder.Sql(@"UPDATE `ApiScopeClaims` SET `ApiScopeId` = `ScopeId`"); + + migrationBuilder.DropTable( + name: "ApiResourceScopes"); + + migrationBuilder.DropTable( + name: "ApiResourceSecrets"); + + migrationBuilder.DropTable( + name: "ApiScopeProperties"); + + migrationBuilder.DropTable( + name: "IdentityResourceClaims"); + + migrationBuilder.DropColumn( + name: "AllowedIdentityTokenSigningAlgorithms", + table: "Clients"); + + migrationBuilder.DropColumn( + name: "RequireRequestObject", + table: "Clients"); + + migrationBuilder.DropColumn( + name: "Enabled", + table: "ApiScopes"); + + migrationBuilder.DropColumn( + name: "ScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropColumn( + name: "AllowedAccessTokenSigningAlgorithms", + table: "ApiResources"); + + migrationBuilder.DropColumn( + name: "ShowInDiscoveryDocument", + table: "ApiResources"); + + migrationBuilder.AddForeignKey( + name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId", + table: "ApiScopeClaims", + column: "ApiScopeId", + principalTable: "ApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_ApiScopes_ApiResources_ApiResourceId", + table: "ApiScopes", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_IdentityProperties_IdentityResources_IdentityResourceId", + table: "IdentityProperties", + column: "IdentityResourceId", + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs index daaf9173e..ae5999795 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs @@ -14,7 +14,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.9") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => @@ -23,6 +23,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + b.Property("Created") .HasColumnType("datetime(6)"); @@ -48,6 +52,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("NonEditable") .HasColumnType("tinyint(1)"); + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + b.Property("Updated") .HasColumnType("datetime(6)"); @@ -77,7 +84,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ApiResourceId"); - b.ToTable("ApiClaims"); + b.ToTable("ApiResourceClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => @@ -103,10 +110,31 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ApiResourceId"); - b.ToTable("ApiProperties"); + b.ToTable("ApiResourceProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ApiResourceId") + .HasColumnType("int"); + + b.Property("Scope") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceScopes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -115,6 +143,39 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ApiResourceId") .HasColumnType("int"); + b.Property("Created") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") + .HasMaxLength(1000); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(250) CHARACTER SET utf8mb4") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(4000); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceSecrets"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + b.Property("Description") .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") .HasMaxLength(1000); @@ -126,6 +187,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Emphasize") .HasColumnType("tinyint(1)"); + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + b.Property("Name") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") @@ -139,8 +203,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("ApiResourceId"); - b.HasIndex("Name") .IsUnique(); @@ -153,7 +215,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("int"); - b.Property("ApiScopeId") + b.Property("ScopeId") .HasColumnType("int"); b.Property("Type") @@ -163,45 +225,35 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("ApiScopeId"); + b.HasIndex("ScopeId"); b.ToTable("ApiScopeClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int"); - b.Property("ApiResourceId") - .HasColumnType("int"); - - b.Property("Created") - .HasColumnType("datetime(6)"); - - b.Property("Description") - .HasColumnType("varchar(1000) CHARACTER SET utf8mb4") - .HasMaxLength(1000); - - b.Property("Expiration") - .HasColumnType("datetime(6)"); - - b.Property("Type") + b.Property("Key") .IsRequired() .HasColumnType("varchar(250) CHARACTER SET utf8mb4") .HasMaxLength(250); + b.Property("ScopeId") + .HasColumnType("int"); + b.Property("Value") .IsRequired() - .HasColumnType("longtext CHARACTER SET utf8mb4") - .HasMaxLength(4000); + .HasColumnType("varchar(2000) CHARACTER SET utf8mb4") + .HasMaxLength(2000); b.HasKey("Id"); - b.HasIndex("ApiResourceId"); + b.HasIndex("ScopeId"); - b.ToTable("ApiSecrets"); + b.ToTable("ApiScopeProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => @@ -231,6 +283,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("AllowRememberConsent") .HasColumnType("tinyint(1)"); + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + b.Property("AlwaysIncludeUserClaimsInIdToken") .HasColumnType("tinyint(1)"); @@ -330,6 +386,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("RequirePkce") .HasColumnType("tinyint(1)"); + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + b.Property("SlidingRefreshTokenLifetime") .HasColumnType("int"); @@ -568,27 +627,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientSecrets"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - b.Property("IdentityResourceId") - .HasColumnType("int"); - - b.Property("Type") - .IsRequired() - .HasColumnType("varchar(200) CHARACTER SET utf8mb4") - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("IdentityResourceId"); - - b.ToTable("IdentityClaims"); - }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => { b.Property("Id") @@ -637,6 +675,27 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityResources"); }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("IdentityResourceId") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("IdentityResourceId"); + + b.ToTable("IdentityResourceClaims"); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => { b.Property("Id") @@ -660,7 +719,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("IdentityResourceId"); - b.ToTable("IdentityProperties"); + b.ToTable("IdentityResourceProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => @@ -681,7 +740,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Scopes") @@ -690,20 +749,29 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "ApiScope") + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") .WithMany("UserClaims") - .HasForeignKey("ApiScopeId") + .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + .WithMany("Properties") + .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); @@ -789,7 +857,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("UserClaims") diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20201108173143_UpdateIdentityServerToVersion4.Designer.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20201108173143_UpdateIdentityServerToVersion4.Designer.cs new file mode 100644 index 000000000..7cac8dd43 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20201108173143_UpdateIdentityServerToVersion4.Designer.cs @@ -0,0 +1,127 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Skoruba.IdentityServer4.Admin.EntityFramework.Shared.DbContexts; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.MySql.Migrations.IdentityServerGrants +{ + [DbContext(typeof(IdentityServerPersistedGrantDbContext))] + [Migration("20201108173143_UpdateIdentityServerToVersion4")] + partial class UpdateIdentityServerToVersion4 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.9") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => + { + b.Property("UserCode") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(50000); + + b.Property("Description") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("SubjectId") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.HasKey("UserCode"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.ToTable("DeviceCodes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => + { + b.Property("Key") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4") + .HasMaxLength(50000); + + b.Property("Description") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + + b.Property("SubjectId") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50) CHARACTER SET utf8mb4") + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("PersistedGrants"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20201108173143_UpdateIdentityServerToVersion4.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20201108173143_UpdateIdentityServerToVersion4.cs new file mode 100644 index 000000000..afda5c205 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/20201108173143_UpdateIdentityServerToVersion4.cs @@ -0,0 +1,72 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.MySql.Migrations.IdentityServerGrants +{ + public partial class UpdateIdentityServerToVersion4 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ConsumedTime", + table: "PersistedGrants", + nullable: true); + + migrationBuilder.AddColumn( + name: "Description", + table: "PersistedGrants", + maxLength: 200, + nullable: true); + + migrationBuilder.AddColumn( + name: "SessionId", + table: "PersistedGrants", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "Description", + table: "DeviceCodes", + maxLength: 200, + nullable: true); + + migrationBuilder.AddColumn( + name: "SessionId", + table: "DeviceCodes", + maxLength: 100, + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_PersistedGrants_SubjectId_SessionId_Type", + table: "PersistedGrants", + columns: new[] { "SubjectId", "SessionId", "Type" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_PersistedGrants_SubjectId_SessionId_Type", + table: "PersistedGrants"); + + migrationBuilder.DropColumn( + name: "ConsumedTime", + table: "PersistedGrants"); + + migrationBuilder.DropColumn( + name: "Description", + table: "PersistedGrants"); + + migrationBuilder.DropColumn( + name: "SessionId", + table: "PersistedGrants"); + + migrationBuilder.DropColumn( + name: "Description", + table: "DeviceCodes"); + + migrationBuilder.DropColumn( + name: "SessionId", + table: "DeviceCodes"); + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs index 9f33655e2..b4b588614 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs @@ -14,7 +14,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.9") .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => @@ -36,6 +36,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(50000); + b.Property("Description") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + b.Property("DeviceCode") .IsRequired() .HasColumnType("varchar(200) CHARACTER SET utf8mb4") @@ -45,6 +49,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired() .HasColumnType("datetime(6)"); + b.Property("SessionId") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + b.Property("SubjectId") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); @@ -70,6 +78,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + b.Property("CreationTime") .HasColumnType("datetime(6)"); @@ -78,9 +89,17 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("longtext CHARACTER SET utf8mb4") .HasMaxLength(50000); + b.Property("Description") + .HasColumnType("varchar(200) CHARACTER SET utf8mb4") + .HasMaxLength(200); + b.Property("Expiration") .HasColumnType("datetime(6)"); + b.Property("SessionId") + .HasColumnType("varchar(100) CHARACTER SET utf8mb4") + .HasMaxLength(100); + b.Property("SubjectId") .HasColumnType("varchar(200) CHARACTER SET utf8mb4") .HasMaxLength(200); @@ -96,6 +115,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("SubjectId", "ClientId", "Type"); + b.HasIndex("SubjectId", "SessionId", "Type"); + b.ToTable("PersistedGrants"); }); #pragma warning restore 612, 618 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj index 67d39cdab..76bc9ef06 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.MySql/Skoruba.IdentityServer4.Admin.EntityFramework.MySql.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 1.0.0 + 2.0.0-beta1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with MySql support @@ -12,8 +12,8 @@ - - + + @@ -28,3 +28,4 @@ + diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerConfiguration/20201108170812_UpdateIdentityServerToVersion4.Designer.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerConfiguration/20201108170812_UpdateIdentityServerToVersion4.Designer.cs new file mode 100644 index 000000000..e5f9f9804 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerConfiguration/20201108170812_UpdateIdentityServerToVersion4.Designer.cs @@ -0,0 +1,905 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Skoruba.IdentityServer4.Admin.EntityFramework.Shared.DbContexts; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerConfiguration +{ + [DbContext(typeof(IdentityServerConfigurationDbContext))] + [Migration("20201108170812_UpdateIdentityServerToVersion4")] + partial class UpdateIdentityServerToVersion4 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "3.1.9") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("Created") + .HasColumnType("timestamp without time zone"); + + b.Property("Description") + .HasColumnType("character varying(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("LastAccessed") + .HasColumnType("timestamp without time zone"); + + b.Property("Name") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("NonEditable") + .HasColumnType("boolean"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("boolean"); + + b.Property("Updated") + .HasColumnType("timestamp without time zone"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ApiResources"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ApiResourceId") + .HasColumnType("integer"); + + b.Property("Type") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceClaims"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ApiResourceId") + .HasColumnType("integer"); + + b.Property("Key") + .IsRequired() + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("character varying(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceProperties"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ApiResourceId") + .HasColumnType("integer"); + + b.Property("Scope") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceScopes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ApiResourceId") + .HasColumnType("integer"); + + b.Property("Created") + .HasColumnType("timestamp without time zone"); + + b.Property("Description") + .HasColumnType("character varying(1000)") + .HasMaxLength(1000); + + b.Property("Expiration") + .HasColumnType("timestamp without time zone"); + + b.Property("Type") + .IsRequired() + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("character varying(4000)") + .HasMaxLength(4000); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceSecrets"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Description") + .HasColumnType("character varying(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("boolean"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("Required") + .HasColumnType("boolean"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ApiScopes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ScopeId") + .HasColumnType("integer"); + + b.Property("Type") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ScopeId"); + + b.ToTable("ApiScopeClaims"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Key") + .IsRequired() + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.Property("ScopeId") + .HasColumnType("integer"); + + b.Property("Value") + .IsRequired() + .HasColumnType("character varying(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ScopeId"); + + b.ToTable("ApiScopeProperties"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("integer"); + + b.Property("AccessTokenLifetime") + .HasColumnType("integer"); + + b.Property("AccessTokenType") + .HasColumnType("integer"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("boolean"); + + b.Property("AllowOfflineAccess") + .HasColumnType("boolean"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("boolean"); + + b.Property("AllowRememberConsent") + .HasColumnType("boolean"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("boolean"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("boolean"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("integer"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("boolean"); + + b.Property("BackChannelLogoutUri") + .HasColumnType("character varying(2000)") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("ClientName") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasColumnType("character varying(2000)") + .HasMaxLength(2000); + + b.Property("ConsentLifetime") + .HasColumnType("integer"); + + b.Property("Created") + .HasColumnType("timestamp without time zone"); + + b.Property("Description") + .HasColumnType("character varying(1000)") + .HasMaxLength(1000); + + b.Property("DeviceCodeLifetime") + .HasColumnType("integer"); + + b.Property("EnableLocalLogin") + .HasColumnType("boolean"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("boolean"); + + b.Property("FrontChannelLogoutUri") + .HasColumnType("character varying(2000)") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime") + .HasColumnType("integer"); + + b.Property("IncludeJwtId") + .HasColumnType("boolean"); + + b.Property("LastAccessed") + .HasColumnType("timestamp without time zone"); + + b.Property("LogoUri") + .HasColumnType("character varying(2000)") + .HasMaxLength(2000); + + b.Property("NonEditable") + .HasColumnType("boolean"); + + b.Property("PairWiseSubjectSalt") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration") + .HasColumnType("integer"); + + b.Property("RefreshTokenUsage") + .HasColumnType("integer"); + + b.Property("RequireClientSecret") + .HasColumnType("boolean"); + + b.Property("RequireConsent") + .HasColumnType("boolean"); + + b.Property("RequirePkce") + .HasColumnType("boolean"); + + b.Property("RequireRequestObject") + .HasColumnType("boolean"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("integer"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("boolean"); + + b.Property("Updated") + .HasColumnType("timestamp without time zone"); + + b.Property("UserCodeType") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("UserSsoLifetime") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ClientId") + .IsUnique(); + + b.ToTable("Clients"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClientId") + .HasColumnType("integer"); + + b.Property("Type") + .IsRequired() + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientClaims"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClientId") + .HasColumnType("integer"); + + b.Property("Origin") + .IsRequired() + .HasColumnType("character varying(150)") + .HasMaxLength(150); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientCorsOrigins"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClientId") + .HasColumnType("integer"); + + b.Property("GrantType") + .IsRequired() + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientGrantTypes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClientId") + .HasColumnType("integer"); + + b.Property("Provider") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientIdPRestrictions"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClientId") + .HasColumnType("integer"); + + b.Property("PostLogoutRedirectUri") + .IsRequired() + .HasColumnType("character varying(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClientId") + .HasColumnType("integer"); + + b.Property("Key") + .IsRequired() + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("character varying(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientProperties"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClientId") + .HasColumnType("integer"); + + b.Property("RedirectUri") + .IsRequired() + .HasColumnType("character varying(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientRedirectUris"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClientId") + .HasColumnType("integer"); + + b.Property("Scope") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientScopes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClientId") + .HasColumnType("integer"); + + b.Property("Created") + .HasColumnType("timestamp without time zone"); + + b.Property("Description") + .HasColumnType("character varying(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("timestamp without time zone"); + + b.Property("Type") + .IsRequired() + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("character varying(4000)") + .HasMaxLength(4000); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientSecrets"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Created") + .HasColumnType("timestamp without time zone"); + + b.Property("Description") + .HasColumnType("character varying(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("boolean"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("NonEditable") + .HasColumnType("boolean"); + + b.Property("Required") + .HasColumnType("boolean"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("boolean"); + + b.Property("Updated") + .HasColumnType("timestamp without time zone"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("IdentityResources"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("IdentityResourceId") + .HasColumnType("integer"); + + b.Property("Type") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("IdentityResourceId"); + + b.ToTable("IdentityResourceClaims"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("IdentityResourceId") + .HasColumnType("integer"); + + b.Property("Key") + .IsRequired() + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("character varying(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("IdentityResourceId"); + + b.ToTable("IdentityResourceProperties"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + .WithMany("UserClaims") + .HasForeignKey("ScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + .WithMany("Properties") + .HasForeignKey("ScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerConfiguration/20201108170812_UpdateIdentityServerToVersion4.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerConfiguration/20201108170812_UpdateIdentityServerToVersion4.cs new file mode 100644 index 000000000..83225486e --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerConfiguration/20201108170812_UpdateIdentityServerToVersion4.cs @@ -0,0 +1,560 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerConfiguration +{ + public partial class UpdateIdentityServerToVersion4 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_ApiClaims_ApiResources_ApiResourceId", + table: "ApiClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiProperties_ApiResources_ApiResourceId", + table: "ApiProperties"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiScopes_ApiResources_ApiResourceId", + table: "ApiScopes"); + + migrationBuilder.DropForeignKey( + name: "FK_IdentityProperties_IdentityResources_IdentityResourceId", + table: "IdentityProperties"); + + migrationBuilder.DropIndex( + name: "IX_ApiScopes_ApiResourceId", + table: "ApiScopes"); + + migrationBuilder.DropIndex( + name: "IX_ApiScopeClaims_ApiScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityProperties", + table: "IdentityProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_ApiProperties", + table: "ApiProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_ApiClaims", + table: "ApiClaims"); + + migrationBuilder.RenameTable( + name: "IdentityProperties", + newName: "IdentityResourceProperties"); + + migrationBuilder.RenameTable( + name: "ApiProperties", + newName: "ApiResourceProperties"); + + migrationBuilder.RenameTable( + name: "ApiClaims", + newName: "ApiResourceClaims"); + + migrationBuilder.RenameIndex( + name: "IX_IdentityProperties_IdentityResourceId", + table: "IdentityResourceProperties", + newName: "IX_IdentityResourceProperties_IdentityResourceId"); + + migrationBuilder.RenameIndex( + name: "IX_ApiProperties_ApiResourceId", + table: "ApiResourceProperties", + newName: "IX_ApiResourceProperties_ApiResourceId"); + + migrationBuilder.RenameIndex( + name: "IX_ApiClaims_ApiResourceId", + table: "ApiResourceClaims", + newName: "IX_ApiResourceClaims_ApiResourceId"); + + migrationBuilder.AddColumn( + name: "AllowedIdentityTokenSigningAlgorithms", + table: "Clients", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "RequireRequestObject", + table: "Clients", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "Enabled", + table: "ApiScopes", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "ScopeId", + table: "ApiScopeClaims", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "AllowedAccessTokenSigningAlgorithms", + table: "ApiResources", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "ShowInDiscoveryDocument", + table: "ApiResources", + nullable: false, + defaultValue: false); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityResourceProperties", + table: "IdentityResourceProperties", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_ApiResourceProperties", + table: "ApiResourceProperties", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_ApiResourceClaims", + table: "ApiResourceClaims", + column: "Id"); + + migrationBuilder.CreateTable( + name: "ApiResourceScopes", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Scope = table.Column(maxLength: 200, nullable: false), + ApiResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiResourceScopes", x => x.Id); + table.ForeignKey( + name: "FK_ApiResourceScopes_ApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ApiResourceSecrets", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Description = table.Column(maxLength: 1000, nullable: true), + Value = table.Column(maxLength: 4000, nullable: false), + Expiration = table.Column(nullable: true), + Type = table.Column(maxLength: 250, nullable: false), + Created = table.Column(nullable: false), + ApiResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiResourceSecrets", x => x.Id); + table.ForeignKey( + name: "FK_ApiResourceSecrets_ApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ApiScopeProperties", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Key = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 2000, nullable: false), + ScopeId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiScopeProperties", x => x.Id); + table.ForeignKey( + name: "FK_ApiScopeProperties_ApiScopes_ScopeId", + column: x => x.ScopeId, + principalTable: "ApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityResourceClaims", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Type = table.Column(maxLength: 200, nullable: false), + IdentityResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityResourceClaims", x => x.Id); + table.ForeignKey( + name: "FK_IdentityResourceClaims_IdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_ApiScopeClaims_ScopeId", + table: "ApiScopeClaims", + column: "ScopeId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiResourceScopes_ApiResourceId", + table: "ApiResourceScopes", + column: "ApiResourceId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiResourceSecrets_ApiResourceId", + table: "ApiResourceSecrets", + column: "ApiResourceId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiScopeProperties_ScopeId", + table: "ApiScopeProperties", + column: "ScopeId"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityResourceClaims_IdentityResourceId", + table: "IdentityResourceClaims", + column: "IdentityResourceId"); + + migrationBuilder.AddForeignKey( + name: "FK_ApiResourceClaims_ApiResources_ApiResourceId", + table: "ApiResourceClaims", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + // migrate data + + migrationBuilder.Sql(@"INSERT INTO ""ApiResourceSecrets"" + (""Id"", ""Description"", ""Value"", ""Expiration"", ""Type"", ""Created"", ""ApiResourceId"") + SELECT + ""Id"", ""Description"", ""Value"", ""Expiration"", ""Type"", ""Created"", ""ApiResourceId"" + FROM ""ApiSecrets"";"); + + migrationBuilder.Sql(@"INSERT INTO ""IdentityResourceClaims"" + (""Id"", ""Type"", ""IdentityResourceId"") +SELECT + ""Id"", ""Type"", ""IdentityResourceId"" +FROM ""IdentityClaims"";"); + + migrationBuilder.Sql(@"INSERT INTO ""ApiResourceScopes"" + (""Scope"", ""ApiResourceId"") +SELECT + ""Name"", ""ApiResourceId"" +FROM ""ApiScopes"";"); + + migrationBuilder.Sql(@"UPDATE ""ApiScopeClaims"" SET ""ScopeId"" = ""ApiScopeId"";"); + + migrationBuilder.Sql(@"UPDATE ""ApiScopes"" SET ""Enabled"" = TRUE;"); + + migrationBuilder.DropTable( + name: "ApiSecrets"); + + migrationBuilder.DropTable( + name: "IdentityClaims"); + + migrationBuilder.DropColumn( + name: "ApiResourceId", + table: "ApiScopes"); + + migrationBuilder.DropColumn( + name: "ApiScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.AddForeignKey( + name: "FK_ApiResourceProperties_ApiResources_ApiResourceId", + table: "ApiResourceProperties", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_ApiScopeClaims_ApiScopes_ScopeId", + table: "ApiScopeClaims", + column: "ScopeId", + principalTable: "ApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_IdentityResourceProperties_IdentityResources_IdentityResour~", + table: "IdentityResourceProperties", + column: "IdentityResourceId", + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_ApiResourceClaims_ApiResources_ApiResourceId", + table: "ApiResourceClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiResourceProperties_ApiResources_ApiResourceId", + table: "ApiResourceProperties"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiScopeClaims_ApiScopes_ScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_IdentityResourceProperties_IdentityResources_IdentityResour~", + table: "IdentityResourceProperties"); + + migrationBuilder.DropIndex( + name: "IX_ApiScopeClaims_ScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityResourceProperties", + table: "IdentityResourceProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_ApiResourceProperties", + table: "ApiResourceProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_ApiResourceClaims", + table: "ApiResourceClaims"); + + migrationBuilder.RenameTable( + name: "IdentityResourceProperties", + newName: "IdentityProperties"); + + migrationBuilder.RenameTable( + name: "ApiResourceProperties", + newName: "ApiProperties"); + + migrationBuilder.RenameTable( + name: "ApiResourceClaims", + newName: "ApiClaims"); + + migrationBuilder.RenameIndex( + name: "IX_IdentityResourceProperties_IdentityResourceId", + table: "IdentityProperties", + newName: "IX_IdentityProperties_IdentityResourceId"); + + migrationBuilder.RenameIndex( + name: "IX_ApiResourceProperties_ApiResourceId", + table: "ApiProperties", + newName: "IX_ApiProperties_ApiResourceId"); + + migrationBuilder.RenameIndex( + name: "IX_ApiResourceClaims_ApiResourceId", + table: "ApiClaims", + newName: "IX_ApiClaims_ApiResourceId"); + + migrationBuilder.AddColumn( + name: "ApiResourceId", + table: "ApiScopes", + type: "integer", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "ApiScopeId", + table: "ApiScopeClaims", + type: "integer", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityProperties", + table: "IdentityProperties", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_ApiProperties", + table: "ApiProperties", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_ApiClaims", + table: "ApiClaims", + column: "Id"); + + migrationBuilder.CreateTable( + name: "ApiSecrets", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ApiResourceId = table.Column(type: "integer", nullable: false), + Created = table.Column(type: "timestamp without time zone", nullable: false), + Description = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), + Expiration = table.Column(type: "timestamp without time zone", nullable: true), + Type = table.Column(type: "character varying(250)", maxLength: 250, nullable: false), + Value = table.Column(type: "character varying(4000)", maxLength: 4000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiSecrets", x => x.Id); + table.ForeignKey( + name: "FK_ApiSecrets_ApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityClaims", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + IdentityResourceId = table.Column(type: "integer", nullable: false), + Type = table.Column(type: "character varying(200)", maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityClaims", x => x.Id); + table.ForeignKey( + name: "FK_IdentityClaims_IdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_ApiScopes_ApiResourceId", + table: "ApiScopes", + column: "ApiResourceId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiScopeClaims_ApiScopeId", + table: "ApiScopeClaims", + column: "ApiScopeId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiSecrets_ApiResourceId", + table: "ApiSecrets", + column: "ApiResourceId"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityClaims_IdentityResourceId", + table: "IdentityClaims", + column: "IdentityResourceId"); + + migrationBuilder.AddForeignKey( + name: "FK_ApiClaims_ApiResources_ApiResourceId", + table: "ApiClaims", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_ApiProperties_ApiResources_ApiResourceId", + table: "ApiProperties", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + // Rollback data back + migrationBuilder.Sql(@"INSERT INTO ""ApiSecrets"" + (""Id"", ""Description"", ""Value"", ""Expiration"", ""Type"", ""Created"", ""ApiResourceId"") +SELECT ""Id"", ""Description"", ""Value"", ""Expiration"", ""Type"", ""Created"", ""ApiResourceId"" +FROM ""ApiResourceSecrets"";"); + + migrationBuilder.Sql(@"INSERT INTO ""IdentityClaims"" + (""Id"", ""Type"", ""IdentityResourceId"") +SELECT + ""Id"", ""Type"", ""IdentityResourceId"" +FROM ""IdentityResourceClaims"";"); + + migrationBuilder.Sql(@"UPDATE ""ApiScopes"" asp +SET ""ApiResourceId"" = arc.""ApiResourceId"" +FROM ""ApiResourceScopes"" arc +WHERE arc.""Id"" = asp.""Id"";"); + + migrationBuilder.Sql(@"UPDATE ""ApiScopeClaims"" SET ""ApiScopeId"" = ""ScopeId"";"); + + migrationBuilder.DropTable( + name: "ApiResourceScopes"); + + migrationBuilder.DropTable( + name: "ApiResourceSecrets"); + + migrationBuilder.DropTable( + name: "ApiScopeProperties"); + + migrationBuilder.DropTable( + name: "IdentityResourceClaims"); + + migrationBuilder.DropColumn( + name: "AllowedIdentityTokenSigningAlgorithms", + table: "Clients"); + + migrationBuilder.DropColumn( + name: "RequireRequestObject", + table: "Clients"); + + migrationBuilder.DropColumn( + name: "Enabled", + table: "ApiScopes"); + + migrationBuilder.DropColumn( + name: "ScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropColumn( + name: "AllowedAccessTokenSigningAlgorithms", + table: "ApiResources"); + + migrationBuilder.DropColumn( + name: "ShowInDiscoveryDocument", + table: "ApiResources"); + + migrationBuilder.AddForeignKey( + name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId", + table: "ApiScopeClaims", + column: "ApiScopeId", + principalTable: "ApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_ApiScopes_ApiResources_ApiResourceId", + table: "ApiScopes", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_IdentityProperties_IdentityResources_IdentityResourceId", + table: "IdentityProperties", + column: "IdentityResourceId", + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs index ada2e9c39..591e9dfbc 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs @@ -16,7 +16,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.9") .HasAnnotation("Relational:MaxIdentifierLength", 63); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => @@ -26,6 +26,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("integer") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + b.Property("Created") .HasColumnType("timestamp without time zone"); @@ -51,6 +55,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("NonEditable") .HasColumnType("boolean"); + b.Property("ShowInDiscoveryDocument") + .HasColumnType("boolean"); + b.Property("Updated") .HasColumnType("timestamp without time zone"); @@ -81,7 +88,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ApiResourceId"); - b.ToTable("ApiClaims"); + b.ToTable("ApiResourceClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => @@ -108,10 +115,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ApiResourceId"); - b.ToTable("ApiProperties"); + b.ToTable("ApiResourceProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -121,6 +128,62 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ApiResourceId") .HasColumnType("integer"); + b.Property("Scope") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceScopes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ApiResourceId") + .HasColumnType("integer"); + + b.Property("Created") + .HasColumnType("timestamp without time zone"); + + b.Property("Description") + .HasColumnType("character varying(1000)") + .HasMaxLength(1000); + + b.Property("Expiration") + .HasColumnType("timestamp without time zone"); + + b.Property("Type") + .IsRequired() + .HasColumnType("character varying(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("character varying(4000)") + .HasMaxLength(4000); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceSecrets"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + b.Property("Description") .HasColumnType("character varying(1000)") .HasMaxLength(1000); @@ -132,6 +195,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Emphasize") .HasColumnType("boolean"); + b.Property("Enabled") + .HasColumnType("boolean"); + b.Property("Name") .IsRequired() .HasColumnType("character varying(200)") @@ -145,8 +211,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("ApiResourceId"); - b.HasIndex("Name") .IsUnique(); @@ -160,7 +224,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("integer") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("ApiScopeId") + b.Property("ScopeId") .HasColumnType("integer"); b.Property("Type") @@ -170,46 +234,36 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("ApiScopeId"); + b.HasIndex("ScopeId"); b.ToTable("ApiScopeClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - b.Property("ApiResourceId") - .HasColumnType("integer"); - - b.Property("Created") - .HasColumnType("timestamp without time zone"); - - b.Property("Description") - .HasColumnType("character varying(1000)") - .HasMaxLength(1000); - - b.Property("Expiration") - .HasColumnType("timestamp without time zone"); - - b.Property("Type") + b.Property("Key") .IsRequired() .HasColumnType("character varying(250)") .HasMaxLength(250); + b.Property("ScopeId") + .HasColumnType("integer"); + b.Property("Value") .IsRequired() - .HasColumnType("character varying(4000)") - .HasMaxLength(4000); + .HasColumnType("character varying(2000)") + .HasMaxLength(2000); b.HasKey("Id"); - b.HasIndex("ApiResourceId"); + b.HasIndex("ScopeId"); - b.ToTable("ApiSecrets"); + b.ToTable("ApiScopeProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => @@ -240,6 +294,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("AllowRememberConsent") .HasColumnType("boolean"); + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + b.Property("AlwaysIncludeUserClaimsInIdToken") .HasColumnType("boolean"); @@ -339,6 +397,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("RequirePkce") .HasColumnType("boolean"); + b.Property("RequireRequestObject") + .HasColumnType("boolean"); + b.Property("SlidingRefreshTokenLifetime") .HasColumnType("integer"); @@ -586,28 +647,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientSecrets"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); - - b.Property("IdentityResourceId") - .HasColumnType("integer"); - - b.Property("Type") - .IsRequired() - .HasColumnType("character varying(200)") - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("IdentityResourceId"); - - b.ToTable("IdentityClaims"); - }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => { b.Property("Id") @@ -657,6 +696,28 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityResources"); }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("IdentityResourceId") + .HasColumnType("integer"); + + b.Property("Type") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("IdentityResourceId"); + + b.ToTable("IdentityResourceClaims"); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => { b.Property("Id") @@ -681,7 +742,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("IdentityResourceId"); - b.ToTable("IdentityProperties"); + b.ToTable("IdentityResourceProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => @@ -702,7 +763,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Scopes") @@ -711,20 +772,29 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "ApiScope") + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") .WithMany("UserClaims") - .HasForeignKey("ApiScopeId") + .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + .WithMany("Properties") + .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); @@ -810,7 +880,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("UserClaims") diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerGrants/20201108165927_UpdateIdentityServerToVersion4.Designer.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerGrants/20201108165927_UpdateIdentityServerToVersion4.Designer.cs new file mode 100644 index 000000000..8a1ae9485 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerGrants/20201108165927_UpdateIdentityServerToVersion4.Designer.cs @@ -0,0 +1,129 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Skoruba.IdentityServer4.Admin.EntityFramework.Shared.DbContexts; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerGrants +{ + [DbContext(typeof(IdentityServerPersistedGrantDbContext))] + [Migration("20201108165927_UpdateIdentityServerToVersion4")] + partial class UpdateIdentityServerToVersion4 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "3.1.9") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => + { + b.Property("UserCode") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Data") + .IsRequired() + .HasColumnType("character varying(50000)") + .HasMaxLength(50000); + + b.Property("Description") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("timestamp without time zone"); + + b.Property("SessionId") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("SubjectId") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.HasKey("UserCode"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.ToTable("DeviceCodes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => + { + b.Property("Key") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("ConsumedTime") + .HasColumnType("timestamp without time zone"); + + b.Property("CreationTime") + .HasColumnType("timestamp without time zone"); + + b.Property("Data") + .IsRequired() + .HasColumnType("character varying(50000)") + .HasMaxLength(50000); + + b.Property("Description") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .HasColumnType("timestamp without time zone"); + + b.Property("SessionId") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + + b.Property("SubjectId") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasColumnType("character varying(50)") + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("PersistedGrants"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerGrants/20201108165927_UpdateIdentityServerToVersion4.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerGrants/20201108165927_UpdateIdentityServerToVersion4.cs new file mode 100644 index 000000000..32783b1f7 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerGrants/20201108165927_UpdateIdentityServerToVersion4.cs @@ -0,0 +1,72 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.Migrations.IdentityServerGrants +{ + public partial class UpdateIdentityServerToVersion4 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ConsumedTime", + table: "PersistedGrants", + nullable: true); + + migrationBuilder.AddColumn( + name: "Description", + table: "PersistedGrants", + maxLength: 200, + nullable: true); + + migrationBuilder.AddColumn( + name: "SessionId", + table: "PersistedGrants", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "Description", + table: "DeviceCodes", + maxLength: 200, + nullable: true); + + migrationBuilder.AddColumn( + name: "SessionId", + table: "DeviceCodes", + maxLength: 100, + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_PersistedGrants_SubjectId_SessionId_Type", + table: "PersistedGrants", + columns: new[] { "SubjectId", "SessionId", "Type" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_PersistedGrants_SubjectId_SessionId_Type", + table: "PersistedGrants"); + + migrationBuilder.DropColumn( + name: "ConsumedTime", + table: "PersistedGrants"); + + migrationBuilder.DropColumn( + name: "Description", + table: "PersistedGrants"); + + migrationBuilder.DropColumn( + name: "SessionId", + table: "PersistedGrants"); + + migrationBuilder.DropColumn( + name: "Description", + table: "DeviceCodes"); + + migrationBuilder.DropColumn( + name: "SessionId", + table: "DeviceCodes"); + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs index cae5bb065..f114a12aa 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs @@ -16,7 +16,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.9") .HasAnnotation("Relational:MaxIdentifierLength", 63); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => @@ -38,6 +38,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("character varying(50000)") .HasMaxLength(50000); + b.Property("Description") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + b.Property("DeviceCode") .IsRequired() .HasColumnType("character varying(200)") @@ -47,6 +51,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired() .HasColumnType("timestamp without time zone"); + b.Property("SessionId") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + b.Property("SubjectId") .HasColumnType("character varying(200)") .HasMaxLength(200); @@ -72,6 +80,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("character varying(200)") .HasMaxLength(200); + b.Property("ConsumedTime") + .HasColumnType("timestamp without time zone"); + b.Property("CreationTime") .HasColumnType("timestamp without time zone"); @@ -80,9 +91,17 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("character varying(50000)") .HasMaxLength(50000); + b.Property("Description") + .HasColumnType("character varying(200)") + .HasMaxLength(200); + b.Property("Expiration") .HasColumnType("timestamp without time zone"); + b.Property("SessionId") + .HasColumnType("character varying(100)") + .HasMaxLength(100); + b.Property("SubjectId") .HasColumnType("character varying(200)") .HasMaxLength(200); @@ -98,6 +117,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("SubjectId", "ClientId", "Type"); + b.HasIndex("SubjectId", "SessionId", "Type"); + b.ToTable("PersistedGrants"); }); #pragma warning restore 612, 618 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj index 494daf9c0..0705d6059 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL/Skoruba.IdentityServer4.Admin.EntityFramework.PostgreSQL.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 1.0.0 + 2.0.0-beta1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with PostrgreSQL support @@ -13,7 +13,7 @@ - + @@ -27,3 +27,4 @@ + diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/DbContexts/IdentityServerConfigurationDbContext.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/DbContexts/IdentityServerConfigurationDbContext.cs index 5419c16fb..59ac8e796 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/DbContexts/IdentityServerConfigurationDbContext.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/DbContexts/IdentityServerConfigurationDbContext.cs @@ -17,13 +17,11 @@ public IdentityServerConfigurationDbContext(DbContextOptions IdentityResourceProperties { get; set; } - public DbSet ApiSecrets { get; set; } - - public DbSet ApiScopes { get; set; } + public DbSet ApiSecrets { get; set; } public DbSet ApiScopeClaims { get; set; } - public DbSet IdentityClaims { get; set; } + public DbSet IdentityClaims { get; set; } public DbSet ApiResourceClaims { get; set; } @@ -35,8 +33,6 @@ public IdentityServerConfigurationDbContext(DbContextOptions ClientPostLogoutRedirectUris { get; set; } - public DbSet ClientCorsOrigins { get; set; } - public DbSet ClientIdPRestrictions { get; set; } public DbSet ClientRedirectUris { get; set; } @@ -44,5 +40,9 @@ public IdentityServerConfigurationDbContext(DbContextOptions ClientClaims { get; set; } public DbSet ClientProperties { get; set; } + + public DbSet ApiScopeProperties { get; set; } + + public DbSet ApiResourceScopes { get; set; } } } \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj index 4317d49bb..3a7f85a86 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.Shared/Skoruba.IdentityServer4.Admin.EntityFramework.Shared.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 1.0.0 + 2.0.0-beta1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity DbContexts and Identity entities for the administration of the IdentityServer4 and Asp.Net Core Identity @@ -12,7 +12,7 @@ - + @@ -25,3 +25,4 @@ + diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerConfiguration/20201030101938_UpdateIdentityServerToVersion4.Designer.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerConfiguration/20201030101938_UpdateIdentityServerToVersion4.Designer.cs new file mode 100644 index 000000000..aa440165d --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerConfiguration/20201030101938_UpdateIdentityServerToVersion4.Designer.cs @@ -0,0 +1,905 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Skoruba.IdentityServer4.Admin.EntityFramework.Shared.DbContexts; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.Migrations.IdentityServerConfiguration +{ + [DbContext(typeof(IdentityServerConfigurationDbContext))] + [Migration("20201030101938_UpdateIdentityServerToVersion4")] + partial class UpdateIdentityServerToVersion4 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.9") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("Created") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("LastAccessed") + .HasColumnType("datetime2"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("NonEditable") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.Property("Updated") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ApiResources"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ApiResourceId") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceClaims"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ApiResourceId") + .HasColumnType("int"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceProperties"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ApiResourceId") + .HasColumnType("int"); + + b.Property("Scope") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceScopes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ApiResourceId") + .HasColumnType("int"); + + b.Property("Created") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceSecrets"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("ApiScopes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ScopeId") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ScopeId"); + + b.ToTable("ApiScopeClaims"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("ScopeId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ScopeId"); + + b.ToTable("ApiScopeProperties"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("Created") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("LastAccessed") + .HasColumnType("datetime2"); + + b.Property("LogoUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("NonEditable") + .HasColumnType("bit"); + + b.Property("PairWiseSubjectSalt") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("RequireRequestObject") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("Updated") + .HasColumnType("datetime2"); + + b.Property("UserCodeType") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId") + .IsUnique(); + + b.ToTable("Clients"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientClaims"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("Origin") + .IsRequired() + .HasColumnType("nvarchar(150)") + .HasMaxLength(150); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientCorsOrigins"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("GrantType") + .IsRequired() + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientGrantTypes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("Provider") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientIdPRestrictions"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("PostLogoutRedirectUri") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientProperties"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("RedirectUri") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientRedirectUris"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("Scope") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientScopes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("Created") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ClientSecrets"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Created") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("NonEditable") + .HasColumnType("bit"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.Property("Updated") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("IdentityResources"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("IdentityResourceId") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("IdentityResourceId"); + + b.ToTable("IdentityResourceClaims"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("IdentityResourceId") + .HasColumnType("int"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("Id"); + + b.HasIndex("IdentityResourceId"); + + b.ToTable("IdentityResourceProperties"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + .WithMany("UserClaims") + .HasForeignKey("ScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + .WithMany("Properties") + .HasForeignKey("ScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client") + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerConfiguration/20201030101938_UpdateIdentityServerToVersion4.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerConfiguration/20201030101938_UpdateIdentityServerToVersion4.cs new file mode 100644 index 000000000..a7be3d1ee --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerConfiguration/20201030101938_UpdateIdentityServerToVersion4.cs @@ -0,0 +1,588 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.Migrations.IdentityServerConfiguration +{ + public partial class UpdateIdentityServerToVersion4 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_ApiClaims_ApiResources_ApiResourceId", + table: "ApiClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiProperties_ApiResources_ApiResourceId", + table: "ApiProperties"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiScopes_ApiResources_ApiResourceId", + table: "ApiScopes"); + + migrationBuilder.DropForeignKey( + name: "FK_IdentityProperties_IdentityResources_IdentityResourceId", + table: "IdentityProperties"); + + migrationBuilder.DropIndex( + name: "IX_ApiScopes_ApiResourceId", + table: "ApiScopes"); + + migrationBuilder.DropIndex( + name: "IX_ApiScopeClaims_ApiScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityProperties", + table: "IdentityProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_ApiProperties", + table: "ApiProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_ApiClaims", + table: "ApiClaims"); + + migrationBuilder.RenameTable( + name: "IdentityProperties", + newName: "IdentityResourceProperties"); + + migrationBuilder.RenameTable( + name: "ApiProperties", + newName: "ApiResourceProperties"); + + migrationBuilder.RenameTable( + name: "ApiClaims", + newName: "ApiResourceClaims"); + + migrationBuilder.RenameIndex( + name: "IX_IdentityProperties_IdentityResourceId", + table: "IdentityResourceProperties", + newName: "IX_IdentityResourceProperties_IdentityResourceId"); + + migrationBuilder.RenameIndex( + name: "IX_ApiProperties_ApiResourceId", + table: "ApiResourceProperties", + newName: "IX_ApiResourceProperties_ApiResourceId"); + + migrationBuilder.RenameIndex( + name: "IX_ApiClaims_ApiResourceId", + table: "ApiResourceClaims", + newName: "IX_ApiResourceClaims_ApiResourceId"); + + migrationBuilder.AddColumn( + name: "AllowedIdentityTokenSigningAlgorithms", + table: "Clients", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "RequireRequestObject", + table: "Clients", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "Enabled", + table: "ApiScopes", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "ScopeId", + table: "ApiScopeClaims", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "AllowedAccessTokenSigningAlgorithms", + table: "ApiResources", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "ShowInDiscoveryDocument", + table: "ApiResources", + nullable: false, + defaultValue: false); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityResourceProperties", + table: "IdentityResourceProperties", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_ApiResourceProperties", + table: "ApiResourceProperties", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_ApiResourceClaims", + table: "ApiResourceClaims", + column: "Id"); + + migrationBuilder.CreateTable( + name: "ApiResourceScopes", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Scope = table.Column(maxLength: 200, nullable: false), + ApiResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiResourceScopes", x => x.Id); + table.ForeignKey( + name: "FK_ApiResourceScopes_ApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ApiResourceSecrets", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Description = table.Column(maxLength: 1000, nullable: true), + Value = table.Column(maxLength: 4000, nullable: false), + Expiration = table.Column(nullable: true), + Type = table.Column(maxLength: 250, nullable: false), + Created = table.Column(nullable: false), + ApiResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiResourceSecrets", x => x.Id); + table.ForeignKey( + name: "FK_ApiResourceSecrets_ApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ApiScopeProperties", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Key = table.Column(maxLength: 250, nullable: false), + Value = table.Column(maxLength: 2000, nullable: false), + ScopeId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiScopeProperties", x => x.Id); + table.ForeignKey( + name: "FK_ApiScopeProperties_ApiScopes_ScopeId", + column: x => x.ScopeId, + principalTable: "ApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityResourceClaims", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Type = table.Column(maxLength: 200, nullable: false), + IdentityResourceId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityResourceClaims", x => x.Id); + table.ForeignKey( + name: "FK_IdentityResourceClaims_IdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_ApiScopeClaims_ScopeId", + table: "ApiScopeClaims", + column: "ScopeId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiResourceScopes_ApiResourceId", + table: "ApiResourceScopes", + column: "ApiResourceId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiResourceSecrets_ApiResourceId", + table: "ApiResourceSecrets", + column: "ApiResourceId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiScopeProperties_ScopeId", + table: "ApiScopeProperties", + column: "ScopeId"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityResourceClaims_IdentityResourceId", + table: "IdentityResourceClaims", + column: "IdentityResourceId"); + + migrationBuilder.AddForeignKey( + name: "FK_ApiResourceClaims_ApiResources_ApiResourceId", + table: "ApiResourceClaims", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_ApiResourceProperties_ApiResources_ApiResourceId", + table: "ApiResourceProperties", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + // migrate data + + migrationBuilder.Sql(@"SET IDENTITY_INSERT ApiResourceSecrets ON; +GO + +INSERT INTO ApiResourceSecrets + (Id, [Description], [Value], Expiration, [Type], Created, ApiResourceId) +SELECT + Id, [Description], [Value], Expiration, [Type], Created, ApiResourceId +FROM ApiSecrets +GO + +SET IDENTITY_INSERT ApiResourceSecrets OFF; +GO"); + + migrationBuilder.Sql(@"SET IDENTITY_INSERT IdentityResourceClaims ON; +GO + +INSERT INTO IdentityResourceClaims + (Id, [Type], IdentityResourceId) +SELECT + Id, [Type], IdentityResourceId +FROM IdentityClaims +GO +SET IDENTITY_INSERT IdentityResourceClaims OFF; +GO"); + + migrationBuilder.Sql(@"INSERT INTO ApiResourceScopes + ([Scope], [ApiResourceId]) +SELECT + [Name], [ApiResourceId] +FROM ApiScopes"); + + migrationBuilder.Sql(@"UPDATE ApiScopeClaims SET ScopeId = ApiScopeId"); + + migrationBuilder.Sql(@"UPDATE ApiScopes SET [Enabled] = 1"); + + migrationBuilder.DropTable( + name: "ApiSecrets"); + + migrationBuilder.DropTable( + name: "IdentityClaims"); + + migrationBuilder.DropColumn( + name: "ApiResourceId", + table: "ApiScopes"); + + migrationBuilder.DropColumn( + name: "ApiScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.AddForeignKey( + name: "FK_ApiScopeClaims_ApiScopes_ScopeId", + table: "ApiScopeClaims", + column: "ScopeId", + principalTable: "ApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_IdentityResourceProperties_IdentityResources_IdentityResourceId", + table: "IdentityResourceProperties", + column: "IdentityResourceId", + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_ApiResourceClaims_ApiResources_ApiResourceId", + table: "ApiResourceClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiResourceProperties_ApiResources_ApiResourceId", + table: "ApiResourceProperties"); + + migrationBuilder.DropForeignKey( + name: "FK_ApiScopeClaims_ApiScopes_ScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropForeignKey( + name: "FK_IdentityResourceProperties_IdentityResources_IdentityResourceId", + table: "IdentityResourceProperties"); + + migrationBuilder.DropIndex( + name: "IX_ApiScopeClaims_ScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropPrimaryKey( + name: "PK_IdentityResourceProperties", + table: "IdentityResourceProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_ApiResourceProperties", + table: "ApiResourceProperties"); + + migrationBuilder.DropPrimaryKey( + name: "PK_ApiResourceClaims", + table: "ApiResourceClaims"); + + migrationBuilder.RenameTable( + name: "IdentityResourceProperties", + newName: "IdentityProperties"); + + migrationBuilder.RenameTable( + name: "ApiResourceProperties", + newName: "ApiProperties"); + + migrationBuilder.RenameTable( + name: "ApiResourceClaims", + newName: "ApiClaims"); + + migrationBuilder.RenameIndex( + name: "IX_IdentityResourceProperties_IdentityResourceId", + table: "IdentityProperties", + newName: "IX_IdentityProperties_IdentityResourceId"); + + migrationBuilder.RenameIndex( + name: "IX_ApiResourceProperties_ApiResourceId", + table: "ApiProperties", + newName: "IX_ApiProperties_ApiResourceId"); + + migrationBuilder.RenameIndex( + name: "IX_ApiResourceClaims_ApiResourceId", + table: "ApiClaims", + newName: "IX_ApiClaims_ApiResourceId"); + + migrationBuilder.AddColumn( + name: "ApiResourceId", + table: "ApiScopes", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "ApiScopeId", + table: "ApiScopeClaims", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddPrimaryKey( + name: "PK_IdentityProperties", + table: "IdentityProperties", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_ApiProperties", + table: "ApiProperties", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_ApiClaims", + table: "ApiClaims", + column: "Id"); + + migrationBuilder.CreateTable( + name: "ApiSecrets", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + ApiResourceId = table.Column(type: "int", nullable: false), + Created = table.Column(type: "datetime2", nullable: false), + Description = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + Expiration = table.Column(type: "datetime2", nullable: true), + Type = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), + Value = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ApiSecrets", x => x.Id); + table.ForeignKey( + name: "FK_ApiSecrets_ApiResources_ApiResourceId", + column: x => x.ApiResourceId, + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "IdentityClaims", + columns: table => new + { + Id = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + IdentityResourceId = table.Column(type: "int", nullable: false), + Type = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_IdentityClaims", x => x.Id); + table.ForeignKey( + name: "FK_IdentityClaims_IdentityResources_IdentityResourceId", + column: x => x.IdentityResourceId, + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_ApiScopes_ApiResourceId", + table: "ApiScopes", + column: "ApiResourceId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiScopeClaims_ApiScopeId", + table: "ApiScopeClaims", + column: "ApiScopeId"); + + migrationBuilder.CreateIndex( + name: "IX_ApiSecrets_ApiResourceId", + table: "ApiSecrets", + column: "ApiResourceId"); + + migrationBuilder.CreateIndex( + name: "IX_IdentityClaims_IdentityResourceId", + table: "IdentityClaims", + column: "IdentityResourceId"); + + migrationBuilder.AddForeignKey( + name: "FK_ApiClaims_ApiResources_ApiResourceId", + table: "ApiClaims", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_ApiProperties_ApiResources_ApiResourceId", + table: "ApiProperties", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + // Rollback data back + migrationBuilder.Sql(@"SET IDENTITY_INSERT ApiSecrets ON; +GO + +INSERT INTO ApiSecrets + (Id, [Description], [Value], Expiration, [Type], Created, ApiResourceId) +SELECT + Id, [Description], [Value], Expiration, [Type], Created, ApiResourceId +FROM ApiResourceSecrets +GO + +SET IDENTITY_INSERT ApiSecrets OFF; +GO"); + + migrationBuilder.Sql(@"SET IDENTITY_INSERT IdentityClaims ON; +GO + +INSERT INTO IdentityClaims + (Id, [Type], IdentityResourceId) +SELECT + Id, [Type], IdentityResourceId +FROM IdentityResourceClaims +GO +SET IDENTITY_INSERT IdentityClaims OFF; +GO"); + + migrationBuilder.Sql(@"UPDATE asp +SET ApiResourceId = arc.ApiResourceId +FROM ApiScopes asp + INNER JOIN ApiResourceScopes arc + ON arc.Id = asp.Id +"); + + migrationBuilder.Sql(@"UPDATE ApiScopeClaims SET ApiScopeId = ScopeId"); + + migrationBuilder.DropTable( + name: "ApiResourceScopes"); + + migrationBuilder.DropTable( + name: "ApiResourceSecrets"); + + migrationBuilder.DropTable( + name: "ApiScopeProperties"); + + migrationBuilder.DropTable( + name: "IdentityResourceClaims"); + + migrationBuilder.DropColumn( + name: "AllowedIdentityTokenSigningAlgorithms", + table: "Clients"); + + migrationBuilder.DropColumn( + name: "RequireRequestObject", + table: "Clients"); + + migrationBuilder.DropColumn( + name: "Enabled", + table: "ApiScopes"); + + migrationBuilder.DropColumn( + name: "ScopeId", + table: "ApiScopeClaims"); + + migrationBuilder.DropColumn( + name: "AllowedAccessTokenSigningAlgorithms", + table: "ApiResources"); + + migrationBuilder.DropColumn( + name: "ShowInDiscoveryDocument", + table: "ApiResources"); + + migrationBuilder.AddForeignKey( + name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId", + table: "ApiScopeClaims", + column: "ApiScopeId", + principalTable: "ApiScopes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_ApiScopes_ApiResources_ApiResourceId", + table: "ApiScopes", + column: "ApiResourceId", + principalTable: "ApiResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_IdentityProperties_IdentityResources_IdentityResourceId", + table: "IdentityProperties", + column: "IdentityResourceId", + principalTable: "IdentityResources", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs index da2d4654d..9701b25f5 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerConfiguration/IdentityServerConfigurationDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.9") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -26,6 +26,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + b.Property("Created") .HasColumnType("datetime2"); @@ -51,6 +55,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("NonEditable") .HasColumnType("bit"); + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + b.Property("Updated") .HasColumnType("datetime2"); @@ -81,7 +88,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ApiResourceId"); - b.ToTable("ApiClaims"); + b.ToTable("ApiResourceClaims"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b => @@ -108,10 +115,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ApiResourceId"); - b.ToTable("ApiProperties"); + b.ToTable("ApiResourceProperties"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -121,6 +128,62 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ApiResourceId") .HasColumnType("int"); + b.Property("Scope") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceScopes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ApiResourceId") + .HasColumnType("int"); + + b.Property("Created") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.HasKey("Id"); + + b.HasIndex("ApiResourceId"); + + b.ToTable("ApiResourceSecrets"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + b.Property("Description") .HasColumnType("nvarchar(1000)") .HasMaxLength(1000); @@ -132,6 +195,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Emphasize") .HasColumnType("bit"); + b.Property("Enabled") + .HasColumnType("bit"); + b.Property("Name") .IsRequired() .HasColumnType("nvarchar(200)") @@ -145,8 +211,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("ApiResourceId"); - b.HasIndex("Name") .IsUnique(); @@ -160,7 +224,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ApiScopeId") + b.Property("ScopeId") .HasColumnType("int"); b.Property("Type") @@ -170,46 +234,36 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("ApiScopeId"); + b.HasIndex("ScopeId"); b.ToTable("ApiScopeClaims"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("ApiResourceId") - .HasColumnType("int"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("Description") - .HasColumnType("nvarchar(1000)") - .HasMaxLength(1000); - - b.Property("Expiration") - .HasColumnType("datetime2"); - - b.Property("Type") + b.Property("Key") .IsRequired() .HasColumnType("nvarchar(250)") .HasMaxLength(250); + b.Property("ScopeId") + .HasColumnType("int"); + b.Property("Value") .IsRequired() - .HasColumnType("nvarchar(4000)") - .HasMaxLength(4000); + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); b.HasKey("Id"); - b.HasIndex("ApiResourceId"); + b.HasIndex("ScopeId"); - b.ToTable("ApiSecrets"); + b.ToTable("ApiScopeProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b => @@ -240,6 +294,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("AllowRememberConsent") .HasColumnType("bit"); + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + b.Property("AlwaysIncludeUserClaimsInIdToken") .HasColumnType("bit"); @@ -339,6 +397,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("RequirePkce") .HasColumnType("bit"); + b.Property("RequireRequestObject") + .HasColumnType("bit"); + b.Property("SlidingRefreshTokenLifetime") .HasColumnType("int"); @@ -586,28 +647,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("ClientSecrets"); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("IdentityResourceId") - .HasColumnType("int"); - - b.Property("Type") - .IsRequired() - .HasColumnType("nvarchar(200)") - .HasMaxLength(200); - - b.HasKey("Id"); - - b.HasIndex("IdentityResourceId"); - - b.ToTable("IdentityClaims"); - }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b => { b.Property("Id") @@ -657,6 +696,28 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("IdentityResources"); }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("IdentityResourceId") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("IdentityResourceId"); + + b.ToTable("IdentityResourceClaims"); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b => { b.Property("Id") @@ -681,7 +742,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("IdentityResourceId"); - b.ToTable("IdentityProperties"); + b.ToTable("IdentityResourceProperties"); }); modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b => @@ -702,7 +763,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceScope", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") .WithMany("Scopes") @@ -711,20 +772,29 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceSecret", b => + { + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "ApiScope") + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") .WithMany("UserClaims") - .HasForeignKey("ApiScopeId") + .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeProperty", b => { - b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource") - .WithMany("Secrets") - .HasForeignKey("ApiResourceId") + b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "Scope") + .WithMany("Properties") + .HasForeignKey("ScopeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); @@ -810,7 +880,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); - modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b => + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceClaim", b => { b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource") .WithMany("UserClaims") diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerGrants/20201030101834_UpdateIdentityServerToVersion4.Designer.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerGrants/20201030101834_UpdateIdentityServerToVersion4.Designer.cs new file mode 100644 index 000000000..e62954324 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerGrants/20201030101834_UpdateIdentityServerToVersion4.Designer.cs @@ -0,0 +1,129 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Skoruba.IdentityServer4.Admin.EntityFramework.Shared.DbContexts; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.Migrations.IdentityServerGrants +{ + [DbContext(typeof(IdentityServerPersistedGrantDbContext))] + [Migration("20201030101834_UpdateIdentityServerToVersion4")] + partial class UpdateIdentityServerToVersion4 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.9") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b => + { + b.Property("UserCode") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("Description") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("SessionId") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("UserCode"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.ToTable("DeviceCodes"); + }); + + modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b => + { + b.Property("Key") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConsumedTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("Description") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("SessionId") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("PersistedGrants"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerGrants/20201030101834_UpdateIdentityServerToVersion4.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerGrants/20201030101834_UpdateIdentityServerToVersion4.cs new file mode 100644 index 000000000..43dcd33ce --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerGrants/20201030101834_UpdateIdentityServerToVersion4.cs @@ -0,0 +1,72 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.Migrations.IdentityServerGrants +{ + public partial class UpdateIdentityServerToVersion4 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ConsumedTime", + table: "PersistedGrants", + nullable: true); + + migrationBuilder.AddColumn( + name: "Description", + table: "PersistedGrants", + maxLength: 200, + nullable: true); + + migrationBuilder.AddColumn( + name: "SessionId", + table: "PersistedGrants", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "Description", + table: "DeviceCodes", + maxLength: 200, + nullable: true); + + migrationBuilder.AddColumn( + name: "SessionId", + table: "DeviceCodes", + maxLength: 100, + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_PersistedGrants_SubjectId_SessionId_Type", + table: "PersistedGrants", + columns: new[] { "SubjectId", "SessionId", "Type" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_PersistedGrants_SubjectId_SessionId_Type", + table: "PersistedGrants"); + + migrationBuilder.DropColumn( + name: "ConsumedTime", + table: "PersistedGrants"); + + migrationBuilder.DropColumn( + name: "Description", + table: "PersistedGrants"); + + migrationBuilder.DropColumn( + name: "SessionId", + table: "PersistedGrants"); + + migrationBuilder.DropColumn( + name: "Description", + table: "DeviceCodes"); + + migrationBuilder.DropColumn( + name: "SessionId", + table: "DeviceCodes"); + } + } +} diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs index 5e089b1f6..d9ff3468f 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Migrations/IdentityServerGrants/IdentityServerPersistedGrantDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") + .HasAnnotation("ProductVersion", "3.1.9") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -38,6 +38,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(max)") .HasMaxLength(50000); + b.Property("Description") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + b.Property("DeviceCode") .IsRequired() .HasColumnType("nvarchar(200)") @@ -47,6 +51,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired() .HasColumnType("datetime2"); + b.Property("SessionId") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + b.Property("SubjectId") .HasColumnType("nvarchar(200)") .HasMaxLength(200); @@ -72,6 +80,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(200)") .HasMaxLength(200); + b.Property("ConsumedTime") + .HasColumnType("datetime2"); + b.Property("CreationTime") .HasColumnType("datetime2"); @@ -80,9 +91,17 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(max)") .HasMaxLength(50000); + b.Property("Description") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + b.Property("Expiration") .HasColumnType("datetime2"); + b.Property("SessionId") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + b.Property("SubjectId") .HasColumnType("nvarchar(200)") .HasMaxLength(200); @@ -98,6 +117,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("SubjectId", "ClientId", "Type"); + b.HasIndex("SubjectId", "SessionId", "Type"); + b.ToTable("PersistedGrants"); }); #pragma warning restore 612, 618 diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj index e9a67b815..ff302143b 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer/Skoruba.IdentityServer4.Admin.EntityFramework.SqlServer.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 1.0.0 + 2.0.0-beta1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity Entity Framework layer for the administration of the IdentityServer4 and Asp.Net Core Identity with SqlServer support @@ -12,8 +12,8 @@ - - + + @@ -27,3 +27,4 @@ + diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Constants/ClientConsts.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Constants/ClientConsts.cs index c78f8cd23..db8b5a26f 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Constants/ClientConsts.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Constants/ClientConsts.cs @@ -46,19 +46,37 @@ public static List GetStandardClaims() public static List GetGrantTypes() { var allowedGrantypes = new List - { - "implicit", - "client_credentials", - "authorization_code", - "hybrid", - "password", - "urn:ietf:params:oauth:grant-type:device_code", - "delegation" - }; + { + "implicit", + "client_credentials", + "authorization_code", + "hybrid", + "password", + "urn:ietf:params:oauth:grant-type:device_code", + "delegation" + }; return allowedGrantypes; } + public static List SigningAlgorithms() + { + var signingAlgorithms = new List + { + "RS256", + "RS384", + "RS512", + "PS256", + "PS384", + "PS512", + "ES256", + "ES384", + "ES512" + }; + + return signingAlgorithms; + } + public static List GetProtocolTypes() { var protocolTypes = new List { new SelectItem("oidc", "OpenID Connect") }; diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Interfaces/IAdminConfigurationDbContext.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Interfaces/IAdminConfigurationDbContext.cs index dd30a14f7..6f5eafc54 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Interfaces/IAdminConfigurationDbContext.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Interfaces/IAdminConfigurationDbContext.cs @@ -6,13 +6,13 @@ namespace Skoruba.IdentityServer4.Admin.EntityFramework.Interfaces { public interface IAdminConfigurationDbContext : IConfigurationDbContext { - DbSet ApiSecrets { get; set; } + DbSet ApiSecrets { get; set; } DbSet ApiScopes { get; set; } DbSet ApiScopeClaims { get; set; } - DbSet IdentityClaims { get; set; } + DbSet IdentityClaims { get; set; } DbSet ApiResourceClaims { get; set; } @@ -37,5 +37,9 @@ public interface IAdminConfigurationDbContext : IConfigurationDbContext DbSet IdentityResourceProperties { get; set; } DbSet ApiResourceProperties { get; set; } + + DbSet ApiScopeProperties { get; set; } + + DbSet ApiResourceScopes { get; set; } } } diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiResourceRepository.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiResourceRepository.cs index 7ff24ab48..6d090cc1c 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiResourceRepository.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiResourceRepository.cs @@ -43,6 +43,7 @@ public virtual Task GetApiResourceAsync(int apiResourceId) { return DbContext.ApiResources .Include(x => x.UserClaims) + .Include(x => x.Scopes) .Where(x => x.Id == apiResourceId) .AsNoTracking() .SingleOrDefaultAsync(); @@ -109,20 +110,6 @@ public virtual async Task CanInsertApiResourcePropertyAsync(ApiResourcePro return existsWithSameName == null; } - public virtual async Task CanInsertApiScopeAsync(ApiScope apiScope) - { - if (apiScope.Id == 0) - { - var existsWithSameName = await DbContext.ApiScopes.Where(x => x.Name == apiScope.Name).SingleOrDefaultAsync(); - return existsWithSameName == null; - } - else - { - var existsWithSameName = await DbContext.ApiScopes.Where(x => x.Name == apiScope.Name && x.Id != apiScope.Id).SingleOrDefaultAsync(); - return existsWithSameName == null; - } - } - /// /// Add new api resource /// @@ -139,15 +126,23 @@ public virtual async Task AddApiResourceAsync(ApiResource apiResource) private async Task RemoveApiResourceClaimsAsync(ApiResource identityResource) { - //Remove old identity claims + //Remove old api resource claims var apiResourceClaims = await DbContext.ApiResourceClaims.Where(x => x.ApiResource.Id == identityResource.Id).ToListAsync(); DbContext.ApiResourceClaims.RemoveRange(apiResourceClaims); } + private async Task RemoveApiResourceScopesAsync(ApiResource identityResource) + { + //Remove old api resource scopes + var apiResourceScopes = await DbContext.ApiResourceScopes.Where(x => x.ApiResource.Id == identityResource.Id).ToListAsync(); + DbContext.ApiResourceScopes.RemoveRange(apiResourceScopes); + } + public virtual async Task UpdateApiResourceAsync(ApiResource apiResource) { //Remove old relations await RemoveApiResourceClaimsAsync(apiResource); + await RemoveApiResourceScopesAsync(apiResource); //Update with new data DbContext.ApiResources.Update(apiResource); @@ -164,81 +159,10 @@ public virtual async Task DeleteApiResourceAsync(ApiResource apiResource) return await AutoSaveChangesAsync(); } - public virtual async Task> GetApiScopesAsync(int apiResourceId, int page = 1, int pageSize = 10) - { - var pagedList = new PagedList(); - - var apiScopes = await DbContext.ApiScopes - .Include(x => x.ApiResource) - .Where(x => x.ApiResource.Id == apiResourceId).PageBy(x => x.Name, page, pageSize).ToListAsync(); - - pagedList.Data.AddRange(apiScopes); - pagedList.TotalCount = await DbContext.ApiScopes.Where(x => x.ApiResource.Id == apiResourceId).CountAsync(); - pagedList.PageSize = pageSize; - - return pagedList; - } - - public virtual Task GetApiScopeAsync(int apiResourceId, int apiScopeId) - { - return DbContext.ApiScopes - .Include(x => x.UserClaims) - .Include(x => x.ApiResource) - .Where(x => x.Id == apiScopeId && x.ApiResource.Id == apiResourceId) - .AsNoTracking() - .SingleOrDefaultAsync(); - } - - /// - /// Add new api scope - /// - /// - /// - /// This method return new api scope id - public virtual async Task AddApiScopeAsync(int apiResourceId, ApiScope apiScope) - { - var apiResource = await DbContext.ApiResources.Where(x => x.Id == apiResourceId).SingleOrDefaultAsync(); - apiScope.ApiResource = apiResource; - - DbContext.ApiScopes.Add(apiScope); - - await AutoSaveChangesAsync(); - - return apiScope.Id; - } - - private async Task RemoveApiScopeClaimsAsync(ApiScope apiScope) - { - //Remove old api scope claims - var apiScopeClaims = await DbContext.ApiScopeClaims.Where(x => x.ApiScope.Id == apiScope.Id).ToListAsync(); - DbContext.ApiScopeClaims.RemoveRange(apiScopeClaims); - } - - public virtual async Task UpdateApiScopeAsync(int apiResourceId, ApiScope apiScope) - { - var apiResource = await DbContext.ApiResources.Where(x => x.Id == apiResourceId).SingleOrDefaultAsync(); - apiScope.ApiResource = apiResource; - - //Remove old relations - await RemoveApiScopeClaimsAsync(apiScope); - - //Update with new data - DbContext.ApiScopes.Update(apiScope); - - return await AutoSaveChangesAsync(); - } - - public virtual async Task DeleteApiScopeAsync(ApiScope apiScope) - { - var apiScopeToDelete = await DbContext.ApiScopes.Where(x => x.Id == apiScope.Id).SingleOrDefaultAsync(); - DbContext.ApiScopes.Remove(apiScopeToDelete); - - return await AutoSaveChangesAsync(); - } - - public virtual async Task> GetApiSecretsAsync(int apiResourceId, int page = 1, int pageSize = 10) + + public virtual async Task> GetApiSecretsAsync(int apiResourceId, int page = 1, int pageSize = 10) { - var pagedList = new PagedList(); + var pagedList = new PagedList(); var apiSecrets = await DbContext.ApiSecrets.Where(x => x.ApiResource.Id == apiResourceId).PageBy(x => x.Id, page, pageSize).ToListAsync(); pagedList.Data.AddRange(apiSecrets); @@ -248,7 +172,7 @@ public virtual async Task> GetApiSecretsAsync(int apiResour return pagedList; } - public virtual Task GetApiSecretAsync(int apiSecretId) + public virtual Task GetApiSecretAsync(int apiSecretId) { return DbContext.ApiSecrets .Include(x => x.ApiResource) @@ -257,7 +181,7 @@ public virtual Task GetApiSecretAsync(int apiSecretId) .SingleOrDefaultAsync(); } - public virtual async Task AddApiSecretAsync(int apiResourceId, ApiSecret apiSecret) + public virtual async Task AddApiSecretAsync(int apiResourceId, ApiResourceSecret apiSecret) { apiSecret.ApiResource = await DbContext.ApiResources.Where(x => x.Id == apiResourceId).SingleOrDefaultAsync(); await DbContext.ApiSecrets.AddAsync(apiSecret); @@ -265,7 +189,7 @@ public virtual async Task AddApiSecretAsync(int apiResourceId, ApiSecret ap return await AutoSaveChangesAsync(); } - public virtual async Task DeleteApiSecretAsync(ApiSecret apiSecret) + public virtual async Task DeleteApiSecretAsync(ApiResourceSecret apiSecret) { var apiSecretToDelete = await DbContext.ApiSecrets.Where(x => x.Id == apiSecret.Id).SingleOrDefaultAsync(); DbContext.ApiSecrets.Remove(apiSecretToDelete); diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiScopeRepository.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiScopeRepository.cs new file mode 100644 index 000000000..1730594f4 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ApiScopeRepository.cs @@ -0,0 +1,187 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Threading.Tasks; +using IdentityServer4.EntityFramework.Entities; +using Microsoft.EntityFrameworkCore; +using Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.Common; +using Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.Enums; +using Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.Extensions; +using Skoruba.IdentityServer4.Admin.EntityFramework.Interfaces; +using Skoruba.IdentityServer4.Admin.EntityFramework.Repositories.Interfaces; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.Repositories +{ + public class ApiScopeRepository : IApiScopeRepository + where TDbContext : DbContext, IAdminConfigurationDbContext + { + protected readonly TDbContext DbContext; + + public bool AutoSaveChanges { get; set; } = true; + + public ApiScopeRepository(TDbContext dbContext) + { + DbContext = dbContext; + } + + public virtual Task GetApiScopePropertyAsync(int apiScopePropertyId) + { + return DbContext.ApiScopeProperties + .Include(x => x.Scope) + .Where(x => x.Id == apiScopePropertyId) + .SingleOrDefaultAsync(); + } + + public virtual async Task AddApiScopePropertyAsync(int apiScopeId, ApiScopeProperty apiScopeProperty) + { + var apiScope = await DbContext.ApiScopes.Where(x => x.Id == apiScopeId).SingleOrDefaultAsync(); + + apiScopeProperty.Scope = apiScope; + await DbContext.ApiScopeProperties.AddAsync(apiScopeProperty); + + return await AutoSaveChangesAsync(); + } + + public virtual async Task DeleteApiScopePropertyAsync(ApiScopeProperty apiScopeProperty) + { + var propertyToDelete = await DbContext.ApiScopeProperties.Where(x => x.Id == apiScopeProperty.Id).SingleOrDefaultAsync(); + + DbContext.ApiScopeProperties.Remove(propertyToDelete); + + return await AutoSaveChangesAsync(); + } + + public virtual async Task CanInsertApiScopePropertyAsync(ApiScopeProperty apiScopeProperty) + { + var existsWithSameName = await DbContext.ApiScopeProperties.Where(x => x.Key == apiScopeProperty.Key + && x.Scope.Id == apiScopeProperty.Scope.Id).SingleOrDefaultAsync(); + return existsWithSameName == null; + } + + + public virtual async Task GetApiScopeNameAsync(int apiScopeId) + { + var apiScopeName = await DbContext.ApiScopes.Where(x => x.Id == apiScopeId).Select(x => x.Name).SingleOrDefaultAsync(); + + return apiScopeName; + } + + public virtual async Task> GetApiScopePropertiesAsync(int apiScopeId, int page = 1, int pageSize = 10) + { + var pagedList = new PagedList(); + + var apiScopeProperties = DbContext.ApiScopeProperties.Where(x => x.Scope.Id == apiScopeId); + + var properties = await apiScopeProperties.PageBy(x => x.Id, page, pageSize) + .ToListAsync(); + + pagedList.Data.AddRange(properties); + pagedList.TotalCount = await apiScopeProperties.CountAsync(); + pagedList.PageSize = pageSize; + + return pagedList; + } + + public virtual async Task CanInsertApiScopeAsync(ApiScope apiScope) + { + if (apiScope.Id == 0) + { + var existsWithSameName = await DbContext.ApiScopes.Where(x => x.Name == apiScope.Name).SingleOrDefaultAsync(); + return existsWithSameName == null; + } + else + { + var existsWithSameName = await DbContext.ApiScopes.Where(x => x.Name == apiScope.Name && x.Id != apiScope.Id).SingleOrDefaultAsync(); + return existsWithSameName == null; + } + } + + public virtual async Task> GetApiScopesAsync(string search, int page = 1, int pageSize = 10) + { + var pagedList = new PagedList(); + Expression> searchCondition = x => x.Name.Contains(search); + + var filteredApiScopes = DbContext.ApiScopes + .WhereIf(!string.IsNullOrEmpty(search), searchCondition); + + var apiScopes = await filteredApiScopes + .PageBy(x => x.Name, page, pageSize).ToListAsync(); + + pagedList.Data.AddRange(apiScopes); + pagedList.TotalCount = await filteredApiScopes.CountAsync(); + pagedList.PageSize = pageSize; + + return pagedList; + } + + public virtual async Task> GetApiScopesNameAsync(string scope, int limit = 0) + { + var apiScopes = await DbContext.ApiScopes + .WhereIf(!string.IsNullOrEmpty(scope), x => x.Name.Contains(scope)) + .TakeIf(x => x.Id, limit > 0, limit) + .Select(x => x.Name).ToListAsync(); + + return apiScopes; + } + + public virtual Task GetApiScopeAsync(int apiScopeId) + { + return DbContext.ApiScopes + .Include(x => x.UserClaims) + .Where(x => x.Id == apiScopeId) + .AsNoTracking() + .SingleOrDefaultAsync(); + } + + /// + /// Add new api scope + /// + /// + /// This method return new api scope id + public virtual async Task AddApiScopeAsync(ApiScope apiScope) + { + await DbContext.ApiScopes.AddAsync(apiScope); + + await AutoSaveChangesAsync(); + + return apiScope.Id; + } + + private async Task RemoveApiScopeClaimsAsync(ApiScope apiScope) + { + //Remove old api scope claims + var apiScopeClaims = await DbContext.ApiScopeClaims.Where(x => x.Scope.Id == apiScope.Id).ToListAsync(); + DbContext.ApiScopeClaims.RemoveRange(apiScopeClaims); + } + + public virtual async Task UpdateApiScopeAsync(ApiScope apiScope) + { + //Remove old relations + await RemoveApiScopeClaimsAsync(apiScope); + + //Update with new data + DbContext.ApiScopes.Update(apiScope); + + return await AutoSaveChangesAsync(); + } + + public virtual async Task DeleteApiScopeAsync(ApiScope apiScope) + { + var apiScopeToDelete = await DbContext.ApiScopes.Where(x => x.Id == apiScope.Id).SingleOrDefaultAsync(); + DbContext.ApiScopes.Remove(apiScopeToDelete); + + return await AutoSaveChangesAsync(); + } + + protected virtual async Task AutoSaveChangesAsync() + { + return AutoSaveChanges ? await DbContext.SaveChangesAsync() : (int)SavedStatus.WillBeSavedExplicitly; + } + + public virtual async Task SaveAllChangesAsync() + { + return await DbContext.SaveChangesAsync(); + } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ClientRepository.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ClientRepository.cs index 4c23b9d69..7fc060587 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ClientRepository.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/ClientRepository.cs @@ -14,6 +14,7 @@ using Skoruba.IdentityServer4.Admin.EntityFramework.Interfaces; using Skoruba.IdentityServer4.Admin.EntityFramework.Repositories.Interfaces; using Client = IdentityServer4.EntityFramework.Entities.Client; +using ClientClaim = IdentityServer4.EntityFramework.Entities.ClientClaim; namespace Skoruba.IdentityServer4.Admin.EntityFramework.Repositories { @@ -85,6 +86,17 @@ public virtual List GetGrantTypes(string grant, int limit = 0) return filteredGrants; } + public virtual List GetSigningAlgorithms(string algorithm, int limit = 0) + { + var signingAlgorithms = ClientConsts.SigningAlgorithms() + .WhereIf(!string.IsNullOrWhiteSpace(algorithm), x => x.Contains(algorithm)) + .TakeIf(x => x, limit > 0, limit) + .OrderBy(x => x) + .ToList(); + + return signingAlgorithms; + } + public virtual List GetProtocolTypes() { return ClientConsts.GetProtocolTypes(); diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IApiResourceRepository.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IApiResourceRepository.cs index b1adc6b2f..fc6281f90 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IApiResourceRepository.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IApiResourceRepository.cs @@ -29,25 +29,13 @@ public interface IApiResourceRepository Task CanInsertApiResourceAsync(ApiResource apiResource); - Task> GetApiScopesAsync(int apiResourceId, int page = 1, int pageSize = 10); + Task> GetApiSecretsAsync(int apiResourceId, int page = 1, int pageSize = 10); - Task GetApiScopeAsync(int apiResourceId, int apiScopeId); + Task AddApiSecretAsync(int apiResourceId, ApiResourceSecret apiSecret); - Task AddApiScopeAsync(int apiResourceId, ApiScope apiScope); + Task GetApiSecretAsync(int apiSecretId); - Task UpdateApiScopeAsync(int apiResourceId, ApiScope apiScope); - - Task DeleteApiScopeAsync(ApiScope apiScope); - - Task> GetApiSecretsAsync(int apiResourceId, int page = 1, int pageSize = 10); - - Task AddApiSecretAsync(int apiResourceId, ApiSecret apiSecret); - - Task GetApiSecretAsync(int apiSecretId); - - Task DeleteApiSecretAsync(ApiSecret apiSecret); - - Task CanInsertApiScopeAsync(ApiScope apiScope); + Task DeleteApiSecretAsync(ApiResourceSecret apiSecret); Task SaveAllChangesAsync(); diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IApiScopeRepository.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IApiScopeRepository.cs new file mode 100644 index 000000000..9c46dc9e2 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IApiScopeRepository.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using IdentityServer4.EntityFramework.Entities; +using Skoruba.IdentityServer4.Admin.EntityFramework.Extensions.Common; + +namespace Skoruba.IdentityServer4.Admin.EntityFramework.Repositories.Interfaces +{ + public interface IApiScopeRepository + { + Task> GetApiScopesAsync(string search, int page = 1, int pageSize = 10); + + Task GetApiScopeAsync(int apiScopeId); + + Task AddApiScopeAsync(ApiScope apiScope); + + Task UpdateApiScopeAsync(ApiScope apiScope); + + Task DeleteApiScopeAsync(ApiScope apiScope); + + Task CanInsertApiScopeAsync(ApiScope apiScope); + + Task> GetApiScopesNameAsync(string scope, int limit = 0); + + Task> GetApiScopePropertiesAsync(int apiScopeId, int page = 1, int pageSize = 10); + + Task GetApiScopePropertyAsync(int apiScopePropertyId); + + Task AddApiScopePropertyAsync(int apiScopeId, ApiScopeProperty apiScopeProperty); + + Task CanInsertApiScopePropertyAsync(ApiScopeProperty apiScopeProperty); + + Task DeleteApiScopePropertyAsync(ApiScopeProperty apiScopeProperty); + + Task GetApiScopeNameAsync(int apiScopeId); + + Task SaveAllChangesAsync(); + + bool AutoSaveChanges { get; set; } + } +} \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IClientRepository.cs b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IClientRepository.cs index a96c95546..677d62c8d 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IClientRepository.cs +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Repositories/Interfaces/IClientRepository.cs @@ -73,7 +73,9 @@ Task CloneClientAsync(Client client, Task DeleteClientPropertyAsync(ClientProperty clientProperty); - Task SaveAllChangesAsync(); + List GetSigningAlgorithms(string algorithm, int limit = 0); + + Task SaveAllChangesAsync(); bool AutoSaveChanges { get; set; } } diff --git a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj index 7125cddd9..0eb6fd06b 100644 --- a/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj +++ b/src/Skoruba.IdentityServer4.Admin.EntityFramework/Skoruba.IdentityServer4.Admin.EntityFramework.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 1.0.0 + 2.0.0-beta1 Jan Škoruba IdentityServer4 Admin OpenIDConnect OAuth2 Identity Entity Framework layer for the administration of the IdentityServer4 @@ -12,7 +12,7 @@ - + @@ -24,3 +24,4 @@ + diff --git a/src/Skoruba.IdentityServer4.Admin/Configuration/IdentityServerDataConfiguration.cs b/src/Skoruba.IdentityServer4.Admin/Configuration/IdentityServerDataConfiguration.cs index 4b002875e..57679aee1 100644 --- a/src/Skoruba.IdentityServer4.Admin/Configuration/IdentityServerDataConfiguration.cs +++ b/src/Skoruba.IdentityServer4.Admin/Configuration/IdentityServerDataConfiguration.cs @@ -9,5 +9,6 @@ public class IdentityServerDataConfiguration public List Clients { get; set; } = new List(); public List IdentityResources { get; set; } = new List(); public List ApiResources { get; set; } = new List(); + public List ApiScopes { get; set; } = new List(); } } diff --git a/src/Skoruba.IdentityServer4.Admin/Controllers/ConfigurationController.cs b/src/Skoruba.IdentityServer4.Admin/Controllers/ConfigurationController.cs index 57c2c2e10..afb97bab9 100644 --- a/src/Skoruba.IdentityServer4.Admin/Controllers/ConfigurationController.cs +++ b/src/Skoruba.IdentityServer4.Admin/Controllers/ConfigurationController.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System.Linq; +using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Localization; @@ -19,18 +20,21 @@ public class ConfigurationController : BaseController private readonly IApiResourceService _apiResourceService; private readonly IClientService _clientService; private readonly IStringLocalizer _localizer; + private readonly IApiScopeService _apiScopeService; public ConfigurationController(IIdentityResourceService identityResourceService, IApiResourceService apiResourceService, IClientService clientService, IStringLocalizer localizer, - ILogger logger) + ILogger logger, + IApiScopeService apiScopeService) : base(logger) { _identityResourceService = identityResourceService; _apiResourceService = apiResourceService; _clientService = clientService; _localizer = localizer; + _apiScopeService = apiScopeService; } [HttpGet] @@ -154,6 +158,31 @@ public async Task ApiResourceProperties(int id, int? page) return View(properties); } + [HttpGet] + public async Task ApiScopeProperties(int id, int? page) + { + if (id == 0) return NotFound(); + + var properties = await _apiScopeService.GetApiScopePropertiesAsync(id, page ?? 1); + + return View(properties); + } + + [HttpPost] + [ValidateAntiForgeryToken] + public async Task ApiScopeProperties(ApiScopePropertiesDto apiScopeProperty) + { + if (!ModelState.IsValid) + { + return View(apiScopeProperty); + } + + await _apiScopeService.AddApiScopePropertyAsync(apiScopeProperty); + SuccessNotification(string.Format(_localizer["SuccessAddApiScopeProperty"], apiScopeProperty.Key, apiScopeProperty.ApiScopeName), _localizer["SuccessTitle"]); + + return RedirectToAction(nameof(ApiScopeProperties), new { Id = apiScopeProperty.ApiScopeId }); + } + [HttpPost] [ValidateAntiForgeryToken] public async Task ApiResourceProperties(ApiResourcePropertiesDto apiResourceProperty) @@ -254,6 +283,26 @@ public async Task ApiResourcePropertyDelete(int id) return View(nameof(ApiResourcePropertyDelete), apiResourceProperty); } + [HttpGet] + public async Task ApiScopePropertyDelete(int id) + { + if (id == 0) return NotFound(); + + var apiScopeProperty = await _apiScopeService.GetApiScopePropertyAsync(id); + + return View(nameof(ApiScopePropertyDelete), apiScopeProperty); + } + + [HttpPost] + [ValidateAntiForgeryToken] + public async Task ApiScopePropertyDelete(ApiScopePropertiesDto apiScopeProperty) + { + await _apiScopeService.DeleteApiScopePropertyAsync(apiScopeProperty); + SuccessNotification(_localizer["SuccessDeleteApiScopeProperty"], _localizer["SuccessTitle"]); + + return RedirectToAction(nameof(ApiScopeProperties), new { Id = apiScopeProperty.ApiScopeId }); + } + [HttpGet] public async Task IdentityResourcePropertyDelete(int id) { @@ -352,6 +401,14 @@ public async Task SearchScopes(string scope, int limit = 0) return Ok(scopes); } + [HttpGet] + public async Task SearchApiScopes(string scope, int limit = 0) + { + var scopes = await _apiScopeService.GetApiScopesNameAsync(scope, limit); + + return Ok(scopes.ToList()); + } + [HttpGet] public IActionResult SearchClaims(string claim, int limit = 0) { @@ -360,6 +417,15 @@ public IActionResult SearchClaims(string claim, int limit = 0) return Ok(claims); } + [HttpGet] + public IActionResult SearchSigningAlgorithms(string algorithm, int limit = 0) + { + var signingAlgorithms = _clientService.GetSigningAlgorithms(algorithm, limit); + + return Ok(signingAlgorithms); + } + + [HttpGet] public IActionResult SearchGrantTypes(string grant, int limit = 0) { @@ -433,6 +499,8 @@ public async Task ApiResource(ApiResourceDto apiResource) } ComboBoxHelpers.PopulateValuesToList(apiResource.UserClaimsItems, apiResource.UserClaims); + ComboBoxHelpers.PopulateValuesToList(apiResource.ScopesItems, apiResource.Scopes); + ComboBoxHelpers.PopulateValuesToList(apiResource.AllowedAccessTokenSigningAlgorithmsItems, apiResource.AllowedAccessTokenSigningAlgorithms); int apiResourceId; @@ -514,69 +582,77 @@ public async Task ApiSecrets(ApiSecretsDto apiSecret) } [HttpGet] - public async Task ApiScopes(int id, int? page, int? scope) + public async Task ApiScopes(string search, int? page) { - if (id == 0 || !ModelState.IsValid) return NotFound(); + ViewBag.Search = search; + var apiScopesDto = await _apiScopeService.GetApiScopesAsync(search, page ?? 1); - if (scope == null) + return View(apiScopesDto); + } + + [HttpGet] + public async Task ApiScope(int? id) + { + if (id == null) { - var apiScopesDto = await _apiResourceService.GetApiScopesAsync(id, page ?? 1); + var apiScopeDto = new ApiScopeDto(); - return View(apiScopesDto); + return View(apiScopeDto); } else { - var apiScopesDto = await _apiResourceService.GetApiScopeAsync(id, scope.Value); - return View(apiScopesDto); + var apiScopeDto = await _apiScopeService.GetApiScopeAsync(id.Value); + + return View(apiScopeDto); } } [HttpPost] [ValidateAntiForgeryToken] - public async Task ApiScopes(ApiScopesDto apiScope) + public async Task ApiScope(ApiScopeDto apiScope) { if (!ModelState.IsValid) { return View(apiScope); } - _apiResourceService.BuildApiScopeViewModel(apiScope); + _apiScopeService.BuildApiScopeViewModel(apiScope); int apiScopeId; - if (apiScope.ApiScopeId == 0) + if (apiScope.Id == 0) { - apiScopeId = await _apiResourceService.AddApiScopeAsync(apiScope); + apiScopeId = await _apiScopeService.AddApiScopeAsync(apiScope); } else { - apiScopeId = apiScope.ApiScopeId; - await _apiResourceService.UpdateApiScopeAsync(apiScope); + apiScopeId = apiScope.Id; + await _apiScopeService.UpdateApiScopeAsync(apiScope); } SuccessNotification(string.Format(_localizer["SuccessAddApiScope"], apiScope.Name), _localizer["SuccessTitle"]); - return RedirectToAction(nameof(ApiScopes), new { Id = apiScope.ApiResourceId, Scope = apiScopeId }); + return RedirectToAction(nameof(ApiScope), new { Scope = apiScopeId }); } [HttpGet] - public async Task ApiScopeDelete(int id, int scope) + public async Task ApiScopeDelete(int id) { - if (id == 0 || scope == 0) return NotFound(); + if (id == 0) return NotFound(); - var apiScope = await _apiResourceService.GetApiScopeAsync(id, scope); + var apiScope = await _apiScopeService.GetApiScopeAsync(id); return View(nameof(ApiScopeDelete), apiScope); } [HttpPost] [ValidateAntiForgeryToken] - public async Task ApiScopeDelete(ApiScopesDto apiScope) + public async Task ApiScopeDelete(ApiScopeDto apiScope) { - await _apiResourceService.DeleteApiScopeAsync(apiScope); + await _apiScopeService.DeleteApiScopeAsync(apiScope); SuccessNotification(_localizer["SuccessDeleteApiScope"], _localizer["SuccessTitle"]); - return RedirectToAction(nameof(ApiScopes), new { Id = apiScope.ApiResourceId }); + return RedirectToAction(nameof(ApiScopes)); } [HttpGet] diff --git a/src/Skoruba.IdentityServer4.Admin/Helpers/DbMigrationHelpers.cs b/src/Skoruba.IdentityServer4.Admin/Helpers/DbMigrationHelpers.cs index a197edf7a..e33e9639b 100644 --- a/src/Skoruba.IdentityServer4.Admin/Helpers/DbMigrationHelpers.cs +++ b/src/Skoruba.IdentityServer4.Admin/Helpers/DbMigrationHelpers.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using IdentityModel; using IdentityServer4.EntityFramework.Mappers; +using IdentityServer4.Models; using Microsoft.AspNetCore.DataProtection.EntityFrameworkCore; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; @@ -42,14 +43,14 @@ public static class DbMigrationHelpers using (var serviceScope = host.Services.CreateScope()) { var services = serviceScope.ServiceProvider; - - if ((databaseMigrationsConfiguration != null && databaseMigrationsConfiguration.ApplyDatabaseMigrations) + + if ((databaseMigrationsConfiguration != null && databaseMigrationsConfiguration.ApplyDatabaseMigrations) || (applyDbMigrationWithDataSeedFromProgramArguments)) { await EnsureDatabasesMigratedAsync(services); } - if ((seedConfiguration != null && seedConfiguration.ApplySeed) + if ((seedConfiguration != null && seedConfiguration.ApplySeed) || (applyDbMigrationWithDataSeedFromProgramArguments)) { await EnsureSeedDataAsync(services); @@ -124,60 +125,63 @@ private static async Task EnsureSeedIdentityData(UserManager(UserManager(TIdentityServerDbContext context, IdentityServerDataConfiguration identityServerDataConfiguration) where TIdentityServerDbContext : DbContext, IAdminConfigurationDbContext { - if (!context.IdentityResources.Any()) + foreach (var resource in identityServerDataConfiguration.IdentityResources) { - foreach (var resource in identityServerDataConfiguration.IdentityResources) + var exits = await context.IdentityResources.AnyAsync(a => a.Name == resource.Name); + + if (exits) { - await context.IdentityResources.AddAsync(resource.ToEntity()); + continue; } - await context.SaveChangesAsync(); + await context.IdentityResources.AddAsync(resource.ToEntity()); } - if (!context.ApiResources.Any()) + foreach (var apiScope in identityServerDataConfiguration.ApiScopes) { - foreach (var resource in identityServerDataConfiguration.ApiResources) - { - foreach (var s in resource.ApiSecrets) - { - s.Value = s.Value.ToSha256(); - } + var exits = await context.ApiScopes.AnyAsync(a => a.Name == apiScope.Name); - await context.ApiResources.AddAsync(resource.ToEntity()); + if (exits) + { + continue; } - await context.SaveChangesAsync(); + await context.ApiScopes.AddAsync(apiScope.ToEntity()); } - if (!context.Clients.Any()) + foreach (var resource in identityServerDataConfiguration.ApiResources) { - foreach (var client in identityServerDataConfiguration.Clients) + var exits = await context.ApiResources.AnyAsync(a => a.Name == resource.Name); + + if (exits) { - foreach (var secret in client.ClientSecrets) - { - secret.Value = secret.Value.ToSha256(); - } + continue; + } + + foreach (var s in resource.ApiSecrets) + { + s.Value = s.Value.ToSha256(); + } - client.Claims = client.ClientClaims - .Select(c => new System.Security.Claims.Claim(c.Type, c.Value)) - .ToList(); + await context.ApiResources.AddAsync(resource.ToEntity()); + } + + + foreach (var client in identityServerDataConfiguration.Clients) + { + var exits = await context.Clients.AnyAsync(a => a.ClientId == client.ClientId); + + if (exits) + { + continue; + } - await context.Clients.AddAsync(client.ToEntity()); + foreach (var secret in client.ClientSecrets) + { + secret.Value = secret.Value.ToSha256(); } - await context.SaveChangesAsync(); + client.Claims = client.ClientClaims + .Select(c => new ClientClaim(c.Type, c.Value)) + .ToList(); + + await context.Clients.AddAsync(client.ToEntity()); } + + await context.SaveChangesAsync(); } } } diff --git a/src/Skoruba.IdentityServer4.Admin/Helpers/StartupHelpers.cs b/src/Skoruba.IdentityServer4.Admin/Helpers/StartupHelpers.cs index caf0c7c0c..d8b54bfca 100644 --- a/src/Skoruba.IdentityServer4.Admin/Helpers/StartupHelpers.cs +++ b/src/Skoruba.IdentityServer4.Admin/Helpers/StartupHelpers.cs @@ -44,7 +44,6 @@ using Skoruba.IdentityServer4.Admin.EntityFramework.Helpers; using Microsoft.AspNetCore.DataProtection.EntityFrameworkCore; using Skoruba.IdentityServer4.Shared.Authentication; -using Skoruba.IdentityServer4.Shared.Configuration.Identity; namespace Skoruba.IdentityServer4.Admin.Helpers { @@ -298,6 +297,10 @@ public static void AddMvcExceptionFilters(this IServiceCollection services) { o.Conventions.Add(new GenericControllerRouteConvention()); }) +#if DEBUG + // It is not necessary to re-build the views for new changes + .AddRazorRuntimeCompilation() +#endif .AddViewLocalization( LanguageViewLocationExpanderFormat.Suffix, opts => { opts.ResourcesPath = ConfigurationConsts.ResourcesPath; }) diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.da.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.da.resx index 39126867f..2af0ad901 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.da.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.da.resx @@ -126,6 +126,9 @@ Api Scope {0} er gemt succesfuldt! + + Api Scope property {0} for api scope {1} is successfully saved! + Api Secret er oprettet succesfuldt! @@ -162,6 +165,9 @@ Api Scope er slettet succesfuldt! + + Api Scope property is successfully deleted! + Api Secret er slettet succesfuldt! diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.de.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.de.resx index 758f75ff8..1bcc99fbc 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.de.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.de.resx @@ -126,6 +126,9 @@ Api Scope {0} wurde erfolgreich gespeichert! + + Api Scope property {0} for api scope {1} is successfully saved! + Api Secret wurde erfolgreich erstellt! @@ -162,6 +165,9 @@ Api-Scope wurde erfolgreich gelöscht! + + Api Scope property is successfully deleted! + Api-Secret wurde erfolgreich gelöscht! diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.en.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.en.resx index dc8cb7a41..c43eda30c 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.en.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.en.resx @@ -126,6 +126,9 @@ Api Scope {0} is successfully saved! + + Api Scope property {0} for api scope {1} is successfully saved! + Api Secret is successfully created! @@ -162,6 +165,9 @@ Api Scope is successfully deleted! + + Api Scope property is successfully deleted! + Api Secret is successfully deleted! diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.es.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.es.resx index 1359bc156..d6327ee60 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.es.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.es.resx @@ -126,6 +126,9 @@ ¡El alcance de API {0} fue guardado con éxito! + + Api Scope property {0} for api scope {1} is successfully saved! + ¡El secreto de API fue creado con éxito! @@ -162,6 +165,9 @@ ¡El alcance de API fue eliminada con éxito! + + Api Scope property is successfully deleted! + ¡El secreto de API fue eliminado con éxito! @@ -186,4 +192,4 @@ ¡El cliente {0} fue actualizado con éxito! - + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.fa.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.fa.resx index ce14335b0..63c77a424 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.fa.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.fa.resx @@ -126,6 +126,9 @@ Api اسکوپ {0} با موفقیت ثبت شد! + + Api Scope property {0} for api scope {1} is successfully saved! + Api رمز با موفقیت ایجاد شد! @@ -162,6 +165,9 @@ Api اسکوپ با موفقیت حذف شد! + + Api Scope property is successfully deleted! + Api رمز با موفقیت حذف شد! diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.fi.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.fi.resx index 8fd184d87..a83379971 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.fi.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.fi.resx @@ -126,6 +126,9 @@ Api näkyvyysalue {0} on tallennettu onnistuneesti! + + Api Scope property {0} for api scope {1} is successfully saved! + Api salaus on luotu onnistuneesti! @@ -162,6 +165,9 @@ Api-laajuus on poistettu onnistuneesti! + + Api Scope property is successfully deleted! + Api salaus on poistettu onnistuneesti! diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.fr.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.fr.resx index 07a21c7b2..cdd488b8b 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.fr.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.fr.resx @@ -127,6 +127,9 @@ Scope Api {0} enregistré avec succès ! Portée , étendue, droits d'accès, scope API, API scope + + Api Scope property {0} for api scope {1} is successfully saved! + Secret Api créé avec succès ! @@ -164,6 +167,9 @@ Scope API supprimé avec succès ! + + Api Scope property is successfully deleted! + Secret Api supprimé avec succès ! diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.pt.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.pt.resx index b65bcd55b..2ac6caca8 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.pt.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.pt.resx @@ -186,4 +186,10 @@ Escopo da API excluído com sucesso! + + Api Scope property {0} for api scope {1} is successfully saved! + + + Api Scope property is successfully deleted! + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.ru.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.ru.resx index a1e6bb2cc..a933748cc 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.ru.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.ru.resx @@ -126,6 +126,9 @@ Api область {0} успешно сохранена! + + Api Scope property {0} for api scope {1} is successfully saved! + Api секрет успешно создан! @@ -162,6 +165,9 @@ Api область успешно удалена! + + Api Scope property is successfully deleted! + Api секрет успешно удалён! diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.sv.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.sv.resx index 805689c33..f2de3523e 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.sv.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.sv.resx @@ -126,6 +126,9 @@ Api begränsningen {0} sparades! + + Api Scope property {0} for api scope {1} is successfully saved! + Api hemligheten skapades! @@ -162,6 +165,9 @@ Api omgånget raderades! + + Api Scope property is successfully deleted! + Api hemligheten raderades! diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.zh.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.zh.resx index 7925209ed..c9b68a941 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.zh.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Controllers/ConfigurationController.zh.resx @@ -126,6 +126,9 @@ Api 作用域 {0} 已成功创建! + + Api Scope property {0} for api scope {1} is successfully saved! + Api 密钥已成功创建! @@ -162,6 +165,9 @@ Api 作用域已成功删除! + + Api Scope property is successfully deleted! + Api 密钥已成功删除! diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.da.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.da.resx index 0198c28ac..5b48572c6 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.da.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.da.resx @@ -183,6 +183,12 @@ Secrets + + List of allowed signing algorithms for access token. If empty, will use the server default signing algorithm. + + + Allowed Access Token Signing Algorithms + Liste over tilknyttede Bruger Claims, der skal inkluderes i access token. diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.de.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.de.resx index 4dbeca80f..97b3e3d2a 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.de.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.de.resx @@ -183,6 +183,12 @@ Secrets + + List of allowed signing algorithms for access token. If empty, will use the server default signing algorithm. + + + Allowed Access Token Signing Algorithms + Liste der verknüpften Benutzeranspruchstypen, die in das Zugriffstoken aufgenommen werden sollten. diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.en.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.en.resx index 463266419..a158f8fbe 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.en.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.en.resx @@ -183,6 +183,12 @@ Secrets + + List of allowed signing algorithms for access token. If empty, will use the server default signing algorithm. + + + Allowed Access Token Signing Algorithms + List of associated user claim types that should be included in the access token. diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.es.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.es.resx index 3d8763b2c..d5f0b3d36 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.es.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.es.resx @@ -60,45 +60,45 @@ : and then encoded with base64 encoding. --> - + - + - - - - + + + + - - + + - - + + - - - - + + + + - + - + @@ -183,10 +183,16 @@ Secretos + + List of allowed signing algorithms for access token. If empty, will use the server default signing algorithm. + + + Allowed Access Token Signing Algorithms + Lista de tipos de reclamación de usuario asociadas que deberian ser incluidas en la token de acceso. Reclamaciones de usuario - + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.fa.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.fa.resx index fad595eb6..5ec2c214c 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.fa.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.fa.resx @@ -183,6 +183,12 @@ رمزها + + List of allowed signing algorithms for access token. If empty, will use the server default signing algorithm. + + + Allowed Access Token Signing Algorithms + فهرستی از انواع ادعا کاربر که باید در توکن دسترسی موجود باشند. diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.fi.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.fi.resx index f8d66b835..c5e8b5889 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.fi.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.fi.resx @@ -183,6 +183,12 @@ Suojatut avaimet + + List of allowed signing algorithms for access token. If empty, will use the server default signing algorithm. + + + Allowed Access Token Signing Algorithms + Luettelo liittyvistä käyttäjän ominaisuuksista, jotka tulisi sisällyttää käyttöoikeustunnukseen. diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.fr.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.fr.resx new file mode 100644 index 000000000..98105124f --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.fr.resx @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Indique si le client est activé. La valeur par défaut est Vrai. + + + Activé + + + Description Client + + + Description + + + Dictionnaire pour contenir autant de valeurs personnalisées spécifiques au client que nécessaire. + Dictionnaire pour contenir toutes les valeurs personnalisées spécifiques au client selon les besoins. + + + Propriétés + + + Clé + + + Clé + + + Valeur + + + Valeur + + + Expiration + + + Expiration + + + Description + + + Description + + + List of allowed signing algorithms for identity token. If empty, will use the server default signing algorithm. + + + Allowed Identity Token Signing Algorithms + + + This value can be used e.g. on the consent screen. + + + Display Name + + + The unique name of the API. This value is used for authentication with introspection and will be added to the audience of the outgoing access token. + + + Name + + + An API must have at least one scope. Each scope can have different settings. + + + Scopes + + + The API secret is used for the introspection endpoint. The API can authenticate with introspection using the API name and secret. + + + Secrets + + + List of associated user claim types that should be included in the access token. + + + User Claims + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.pt.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.pt.resx index 2d1bbf0c5..248ab820c 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.pt.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.pt.resx @@ -183,6 +183,12 @@ Segredos + + List of allowed signing algorithms for access token. If empty, will use the server default signing algorithm. + + + Allowed Access Token Signing Algorithms + Lista de tipos de permissões de usuário associados que devem ser incluídos no token de acesso. diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.ru.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.ru.resx index 4555df509..0c8fa316c 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.ru.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.ru.resx @@ -183,6 +183,12 @@ Секреты + + List of allowed signing algorithms for access token. If empty, will use the server default signing algorithm. + + + Allowed Access Token Signing Algorithms + Список связанных типов утверждения пользователя, которые должны быть включены в токен доступа. diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.sv.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.sv.resx index 3fc1ff37b..3a32672f8 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.sv.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.sv.resx @@ -183,6 +183,12 @@ Hemligheter + + List of allowed signing algorithms for access token. If empty, will use the server default signing algorithm. + + + Allowed Access Token Signing Algorithms + Lista med associerad användaranspråk som inkluderas i åtkomsttoken. diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.zh.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.zh.resx index 5f2f2a5cd..fe0327c74 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.zh.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiResource/Section/Label.zh.resx @@ -183,6 +183,12 @@ 密钥 + + List of allowed signing algorithms for access token. If empty, will use the server default signing algorithm. + + + Allowed Access Token Signing Algorithms + 应包含在访问令牌中的关联用户声明类型的列表。 diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.da.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.da.resx new file mode 100644 index 000000000..b9334bae2 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.da.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Gem API Scope + + + Manage Api Scope Properties + + + API Ressources + + + API Scopes + + + API Scopes + + + API Scope + + + valget er allerede valgt + + + Ingen valg valgt + + + Indtast 2 og flere tegn + + + Søgeresultat: (klik på det valg, du vil vælge) + + + Valgte valg: + + + flere + + + Foreslåede valg: + + + Konfigurer + + + Slet + + + Navn + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.de.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.de.resx new file mode 100644 index 000000000..f0afd6054 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.de.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Api Scope speichern + + + Manage Api Scope Properties + + + Api Resourcen + + + Api Scopes + + + Api Scopes + + + Api Scope + + + Element bereits ausgewählt + + + Keine Elemente ausgewählt + + + Gebe mindestens 2 Zeichen ein + + + Suchergebnis: (Klicken Sie auf den Artikel, um ihn auszuwählen) + + + Auswahl: + + + Mehr + + + Vorschläge: + + + Bearbeiten + + + Löschen + + + Name + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.en.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.en.resx new file mode 100644 index 000000000..bddc230ca --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.en.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Save Api Scope + + + Manage Api Scope Properties + + + Api Resources + + + Api Scopes + + + Api Scopes + + + Api Scope + + + item already selected + + + No item/s selected + + + Enter 2 and more characters + + + Search result: (click on the item to select) + + + Selected item/s: + + + more + + + Suggested items: + + + Edit + + + Delete + + + Name + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.es.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.es.resx new file mode 100644 index 000000000..83bb6448e --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.es.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Guardar alcance de API + + + Manage Api Scope Properties + + + Recursos de API + + + Alcances de API + + + Alcances de API + + + Alcance de API + + + elemento ya seleccionado + + + No hay elementos seleccionados + + + Ingresa dos o más caracteres + + + Resultados de la busqueda: (haz clic en el elemento para seleccionarlo) + + + Elementos seleccionados: + + + más + + + Elementos sugeridos: + + + Editar + + + Eliminar + + + Nombre + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.fa.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.fa.resx new file mode 100644 index 000000000..ffd363bb4 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.fa.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ذخیره Api اسکوپ + + + Manage Api Scope Properties + + + Api منابع + + + Api اسکوپ ها + + + Api اسکوپ ها + + + Api اسکوپ + + + مورد انتخاب شده است + + + هیچ مورد/مواردی انتخاب نشده است + + + وارد کنید و کاراکتر های بیشتر + + + نتیجه جستجو: (بر روی مورد برای انتخاب کلیک کنید) + + + مورد/موارد انتخاب شده: + + + بیشتر + + + موارد پیشنهادی: + + + ویرایش + + + حذف + + + نام + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.fi.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.fi.resx new file mode 100644 index 000000000..d5c484cb9 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.fi.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Säästä Api-laajuus + + + Manage Api Scope Properties + + + Api-resurssit + + + Api-laajuudet + + + Api-laajuudet + + + Api-laajuus + + + Kohde on jo valittu + + + Kohteita ei ole valittu + + + Kirjoita vähintään 2 merkkiä + + + Hakutulos: (napsauta tuotetta valitaksesi) + + + Valitut kohteet: + + + Lisää + + + Ehdotetut tuotteet: + + + Muokkaa + + + Poista + + + Nimi + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.fr.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.fr.resx new file mode 100644 index 000000000..286898bf7 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.fr.resx @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Enregistrer Api Scope + + + Manage Api Scope Properties + + + Ressources Api + + + Scopes Api + + + Scopes Api + + + Scope Api + + + élément déjà sélectionné + + + Aucun(s) élément(s) sélectionné(s) + Aucun élément sélectionné + + + Entrez 2 caractères et plus + + + Résultat de la recherche : (cliquez sur l'élément pour le sélectionner) + + + Élément(s) sélectionné(s) : + + + plus + voir plus + + + Éléments suggérés : + + + Edit + + + Supprimer + + + Nom + Nommer, Renommer ? + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.pt.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.pt.resx new file mode 100644 index 000000000..d98264558 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.pt.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Salvar escopo da API + + + Manage Api Scope Properties + + + Recursos de API + + + Escopos da API + + + Escopos da API + + + Escopo da API + + + Item já selecionado + + + Nenhum item/s selecionado + + + Digitar dois ou mais caracteres + + + Resultado da pesquisa: (clique no item para selecionar) + + + Item/s selecionado: + + + mais + + + Itens sugeridos: + + + Editar + + + Excluir + + + Nome + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.ru.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.ru.resx new file mode 100644 index 000000000..220e6c18c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.ru.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Сохранить область Api + + + Manage Api Scope Properties + + + Api ресурсы + + + Api области + + + Api области + + + Api область + + + пункты уже выбраны + + + ни один пункт/ы не выбран/ы + + + Введите 2 или более символа + + + Поиск результата: (нажмите на пункт для выбора) + + + Выбранные пункты + + + больше + + + Предложенные пункты: + + + Редактировать + + + Удалить + + + Имя + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.sv.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.sv.resx new file mode 100644 index 000000000..4456ed744 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.sv.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Spara Api omfång + + + Manage Api Scope Properties + + + Api resurser + + + Api omfång + + + Api omfång + + + Api omfång + + + posten är redan vald + + + Inga poster valda + + + Ange minst två tecken + + + Sökresultat: (klicka på en post för att välja) + + + Valda poster: + + + mer + + + Föreslagna poster: + + + Editera + + + Radera + + + Namn + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.zh.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.zh.resx new file mode 100644 index 000000000..0d62efe9d --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope.zh.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 保存 Api 作用域 + + + Manage Api Scope Properties + + + Api 资源 + + + Api 作用域 + + + Api 作用域 + + + Api 作用域 + + + 项已被选中 + + + 没有选择项 + + + 输入 2 个以上字符 + + + 搜索结果:(点击选择) + + + 选中项: + + + 更多 + + + 建议项: + + + 编辑 + + + 删除 + + + 名称 + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.da.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.da.resx new file mode 100644 index 000000000..64fc8ff77 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.da.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Ordbog til at indeholde eventuelle tilpassede api-ressource-specifikke værdier efter behov. + + + Egenskaber + + + Nøgle + + + Nøgle + + + Værdi + + + Værdi + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.de.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.de.resx new file mode 100644 index 000000000..68d108117 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.de.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Wörterbuch zur Aufnahme beliebiger benutzerdefinierter Api-ressourcenspezifischer Werte nach Bedarf. + + + Eigenschaften + + + Schlüssel + + + Key + + + Wert + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.en.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.en.resx new file mode 100644 index 000000000..4edae1145 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.en.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Dictionary to hold any custom api resource-specific values as needed. + + + Properties + + + Key + + + Key + + + Value + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.es.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.es.resx new file mode 100644 index 000000000..0f1f305a0 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.es.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Diccionario que mantiene cualquier valor especifico del recurso según sea necesario. + + + Propiedades + + + Llave + + + Llave + + + Valor + + + Valor + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.fa.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.fa.resx new file mode 100644 index 000000000..b5899be21 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.fa.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + دیکشنری برای نگهداری هر گونه مقادیر سفارشی api منبع-ویژه در صورت نیاز. + + + خواص + + + کلید + + + کلید + + + مقدار + + + مقدار + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.fi.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.fi.resx new file mode 100644 index 000000000..9a629d716 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.fi.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Sanakirja pitää tarvittavat mukautetut api-resurssikohtaiset arvot. + + + Ominaisuudet + + + Avain + + + Avain + + + Arvo + + + Arvo + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.fr.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.fr.resx new file mode 100644 index 000000000..575cab1fb --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.fr.resx @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Dictionnaire pour contenir autant de valeurs personnalisées spécifiques au client que nécessaire. + Dictionnaire pour contenir toutes les valeurs personnalisées spécifiques au client selon les besoins. + + + Propriétés + + + Clé + + + Clé + + + Valeur + + + Valeur + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.pt.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.pt.resx new file mode 100644 index 000000000..f87dfe3bb --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.pt.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Dicionário para manter quaisquer valores de recursos-específicos da API personalizados, conforme necessário. + + + Propriedades + + + Chave + + + Chave + + + Valor + + + Valor + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.ru.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.ru.resx new file mode 100644 index 000000000..5d5f925e3 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.ru.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Словарь для хранения любых пользовательских значений ресурсов приложения по мере необходимости. + + + Свойства + + + Ключ + + + Ключ + + + Значение + + + Значение + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.sv.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.sv.resx new file mode 100644 index 000000000..7c6294f57 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.sv.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Lista som håller skräddarsydda resursspecifika värden som behöves. + + + Egenskaper + + + Nyckel + + + Nyckel + + + Värde + + + Värde + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.zh.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.zh.resx new file mode 100644 index 000000000..94c4bd3fb --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScope/Section/Label.zh.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 需要保留任何自定义 Api 资源特定值的字典。 + + + 属性 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.da.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.da.resx new file mode 100644 index 000000000..af6117c56 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.da.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add Api Scope Property + + + Api Scopes + + + Api Scope Property + + + Api Scope Properties + + + Delete + + + Key + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.de.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.de.resx new file mode 100644 index 000000000..af6117c56 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.de.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add Api Scope Property + + + Api Scopes + + + Api Scope Property + + + Api Scope Properties + + + Delete + + + Key + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.en.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.en.resx new file mode 100644 index 000000000..af6117c56 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.en.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add Api Scope Property + + + Api Scopes + + + Api Scope Property + + + Api Scope Properties + + + Delete + + + Key + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.es.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.es.resx new file mode 100644 index 000000000..af6117c56 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.es.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add Api Scope Property + + + Api Scopes + + + Api Scope Property + + + Api Scope Properties + + + Delete + + + Key + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.fa.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.fa.resx new file mode 100644 index 000000000..af6117c56 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.fa.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add Api Scope Property + + + Api Scopes + + + Api Scope Property + + + Api Scope Properties + + + Delete + + + Key + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.fi.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.fi.resx new file mode 100644 index 000000000..af6117c56 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.fi.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add Api Scope Property + + + Api Scopes + + + Api Scope Property + + + Api Scope Properties + + + Delete + + + Key + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.fr.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.fr.resx new file mode 100644 index 000000000..af6117c56 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.fr.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add Api Scope Property + + + Api Scopes + + + Api Scope Property + + + Api Scope Properties + + + Delete + + + Key + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.pt.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.pt.resx new file mode 100644 index 000000000..af6117c56 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.pt.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add Api Scope Property + + + Api Scopes + + + Api Scope Property + + + Api Scope Properties + + + Delete + + + Key + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.ru.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.ru.resx new file mode 100644 index 000000000..af6117c56 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.ru.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add Api Scope Property + + + Api Scopes + + + Api Scope Property + + + Api Scope Properties + + + Delete + + + Key + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.sv.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.sv.resx new file mode 100644 index 000000000..af6117c56 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.sv.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add Api Scope Property + + + Api Scopes + + + Api Scope Property + + + Api Scope Properties + + + Delete + + + Key + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.zh.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.zh.resx new file mode 100644 index 000000000..af6117c56 --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopeProperties.zh.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add Api Scope Property + + + Api Scopes + + + Api Scope Property + + + Api Scope Properties + + + Delete + + + Key + + + Value + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.da.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.da.resx new file mode 100644 index 000000000..39a50169c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.da.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete Api Scope Property + + + Api Scope Properties + + + Api Scopes + + + Delete Api Scope Property + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.de.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.de.resx new file mode 100644 index 000000000..39a50169c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.de.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete Api Scope Property + + + Api Scope Properties + + + Api Scopes + + + Delete Api Scope Property + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.en.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.en.resx new file mode 100644 index 000000000..39a50169c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.en.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete Api Scope Property + + + Api Scope Properties + + + Api Scopes + + + Delete Api Scope Property + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.es.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.es.resx new file mode 100644 index 000000000..39a50169c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.es.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete Api Scope Property + + + Api Scope Properties + + + Api Scopes + + + Delete Api Scope Property + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.fa.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.fa.resx new file mode 100644 index 000000000..39a50169c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.fa.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete Api Scope Property + + + Api Scope Properties + + + Api Scopes + + + Delete Api Scope Property + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.fi.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.fi.resx new file mode 100644 index 000000000..39a50169c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.fi.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete Api Scope Property + + + Api Scope Properties + + + Api Scopes + + + Delete Api Scope Property + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.fr.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.fr.resx new file mode 100644 index 000000000..39a50169c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.fr.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete Api Scope Property + + + Api Scope Properties + + + Api Scopes + + + Delete Api Scope Property + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.pt.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.pt.resx new file mode 100644 index 000000000..39a50169c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.pt.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete Api Scope Property + + + Api Scope Properties + + + Api Scopes + + + Delete Api Scope Property + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.ru.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.ru.resx new file mode 100644 index 000000000..39a50169c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.ru.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete Api Scope Property + + + Api Scope Properties + + + Api Scopes + + + Delete Api Scope Property + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.sv.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.sv.resx new file mode 100644 index 000000000..39a50169c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.sv.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete Api Scope Property + + + Api Scope Properties + + + Api Scopes + + + Delete Api Scope Property + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.zh.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.zh.resx new file mode 100644 index 000000000..39a50169c --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopePropertyDelete.zh.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Delete Api Scope Property + + + Api Scope Properties + + + Api Scopes + + + Delete Api Scope Property + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.da.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.da.resx index 02de13d32..f6ec93936 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.da.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.da.resx @@ -120,6 +120,9 @@ Gem API Scope + + Add Api Scope + API Ressources diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.de.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.de.resx index eb0876627..ec1664c98 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.de.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.de.resx @@ -120,6 +120,9 @@ Api Scope speichern + + Add Api Scope + Api Resourcen diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.en.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.en.resx index 1c975fd57..a0190f22a 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.en.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.en.resx @@ -120,6 +120,9 @@ Save Api Scope + + Add Api Scope + Api Resources diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.es.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.es.resx index ada0a2ad7..688162a63 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.es.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.es.resx @@ -120,6 +120,9 @@ Guardar alcance de API + + Add Api Scope + Recursos de API @@ -162,4 +165,4 @@ Nombre - + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.fa.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.fa.resx index 75e678161..5415a676b 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.fa.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.fa.resx @@ -120,6 +120,9 @@ ذخیره Api اسکوپ + + Add Api Scope + Api منابع diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.fi.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.fi.resx index f68e05b60..93eb969f8 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.fi.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.fi.resx @@ -120,6 +120,9 @@ Säästä Api-laajuus + + Add Api Scope + Api-resurssit diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.fr.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.fr.resx index edf56f894..400f22c6c 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.fr.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.fr.resx @@ -120,6 +120,9 @@ Enregistrer Api Scope + + Add Api Scope + Ressources Api diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.pt.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.pt.resx index 6702267a5..6b440b502 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.pt.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.pt.resx @@ -120,6 +120,9 @@ Salvar escopo da API + + Add Api Scope + Recursos de API diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.ru.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.ru.resx index 0ff4dfd2a..4258a0d8f 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.ru.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.ru.resx @@ -120,6 +120,9 @@ Сохранить область Api + + Add Api Scope + Api ресурсы diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.sv.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.sv.resx index aa9c2e1c2..69586eadc 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.sv.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.sv.resx @@ -120,6 +120,9 @@ Spara Api omfång + + Add Api Scope + Api resurser diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.zh.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.zh.resx index a6437199a..e09bc3029 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.zh.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/ApiScopes.zh.resx @@ -120,6 +120,9 @@ 保存 Api 作用域 + + Add Api Scope + Api 资源 diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.de.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.de.resx index a7fe1c6e1..4117efd94 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.de.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.de.resx @@ -236,7 +236,7 @@ Beim Auffrischen des Tokens wird die Lebensdauer des Refresh-Tokens durch Gleite Wiederverwendung des Refresh-Token-Handles bleibt beim Auffrischen der Token gleich -OneTime wird das Refresh-Token-Handle aktualisiert, wenn Token aufgefrischt werden. +OneTime wird das Refresh-Token-Handle aktualisiert, wenn Token aufgefrischt werden. Refresh Token Verwendung @@ -459,4 +459,16 @@ OneTime wird das Refresh-Token-Handle aktualisiert, wenn Token aufgefrischt werd Beschreibung + + Specifies whether this client needs to wrap the authorize request parameters in a JWT (defaults to false) + + + Require Request Object + + + List of allowed signing algorithms for identity token. If empty, will use the server default signing algorithm. + + + Allowed Identity Token Signing Algorithms + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.en.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.en.resx index 683ca80dc..febda2e35 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.en.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.en.resx @@ -459,4 +459,16 @@ OneTime the refresh token handle will be updated when refreshing tokens Description + + Require Request Object + + + Specifies whether this client needs to wrap the authorize request parameters in a JWT (defaults to false) + + + Allowed Identity Token Signing Algorithms + + + List of allowed signing algorithms for identity token. If empty, will use the server default signing algorithm. + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.es.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.es.resx index 4df82a381..658914484 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.es.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.es.resx @@ -60,45 +60,45 @@ : and then encoded with base64 encoding. --> - + - + - - - - + + + + - - + + - - + + - - - - + + + + - + - + @@ -328,31 +328,31 @@ OneTime: El tirador de la token de refresco sera actualizada cuando se refresque URIs de redirección - + Tipo de reclamación - + Valor de reclamación - + Tipo de secreto - + Valor del secreto - + Tipo de hash @@ -459,4 +459,16 @@ OneTime: El tirador de la token de refresco sera actualizada cuando se refresque Descripción - + + Specifies whether this client needs to wrap the authorize request parameters in a JWT (defaults to false) + + + Require Request Object + + + List of allowed signing algorithms for identity token. If empty, will use the server default signing algorithm. + + + Allowed Identity Token Signing Algorithms + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.fa.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.fa.resx index 46d1ac6fa..e58e98a9d 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.fa.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.fa.resx @@ -459,4 +459,16 @@ شرح + + Specifies whether this client needs to wrap the authorize request parameters in a JWT (defaults to false) + + + Require Request Object + + + List of allowed signing algorithms for identity token. If empty, will use the server default signing algorithm. + + + Allowed Identity Token Signing Algorithms + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.fi.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.fi.resx index 2f72b147e..6529083f8 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.fi.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.fi.resx @@ -459,4 +459,16 @@ Yhden kerran päivitysmerkin kahva päivitetään, kun päivitetään merkkejä< Kuvaus + + Specifies whether this client needs to wrap the authorize request parameters in a JWT (defaults to false) + + + Require Request Object + + + List of allowed signing algorithms for identity token. If empty, will use the server default signing algorithm. + + + Allowed Identity Token Signing Algorithms + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.fr.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.fr.resx index bdbeb9b9c..31de0d47d 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.fr.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.fr.resx @@ -487,4 +487,16 @@ OneTime, la gestion des refresh token sera mise à jour lors de la régénérati Description + + Specifies whether this client needs to wrap the authorize request parameters in a JWT (defaults to false) + + + Require Request Object + + + List of allowed signing algorithms for identity token. If empty, will use the server default signing algorithm. + + + Allowed Identity Token Signing Algorithms + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.pt.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.pt.resx index d2258de08..557157c19 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.pt.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.pt.resx @@ -458,4 +458,16 @@ O identificador de atualização será atualizado ao utilizar tokens uma vez Descrição + + Specifies whether this client needs to wrap the authorize request parameters in a JWT (defaults to false) + + + Require Request Object + + + List of allowed signing algorithms for identity token. If empty, will use the server default signing algorithm. + + + Allowed Identity Token Signing Algorithms + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.ru.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.ru.resx index e35f10833..94b817045 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.ru.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.ru.resx @@ -459,4 +459,16 @@ Описание + + Specifies whether this client needs to wrap the authorize request parameters in a JWT (defaults to false) + + + Require Request Object + + + List of allowed signing algorithms for identity token. If empty, will use the server default signing algorithm. + + + Allowed Identity Token Signing Algorithms + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.sv.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.sv.resx index b8b345f6c..230e76704 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.sv.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.sv.resx @@ -458,4 +458,16 @@ OneTime, uppdateringstoken kommer att ändras när token uppdateras Beskrivning + + Specifies whether this client needs to wrap the authorize request parameters in a JWT (defaults to false) + + + Require Request Object + + + List of allowed signing algorithms for identity token. If empty, will use the server default signing algorithm. + + + Allowed Identity Token Signing Algorithms + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.zh.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.zh.resx index a019c59ca..b686f6c05 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.zh.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Configuration/Client/Section/Label.zh.resx @@ -459,4 +459,16 @@ OneTime 刷新令牌时将更新令牌句柄 描述 + + Specifies whether this client needs to wrap the authorize request parameters in a JWT (defaults to false) + + + Require Request Object + + + List of allowed signing algorithms for identity token. If empty, will use the server default signing algorithm. + + + Allowed Identity Token Signing Algorithms + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.da.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.da.resx index daa2b9055..e25f86a8b 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.da.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.da.resx @@ -141,12 +141,24 @@ Client + + Consumed Time + + + Creation Time + Data + + Description + Udløb + + SessionId + Subject Id diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.de.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.de.resx index 9d4ca83eb..3e643112a 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.de.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.de.resx @@ -141,12 +141,24 @@ Client + + Consumed Time + + + Creation Time + Daten + + Description + Ablauf + + SessionId + Subject-Id diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.en.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.en.resx index a37e569d6..592de8773 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.en.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.en.resx @@ -141,12 +141,24 @@ Client + + Consumed Time + + + Creation Time + Data + + Description + Expiration + + SessionId + Subject Id diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.es.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.es.resx index 5ccc68e57..695c2b221 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.es.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.es.resx @@ -141,16 +141,28 @@ Cliente + + Consumed Time + + + Creation Time + Data + + Description + Expiración + + SessionId + ID del sujeto Tipo - + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.fa.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.fa.resx index 710e90a4b..1541bc249 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.fa.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.fa.resx @@ -141,12 +141,24 @@ کاربر + + Consumed Time + + + Creation Time + داده + + Description + انقضاء + + SessionId + Subject شناسه diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.fi.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.fi.resx index 8f7a6505d..33e93fc55 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.fi.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.fi.resx @@ -141,12 +141,24 @@ Sovellus + + Consumed Time + + + Creation Time + data + + Description + Päättyminen + + SessionId + Aiheen tunnus diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.fr.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.fr.resx index 9b6d9ed9b..9a3489d81 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.fr.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.fr.resx @@ -141,12 +141,24 @@ Client + + Consumed Time + + + Creation Time + Données + + Description + Expiration + + SessionId + ID sujet diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.pt.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.pt.resx index cd6c9f6e1..0a10a189a 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.pt.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.pt.resx @@ -141,12 +141,24 @@ Sistema + + Consumed Time + + + Creation Time + Dados + + Description + Expiração + + SessionId + ID do assunto diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.ru.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.ru.resx index 226e557e4..324e51635 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.ru.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.ru.resx @@ -141,12 +141,24 @@ Клиенты + + Consumed Time + + + Creation Time + Дата + + Description + Срок действия + + SessionId + Id объекта diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.sv.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.sv.resx index 597a39a0f..4f4171af6 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.sv.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.sv.resx @@ -141,12 +141,24 @@ Klient + + Consumed Time + + + Creation Time + Data + + Description + Förfallodatum + + SessionId + Subjekt Id diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.zh.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.zh.resx index 2cb634d53..af62ce3c6 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.zh.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Grant/PersistedGrant.zh.resx @@ -141,12 +141,24 @@ 客户端 + + Consumed Time + + + Creation Time + 数据 + + Description + 到期 + + SessionId + 主体标识 diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.da.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.da.resx index e8d968d40..912c1a64e 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.da.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.da.resx @@ -120,6 +120,12 @@ API Ressourcer + + Api Scopes + + + Audit Logs + Clients diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.de.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.de.resx index 15a19d337..ecf635a1f 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.de.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.de.resx @@ -120,6 +120,12 @@ Api Ressourcen + + Api Scopes + + + Audit Logs + Clients diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.en.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.en.resx index 5ed50e17f..0b5688ee4 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.en.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.en.resx @@ -120,6 +120,12 @@ Api Resources + + Api Scopes + + + Audit Logs + Clients diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.es.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.es.resx index 502baea52..7730d9aff 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.es.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.es.resx @@ -120,6 +120,12 @@ Recursos de API + + Api Scopes + + + Audit Logs + Clientes diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.fa.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.fa.resx index 885e5ea68..dae18984a 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.fa.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.fa.resx @@ -120,6 +120,12 @@ Api منابع + + Api Scopes + + + Audit Logs + سرویس گیرنده ها diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.fi.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.fi.resx index cfe71809e..b5fb07725 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.fi.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.fi.resx @@ -120,6 +120,12 @@ Api-resurssit + + Api Scopes + + + Audit Logs + Sovellukset diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.fr.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.fr.resx index ae9162cef..4f52dd176 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.fr.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.fr.resx @@ -120,6 +120,12 @@ Ressources Api + + Api Scopes + + + Audit Logs + Clients diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.pt.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.pt.resx index 20f159ed8..202897fab 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.pt.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.pt.resx @@ -120,6 +120,12 @@ Recursos de API + + Api Scopes + + + Audit Logs + Sistemas diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.ru.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.ru.resx index 8315d9d99..cdd13b7e5 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.ru.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.ru.resx @@ -120,6 +120,12 @@ Api ресурсы + + Api Scopes + + + Audit Logs + Клиенты diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.sv.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.sv.resx index 61522fba7..241f54855 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.sv.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.sv.resx @@ -120,6 +120,12 @@ Api resurser + + Api Scopes + + + Audit Logs + Klienter diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.zh.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.zh.resx index cd811b731..89a0d1577 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.zh.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Home/Index.zh.resx @@ -120,6 +120,12 @@ Api 资源 + + Api Scopes + + + Audit Logs + 客户端 diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.da.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.da.resx new file mode 100644 index 000000000..ae3c2281f --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.da.resx @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Action + + + Are you sure? + + + Audit Log + + + Category + + + Created + + + Delete logs older than + + + Detail + + + Event + + + No - close + + + Search + + + Show detail + + + Source + + + Subject + + + Subject Identifier + + + Subject Name + + + Warning + + + Yes - delete + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.es.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.es.resx new file mode 100644 index 000000000..ae3c2281f --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.es.resx @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Action + + + Are you sure? + + + Audit Log + + + Category + + + Created + + + Delete logs older than + + + Detail + + + Event + + + No - close + + + Search + + + Show detail + + + Source + + + Subject + + + Subject Identifier + + + Subject Name + + + Warning + + + Yes - delete + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.fa.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.fa.resx new file mode 100644 index 000000000..ae3c2281f --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.fa.resx @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Action + + + Are you sure? + + + Audit Log + + + Category + + + Created + + + Delete logs older than + + + Detail + + + Event + + + No - close + + + Search + + + Show detail + + + Source + + + Subject + + + Subject Identifier + + + Subject Name + + + Warning + + + Yes - delete + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.fr.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.fr.resx new file mode 100644 index 000000000..ae3c2281f --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.fr.resx @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Action + + + Are you sure? + + + Audit Log + + + Category + + + Created + + + Delete logs older than + + + Detail + + + Event + + + No - close + + + Search + + + Show detail + + + Source + + + Subject + + + Subject Identifier + + + Subject Name + + + Warning + + + Yes - delete + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.ru.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.ru.resx new file mode 100644 index 000000000..ae3c2281f --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.ru.resx @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Action + + + Are you sure? + + + Audit Log + + + Category + + + Created + + + Delete logs older than + + + Detail + + + Event + + + No - close + + + Search + + + Show detail + + + Source + + + Subject + + + Subject Identifier + + + Subject Name + + + Warning + + + Yes - delete + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.sv.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.sv.resx new file mode 100644 index 000000000..ae3c2281f --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.sv.resx @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Action + + + Are you sure? + + + Audit Log + + + Category + + + Created + + + Delete logs older than + + + Detail + + + Event + + + No - close + + + Search + + + Show detail + + + Source + + + Subject + + + Subject Identifier + + + Subject Name + + + Warning + + + Yes - delete + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.zh.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.zh.resx new file mode 100644 index 000000000..ae3c2281f --- /dev/null +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Log/AuditLog.zh.resx @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Action + + + Are you sure? + + + Audit Log + + + Category + + + Created + + + Delete logs older than + + + Detail + + + Event + + + No - close + + + Search + + + Show detail + + + Source + + + Subject + + + Subject Identifier + + + Subject Name + + + Warning + + + Yes - delete + + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.da.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.da.resx index f718f0cd2..360a811a4 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.da.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.da.resx @@ -123,9 +123,18 @@ API Ressourcer + + Api Scopes + + + Audit Logs + Clients + + Error Logs + Identity Ressourcer diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.de.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.de.resx index 9973642a1..68e050478 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.de.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.de.resx @@ -123,9 +123,18 @@ Api Ressourcen + + Api Scopes + + + Audit Logs + Clients + + Error Logs + Identitäts-Ressources diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.en.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.en.resx index 77e3401e7..a8bff39c4 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.en.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.en.resx @@ -123,9 +123,18 @@ Api Resources + + Api Scopes + + + Audit Logs + Clients + + Error Logs + Identity Resources diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.es.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.es.resx index de42f4b80..8a122075c 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.es.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.es.resx @@ -123,9 +123,18 @@ Recursos de API + + Api Scopes + + + Audit Logs + Clientes + + Error Logs + Recursos de identidad diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.fa.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.fa.resx index ad993f86d..24edcadb2 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.fa.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.fa.resx @@ -123,9 +123,18 @@ Api منابع + + Api Scopes + + + Audit Logs + سرویس گیرنده ها + + Error Logs + منابع هویت diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.fi.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.fi.resx index 08e326d89..21e34838c 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.fi.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.fi.resx @@ -123,9 +123,18 @@ Api-resurssit + + Api Scopes + + + Audit Logs + Sovellukset + + Error Logs + Henkilöllisyysresurssit diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.fr.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.fr.resx index d8f90f791..ff8c2ecb2 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.fr.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.fr.resx @@ -123,9 +123,18 @@ Ressources Api + + Api Scopes + + + Audit Logs + Clients + + Error Logs + Identity Resources diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.pt.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.pt.resx index 393031afe..f54cc08e3 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.pt.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.pt.resx @@ -168,4 +168,13 @@ Log de Auditoria + + Api Scopes + + + Audit Logs + + + Error Logs + \ No newline at end of file diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.ru.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.ru.resx index 020eab489..acfd22351 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.ru.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.ru.resx @@ -123,9 +123,18 @@ Api ресурсы + + Api Scopes + + + Audit Logs + Клиенты + + Error Logs + Ресурсы идентификации diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.sv.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.sv.resx index 82bd6177a..9f09cc92f 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.sv.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.sv.resx @@ -123,9 +123,18 @@ Api resurser + + Api Scopes + + + Audit Logs + Klienter + + Error Logs + Identitetsresurser diff --git a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.zh.resx b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.zh.resx index 79c15d45a..9041a0364 100644 --- a/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.zh.resx +++ b/src/Skoruba.IdentityServer4.Admin/Resources/Views/Shared/_Layout.zh.resx @@ -123,9 +123,18 @@ Api 资源 + + Api Scopes + + + Audit Logs + 客户端 + + Error Logs + 身份资源 diff --git a/src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj b/src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj index e125da3d8..abf11c9b9 100644 --- a/src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj +++ b/src/Skoruba.IdentityServer4.Admin/Skoruba.IdentityServer4.Admin.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 1.0.0 + 2.0.0-beta1 Jan Škoruba latest 8fe260ca-ef4c-4fa3-9364-029146f8d339 @@ -16,34 +16,35 @@ - - - - + + + + + - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + - + - + - + @@ -131,6 +132,43 @@ + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + + + + diff --git a/src/Skoruba.IdentityServer4.Admin/Startup.cs b/src/Skoruba.IdentityServer4.Admin/Startup.cs index a9c734833..2fe943ef2 100644 --- a/src/Skoruba.IdentityServer4.Admin/Startup.cs +++ b/src/Skoruba.IdentityServer4.Admin/Startup.cs @@ -8,7 +8,6 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Skoruba.AuditLogging.EntityFramework.Entities; -using Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.Dtos.Identity; using Skoruba.IdentityServer4.Admin.Configuration.Interfaces; using Skoruba.IdentityServer4.Admin.EntityFramework.Shared.DbContexts; using Skoruba.IdentityServer4.Admin.EntityFramework.Shared.Entities.Identity; @@ -16,7 +15,6 @@ using Skoruba.IdentityServer4.Admin.Configuration; using Skoruba.IdentityServer4.Admin.Configuration.Constants; using System; -using Microsoft.AspNetCore.DataProtection; using Skoruba.IdentityServer4.Shared.Dtos; using Skoruba.IdentityServer4.Shared.Dtos.Identity; using Skoruba.IdentityServer4.Shared.Helpers; diff --git a/src/Skoruba.IdentityServer4.Admin/Views/Configuration/ApiResource.cshtml b/src/Skoruba.IdentityServer4.Admin/Views/Configuration/ApiResource.cshtml index 5b14efc29..70f176dcd 100644 --- a/src/Skoruba.IdentityServer4.Admin/Views/Configuration/ApiResource.cshtml +++ b/src/Skoruba.IdentityServer4.Admin/Views/Configuration/ApiResource.cshtml @@ -63,8 +63,20 @@ - - + + +
+ +
+ + + +
+
+ +
} - - + + +
+ +
+ + +
+
+ + +
+ +
+ + +
+
+ +
-