Skip to content

Commit 561c380

Browse files
authored
Merge pull request #703 from skoruba/dev
1.0.0-rc3
2 parents ee4d3ca + a3f8b6e commit 561c380

File tree

113 files changed

+3183
-246
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+3183
-246
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The application is written in the **Asp.Net Core MVC - using .NET Core 3.1**
2323
- Install the dotnet new template:
2424

2525
```sh
26-
dotnet new -i Skoruba.IdentityServer4.Admin.Templates::1.0.0-rc2-update1
26+
dotnet new -i Skoruba.IdentityServer4.Admin.Templates::1.0.0-rc3
2727
```
2828

2929
- Create new project:
@@ -161,11 +161,11 @@ docker-compose up -d
161161
### Docker images
162162
- Docker images will be available also in [docker hub](https://hub.docker.com/u/skoruba)
163163
- AdminUI:
164-
- `skoruba/identityserver4-admin:rc2`
164+
- `skoruba/identityserver4-admin:rc3`
165165
- Admin Api:
166-
- `skoruba/identityserver4-admin-api:rc2`
166+
- `skoruba/identityserver4-admin-api:rc3`
167167
- STS:
168-
- `skoruba/identityserver4-sts-identity:rc2`
168+
- `skoruba/identityserver4-sts-identity:rc3`
169169

170170
### Publish Docker images to Docker hub
171171
- Check the script in `build/publish-docker-images.ps1` - change the profile name according to your requirements.

build/publish-docker-images.ps1

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
param([string] $version)
2+
13
# build docker images according to docker-compose
24
docker-compose build
35

46
# rename images with following tag
5-
docker tag skoruba-identityserver4-admin skoruba/identityserver4-admin:rc1
6-
docker tag skoruba-identityserver4-sts-identity skoruba/identityserver4-sts-identity:rc1
7-
docker tag skoruba-identityserver4-admin-api skoruba/identityserver4-admin-api:rc1
7+
docker tag skoruba-identityserver4-admin skoruba/identityserver4-admin:$version
8+
docker tag skoruba-identityserver4-sts-identity skoruba/identityserver4-sts-identity:$version
9+
docker tag skoruba-identityserver4-admin-api skoruba/identityserver4-admin-api:$version
810

911
# push to docker hub
10-
docker push skoruba/identityserver4-admin:rc1
11-
docker push skoruba/identityserver4-admin-api:rc1
12-
docker push skoruba/identityserver4-sts-identity:rc1
12+
docker push skoruba/identityserver4-admin:$version
13+
docker push skoruba/identityserver4-admin-api:$version
14+
docker push skoruba/identityserver4-sts-identity:$version

src/Skoruba.IdentityServer4.Admin.Api/Configuration/ApplicationParts/GenericTypeControllerFeatureProvider.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Skoruba.IdentityServer4.Admin.Api.Configuration.ApplicationParts
1212
{
1313
public class GenericTypeControllerFeatureProvider<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
1414
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
15-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto> : IApplicationFeatureProvider<ControllerFeature>
15+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto> : IApplicationFeatureProvider<ControllerFeature>
1616
where TUserDto : UserDto<TKey>, new()
1717
where TRoleDto : RoleDto<TKey>, new()
1818
where TUser : IdentityUser<TKey>
@@ -30,16 +30,17 @@ public class GenericTypeControllerFeatureProvider<TUserDto, TRoleDto, TUser, TRo
3030
where TUserRolesDto : UserRolesDto<TRoleDto, TKey>
3131
where TUserClaimsDto : UserClaimsDto<TUserClaimDto, TKey>
3232
where TUserProviderDto : UserProviderDto<TKey>
33-
where TUserProvidersDto : UserProvidersDto<TKey>
33+
where TUserProvidersDto : UserProvidersDto<TUserProviderDto, TKey>
3434
where TUserChangePasswordDto : UserChangePasswordDto<TKey>
35-
where TRoleClaimsDto : RoleClaimsDto<TKey>
35+
where TRoleClaimsDto : RoleClaimsDto<TRoleClaimDto, TKey>
3636
where TUserClaimDto : UserClaimDto<TKey>
37+
where TRoleClaimDto : RoleClaimDto<TKey>
3738
{
3839
public void PopulateFeature(IEnumerable<ApplicationPart> parts, ControllerFeature feature)
3940
{
4041
var currentAssembly = typeof(GenericTypeControllerFeatureProvider<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
4142
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
42-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto>).Assembly;
43+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto>).Assembly;
4344
var controllerTypes = currentAssembly.GetExportedTypes()
4445
.Where(t => typeof(ControllerBase).IsAssignableFrom(t) && t.IsGenericTypeDefinition)
4546
.Select(t => t.GetTypeInfo());

src/Skoruba.IdentityServer4.Admin.Api/Controllers/RolesController.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Skoruba.IdentityServer4.Admin.Api.Controllers
2323
[Authorize(Policy = AuthorizationConsts.AdministrationPolicy)]
2424
public class RolesController<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
2525
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
26-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto> : ControllerBase
26+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto> : ControllerBase
2727
where TUserDto : UserDto<TKey>, new()
2828
where TRoleDto : RoleDto<TKey>, new()
2929
where TUser : IdentityUser<TKey>
@@ -39,27 +39,28 @@ public class RolesController<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim,
3939
where TUserRolesDto : UserRolesDto<TRoleDto, TKey>
4040
where TUserClaimsDto : UserClaimsDto<TUserClaimDto, TKey>, new()
4141
where TUserProviderDto : UserProviderDto<TKey>
42-
where TUserProvidersDto : UserProvidersDto<TKey>
42+
where TUserProvidersDto : UserProvidersDto<TUserProviderDto, TKey>
4343
where TUserChangePasswordDto : UserChangePasswordDto<TKey>
44-
where TRoleClaimsDto : RoleClaimsDto<TKey>, new()
44+
where TRoleClaimsDto : RoleClaimsDto<TRoleClaimDto, TKey>, new()
4545
where TUserClaimDto : UserClaimDto<TKey>
46+
where TRoleClaimDto : RoleClaimDto<TKey>
4647
{
4748
private readonly IIdentityService<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
4849
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
49-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto> _identityService;
50+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto> _identityService;
5051
private readonly IGenericControllerLocalizer<UsersController<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
5152
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
52-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto>> _localizer;
53+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto>> _localizer;
5354

5455
private readonly IMapper _mapper;
5556
private readonly IApiErrorResources _errorResources;
5657

5758
public RolesController(IIdentityService<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
5859
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
59-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto> identityService,
60+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto> identityService,
6061
IGenericControllerLocalizer<UsersController<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
6162
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
62-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto>> localizer, IMapper mapper, IApiErrorResources errorResources)
63+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto>> localizer, IMapper mapper, IApiErrorResources errorResources)
6364
{
6465
_identityService = identityService;
6566
_localizer = localizer;

src/Skoruba.IdentityServer4.Admin.Api/Controllers/UsersController.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace Skoruba.IdentityServer4.Admin.Api.Controllers
2626
[Authorize(Policy = AuthorizationConsts.AdministrationPolicy)]
2727
public class UsersController<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
2828
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
29-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto> : ControllerBase
29+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto> : ControllerBase
3030
where TUserDto : UserDto<TKey>, new()
3131
where TRoleDto : RoleDto<TKey>, new()
3232
where TUser : IdentityUser<TKey>
@@ -42,27 +42,28 @@ public class UsersController<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim,
4242
where TUserRolesDto : UserRolesDto<TRoleDto, TKey>
4343
where TUserClaimsDto : UserClaimsDto<TUserClaimDto, TKey>, new()
4444
where TUserProviderDto : UserProviderDto<TKey>
45-
where TUserProvidersDto : UserProvidersDto<TKey>
45+
where TUserProvidersDto : UserProvidersDto<TUserProviderDto, TKey>
4646
where TUserChangePasswordDto : UserChangePasswordDto<TKey>
47-
where TRoleClaimsDto : RoleClaimsDto<TKey>
47+
where TRoleClaimsDto : RoleClaimsDto<TRoleClaimDto, TKey>
4848
where TUserClaimDto : UserClaimDto<TKey>
49+
where TRoleClaimDto : RoleClaimDto<TKey>
4950
{
5051
private readonly IIdentityService<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
5152
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
52-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto> _identityService;
53+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto> _identityService;
5354
private readonly IGenericControllerLocalizer<UsersController<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
5455
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
55-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto>> _localizer;
56+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto>> _localizer;
5657

5758
private readonly IMapper _mapper;
5859
private readonly IApiErrorResources _errorResources;
5960

6061
public UsersController(IIdentityService<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
6162
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
62-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto> identityService,
63+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto> identityService,
6364
IGenericControllerLocalizer<UsersController<TUserDto, TRoleDto, TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
6465
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
65-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto>> localizer, IMapper mapper, IApiErrorResources errorResources)
66+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto>> localizer, IMapper mapper, IApiErrorResources errorResources)
6667
{
6768
_identityService = identityService;
6869
_localizer = localizer;

src/Skoruba.IdentityServer4.Admin.Api/Helpers/StartupHelpers.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static IServiceCollection AddAdminApiCors(this IServiceCollection service
8484
public static void AddMvcServices<TUserDto, TRoleDto,
8585
TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
8686
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
87-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto>(
87+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto>(
8888
this IServiceCollection services)
8989
where TUserDto : UserDto<TKey>, new()
9090
where TRoleDto : RoleDto<TKey>, new()
@@ -101,10 +101,11 @@ public static IServiceCollection AddAdminApiCors(this IServiceCollection service
101101
where TUserRolesDto : UserRolesDto<TRoleDto, TKey>
102102
where TUserClaimsDto : UserClaimsDto<TUserClaimDto, TKey>
103103
where TUserProviderDto : UserProviderDto<TKey>
104-
where TUserProvidersDto : UserProvidersDto<TKey>
104+
where TUserProvidersDto : UserProvidersDto<TUserProviderDto, TKey>
105105
where TUserChangePasswordDto : UserChangePasswordDto<TKey>
106-
where TRoleClaimsDto : RoleClaimsDto<TKey>
106+
where TRoleClaimsDto : RoleClaimsDto<TRoleClaimDto, TKey>
107107
where TUserClaimDto : UserClaimDto<TKey>
108+
where TRoleClaimDto : RoleClaimDto<TKey>
108109
{
109110
services.AddLocalization(opts => { opts.ResourcesPath = ConfigurationConsts.ResourcesPath; });
110111

@@ -118,7 +119,7 @@ public static IServiceCollection AddAdminApiCors(this IServiceCollection service
118119
new GenericTypeControllerFeatureProvider<TUserDto, TRoleDto,
119120
TUser, TRole, TKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken,
120121
TUsersDto, TRolesDto, TUserRolesDto, TUserClaimsDto,
121-
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto>());
122+
TUserProviderDto, TUserProvidersDto, TUserChangePasswordDto, TRoleClaimsDto, TUserClaimDto, TRoleClaimDto>());
122123
});
123124
}
124125

src/Skoruba.IdentityServer4.Admin.Api/Mappers/IdentityMapperProfile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ public class IdentityMapperProfile<TRoleDto, TUserRolesDto, TKey, TUserClaimsDto
1111
where TRoleDto : RoleDto<TKey>
1212
where TUserRolesDto : UserRolesDto<TRoleDto, TKey>
1313
where TUserProviderDto : UserProviderDto<TKey>
14-
where TUserProvidersDto : UserProvidersDto<TKey>
14+
where TUserProvidersDto : UserProvidersDto<TUserProviderDto,TKey>
1515
where TUserChangePasswordDto : UserChangePasswordDto<TKey>
16-
where TRoleClaimsDto : RoleClaimsDto<TKey>
16+
where TRoleClaimsDto : RoleClaimsDto<TRoleClaimDto, TKey>
1717
where TRoleClaimDto : RoleClaimDto<TKey>
1818
{
1919
public IdentityMapperProfile()

src/Skoruba.IdentityServer4.Admin.Api/Skoruba.IdentityServer4.Admin.Api.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<Version>1.0.0-rc3</Version>
6+
<Authors>Jan Škoruba</Authors>
57
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
68
<UserSecretsId>1cc472a2-4e4b-48ce-846b-5219f71fc643</UserSecretsId>
79
<DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>

src/Skoruba.IdentityServer4.Admin.Api/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void ConfigureServices(IServiceCollection services)
8282
UserIdentityUserLogin, UserIdentityRoleClaim, UserIdentityUserToken,
8383
IdentityUsersDto, IdentityRolesDto, IdentityUserRolesDto,
8484
IdentityUserClaimsDto, IdentityUserProviderDto, IdentityUserProvidersDto, IdentityUserChangePasswordDto,
85-
IdentityRoleClaimsDto, IdentityUserClaimDto>();
85+
IdentityRoleClaimsDto, IdentityUserClaimDto, IdentityRoleClaimDto>();
8686

8787
services.AddSwaggerGen(options =>
8888
{

src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Dtos/Identity/RoleClaimsDto.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44

55
namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.Dtos.Identity
66
{
7-
public class RoleClaimsDto<TKey> : RoleClaimDto<TKey>, IRoleClaimsDto
7+
public class RoleClaimsDto<TRoleClaimDto, TKey> : RoleClaimDto<TKey>, IRoleClaimsDto
8+
where TRoleClaimDto : RoleClaimDto<TKey>
89
{
910
public RoleClaimsDto()
1011
{
11-
Claims = new List<RoleClaimDto<TKey>>();
12+
Claims = new List<TRoleClaimDto>();
1213
}
1314

1415
public string RoleName { get; set; }
1516

16-
public List<RoleClaimDto<TKey>> Claims { get; set; }
17+
public List<TRoleClaimDto> Claims { get; set; }
1718

1819
public int TotalCount { get; set; }
1920

src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Dtos/Identity/UserClaimsDto.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.Dtos.Identity.Interfaces;
22
using System.Collections.Generic;
33
using System.Linq;
4-
using IdentityServer4.EntityFramework.Entities;
54

65
namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.Dtos.Identity
76
{

src/Skoruba.IdentityServer4.Admin.BusinessLogic.Identity/Dtos/Identity/UserProvidersDto.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
namespace Skoruba.IdentityServer4.Admin.BusinessLogic.Identity.Dtos.Identity
66
{
7-
public class UserProvidersDto<TKey> : UserProviderDto<TKey>, IUserProvidersDto
7+
public class UserProvidersDto<TUserProviderDto, TKey> : UserProviderDto<TKey>, IUserProvidersDto
8+
where TUserProviderDto : UserProviderDto<TKey>
89
{
910
public UserProvidersDto()
1011
{
11-
Providers = new List<UserProviderDto<TKey>>();
12+
Providers = new List<TUserProviderDto>();
1213
}
1314

14-
public List<UserProviderDto<TKey>> Providers { get; set; }
15+
public List<TUserProviderDto> Providers { get; set; }
1516

1617
List<IUserProviderDto> IUserProvidersDto.Providers => Providers.Cast<IUserProviderDto>().ToList();
1718
}

0 commit comments

Comments
 (0)