Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit e9e1584

Browse files
committed
Merge remote-tracking branch 'remotes/origin/dev' into dev
2 parents d053b1b + edd1886 commit e9e1584

506 files changed

Lines changed: 13714 additions & 33192 deletions

File tree

Some content is hidden

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

docs/configuration/certificate.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ Open up a PowerShell terminal and run the script. It’ll ask you for a certific
1111
Change Config file
1212
^^^^^^^^^^^^^^^^^^
1313

14-
If a certificate is generated, to use it, change the appsettings.json. See `docs <quickstarts/ambient_variables.html>`_ for more info
14+
If a certificate is generated, to use it, change the appsettings.json. See `docs <../quickstarts/ambient_variables.html>`_ for more info

src/Backend/Jp.Application/AutoMapper/AutoMapperConfig.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.Linq;
2-
using AutoMapper;
1+
using AutoMapper;
2+
using System.Linq;
33

44
namespace Jp.Application.AutoMapper
55
{
@@ -9,6 +9,10 @@ public static MapperConfiguration RegisterMappings(params Profile[] customProfil
99
{
1010
return new MapperConfiguration(cfg =>
1111
{
12+
cfg.AddProfile(new IdentityServer4.EntityFramework.Mappers.ApiResourceMapperProfile());
13+
cfg.AddProfile(new IdentityServer4.EntityFramework.Mappers.ClientMapperProfile());
14+
cfg.AddProfile(new IdentityServer4.EntityFramework.Mappers.IdentityResourceMapperProfile());
15+
cfg.AddProfile(new IdentityServer4.EntityFramework.Mappers.PersistedGrantMapperProfile());
1216
cfg.AddProfile(new DomainToViewModelMappingProfile());
1317
cfg.AddProfile(new ViewModelToDomainMappingProfile());
1418
customProfiles.ToList().ForEach(cfg.AddProfile);

src/Backend/Jp.Application/AutoMapper/DomainToViewModelMappingProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public DomainToViewModelMappingProfile()
2222
CreateMap<User, UserViewModel>(MemberList.Destination);//.ForMember(x => x.LockoutEnd, opt => opt.MapFrom(src => src.LockoutEnd != null ? src.LockoutEnd.Value.DateTime.ToShortDateString() : string.Empty));
2323
CreateMap<User, UserListViewModel>(MemberList.Destination);
2424

25-
CreateMap<StoredEvent, EventHistoryData>().ConstructUsing(a => new EventHistoryData() { Action = a.MessageType, Id = a.Id.ToString(), Details = a.Data, When = a.Timestamp.ToString(CultureInfo.InvariantCulture), Who = a.User });
25+
CreateMap<StoredEvent, EventHistoryData>().ConstructUsing(a => new EventHistoryData(a.Message, a.Id.ToString(), a.Details, a.Timestamp.ToString(CultureInfo.InvariantCulture), a.User, a.MessageType, a.RemoteIpAddress));
2626
CreateMap<Client, ClientListViewModel>(MemberList.Destination);
2727
CreateMap<IdentityServer4.EntityFramework.Entities.Secret, SecretViewModel>(MemberList.Destination);
2828
CreateMap<IdentityServer4.EntityFramework.Entities.ClientProperty, ClientPropertyViewModel>();

src/Backend/Jp.Application/AutoMapper/ViewModelToDomainMappingProfile.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using Jp.Application.ViewModels.RoleViewModels;
88
using Jp.Application.ViewModels.UserViewModels;
99
using Jp.Domain.Commands.ApiResource;
10-
using Jp.Domain.Commands.Client;
10+
using Jp.Domain.Commands.Clients;
1111
using Jp.Domain.Commands.IdentityResource;
1212
using Jp.Domain.Commands.PersistedGrant;
1313
using Jp.Domain.Commands.Role;
@@ -46,7 +46,7 @@ public ViewModelToDomainMappingProfile()
4646
CreateMap<SetPasswordViewModel, SetPasswordCommand>().ConstructUsing(c => new SetPasswordCommand(c.Id, c.NewPassword, c.ConfirmPassword));
4747
CreateMap<RemoveAccountViewModel, RemoveAccountCommand>().ConstructUsing(c => new RemoveAccountCommand(c.Id));
4848
CreateMap<SaveUserClaimViewModel, SaveUserClaimCommand>().ConstructUsing(c => new SaveUserClaimCommand(c.Username, c.Type, c.Value));
49-
CreateMap<RemoveUserClaimViewModel, RemoveUserClaimCommand>().ConstructUsing(c => new RemoveUserClaimCommand(c.Username, c.Type));
49+
CreateMap<RemoveUserClaimViewModel, RemoveUserClaimCommand>().ConstructUsing(c => new RemoveUserClaimCommand(c.Username, c.Type, c.Value));
5050
CreateMap<RemoveUserRoleViewModel, RemoveUserRoleCommand>().ConstructUsing(c => new RemoveUserRoleCommand(c.Username, c.Role));
5151
CreateMap<SaveUserRoleViewModel, SaveUserRoleCommand>().ConstructUsing(c => new SaveUserRoleCommand(c.Username, c.Role));
5252
CreateMap<RemoveUserLoginViewModel, RemoveUserLoginCommand>().ConstructUsing(c => new RemoveUserLoginCommand(c.Username, c.LoginProvider, c.ProviderKey));
@@ -64,13 +64,12 @@ public ViewModelToDomainMappingProfile()
6464
CreateMap<RemoveClientClaimViewModel, RemoveClientClaimCommand>().ConstructUsing(c => new RemoveClientClaimCommand(c.Id, c.ClientId));
6565
CreateMap<RemoveClientViewModel, RemoveClientCommand>().ConstructUsing(c => new RemoveClientCommand(c.ClientId));
6666
CreateMap<CopyClientViewModel, CopyClientCommand>().ConstructUsing(c => new CopyClientCommand(c.ClientId));
67-
CreateMap<SaveClientViewModel, SaveClientCommand>().ConstructUsing(c => new SaveClientCommand(c.ClientId, c.ClientName, c.ClientUri, c.LogoUri, c.Description, c.ClientType));
67+
CreateMap<SaveClientViewModel, SaveClientCommand>().ConstructUsing(c => new SaveClientCommand(c.ClientId, c.ClientName, c.ClientUri, c.LogoUri, c.Description, c.ClientType, c.LogoutUri));
6868

6969
/*
7070
* Identity Resource commands
7171
*/
7272
CreateMap<IdentityResource, RegisterIdentityResourceCommand>().ConstructUsing(c => new RegisterIdentityResourceCommand(c));
73-
CreateMap<IdentityResourceViewModel, UpdateIdentityResourceCommand>().ConstructUsing(c => new UpdateIdentityResourceCommand(c, c.OldName));
7473
CreateMap<RemoveIdentityResourceViewModel, RemoveIdentityResourceCommand>().ConstructUsing(c => new RemoveIdentityResourceCommand(c.Name));
7574

7675
/*
@@ -91,7 +90,6 @@ public ViewModelToDomainMappingProfile()
9190
*/
9291
CreateMap<RemoveRoleViewModel, RemoveRoleCommand>().ConstructUsing(c => new RemoveRoleCommand(c.Name));
9392
CreateMap<SaveRoleViewModel, SaveRoleCommand>().ConstructUsing(c => new SaveRoleCommand(c.Name));
94-
CreateMap<UpdateRoleViewModel, UpdateRoleCommand>().ConstructUsing(c => new UpdateRoleCommand(c.Name, c.OldName));
9593
CreateMap<RemoveUserFromRoleViewModel, RemoveUserFromRoleCommand>().ConstructUsing(c => new RemoveUserFromRoleCommand(c.Role, c.Username));
9694

9795
}
Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
1-
namespace Jp.Application.EventSourcedNormalizers
1+
using Jp.Domain.Core.Events;
2+
3+
namespace Jp.Application.EventSourcedNormalizers
24
{
35
public class EventHistoryData
46
{
5-
public string Action { get; set; }
6-
public string Id { get; set; }
7-
public string When { get; set; }
8-
public string Who { get; set; }
9-
public string Details { get; set; }
7+
public EventHistoryData(string action, string id, EventDetails details, string when, string who, string category, string ip)
8+
{
9+
Action = action;
10+
Id = id;
11+
When = when;
12+
Who = who;
13+
Category = category;
14+
Ip = ip;
15+
Details = details?.Metadata;
16+
}
17+
18+
public string Category { get; }
19+
public string Ip { get; }
20+
public string Action { get; }
21+
public string Id { get; }
22+
public string When { get; }
23+
public string Who { get; }
24+
public string Details { get; }
1025
}
1126
}

src/Backend/Jp.Application/Interfaces/IApiResourceAppService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public interface IApiResourceAppService : IDisposable
1212
Task<IEnumerable<ApiResourceListViewModel>> GetApiResources();
1313
Task<ApiResource> GetDetails(string name);
1414
Task Save(ApiResource model);
15-
Task Update(UpdateApiResourceViewModel model);
15+
Task Update(string id, ApiResource model);
1616
Task Remove(RemoveApiResourceViewModel model);
1717
Task<IEnumerable<SecretViewModel>> GetSecrets(string name);
1818
Task RemoveSecret(RemoveApiSecretViewModel model);

src/Backend/Jp.Application/Interfaces/IClientAppService.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Threading.Tasks;
41
using IdentityServer4.Models;
52
using Jp.Application.ViewModels;
63
using Jp.Application.ViewModels.ClientsViewModels;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Threading.Tasks;
77

88
namespace Jp.Application.Interfaces
99
{
10-
public interface IClientAppService: IDisposable
10+
public interface IClientAppService : IDisposable
1111
{
1212
Task<IEnumerable<ClientListViewModel>> GetClients();
1313
Task<Client> GetClientDetails(string clientId);
14-
Task Update(ClientViewModel client);
14+
Task Update(string id, Client client);
1515
Task<IEnumerable<SecretViewModel>> GetSecrets(string clientId);
1616
Task RemoveSecret(RemoveClientSecretViewModel model);
1717
Task SaveSecret(SaveClientSecretViewModel model);
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1+
using IdentityServer4.Models;
2+
using Jp.Application.ViewModels.IdentityResourceViewModels;
13
using System;
24
using System.Collections.Generic;
3-
using System.Text;
45
using System.Threading.Tasks;
5-
using IdentityServer4.Models;
6-
using Jp.Application.ViewModels;
7-
using Jp.Application.ViewModels.IdentityResourceViewModels;
86

97
namespace Jp.Application.Interfaces
108
{
11-
public interface IIdentityResourceAppService: IDisposable
9+
public interface IIdentityResourceAppService : IDisposable
1210
{
1311
Task<IEnumerable<IdentityResourceListView>> GetIdentityResources();
1412
Task<IdentityResource> GetDetails(string name);
1513
Task Save(IdentityResource model);
16-
Task Update(IdentityResource model);
14+
Task Update(string resource, IdentityResource model);
1715
Task Remove(RemoveIdentityResourceViewModel model);
1816
}
1917
}
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
using System;
1+
using Jp.Application.ViewModels.RoleViewModels;
2+
using System;
23
using System.Collections.Generic;
3-
using System.Text;
44
using System.Threading.Tasks;
5-
using Jp.Application.ViewModels;
6-
using Jp.Application.ViewModels.RoleViewModels;
75

86
namespace Jp.Application.Interfaces
97
{
10-
public interface IRoleManagerAppService: IDisposable
8+
public interface IRoleManagerAppService : IDisposable
119
{
1210
Task<IEnumerable<RoleViewModel>> GetAllRoles();
1311
Task Remove(RemoveRoleViewModel model);
1412
Task<RoleViewModel> GetDetails(string name);
1513
Task Save(SaveRoleViewModel model);
16-
Task Update(UpdateRoleViewModel model);
14+
Task Update(string id, UpdateRoleViewModel model);
1715
Task RemoveUserFromRole(RemoveUserFromRoleViewModel model);
1816
}
1917
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Threading.Tasks;
4-
using Jp.Application.EventSourcedNormalizers;
1+
using Jp.Application.EventSourcedNormalizers;
52
using Jp.Application.ViewModels;
63
using Jp.Application.ViewModels.RoleViewModels;
74
using Jp.Application.ViewModels.UserViewModels;
85
using Jp.Domain.Core.ViewModels;
9-
using Jp.Domain.Models;
6+
using System;
7+
using System.Collections.Generic;
8+
using System.Threading.Tasks;
109

1110
namespace Jp.Application.Interfaces
1211
{
@@ -18,8 +17,8 @@ public interface IUserManageAppService : IDisposable
1817
Task CreatePassword(SetPasswordViewModel model);
1918
Task RemoveAccount(RemoveAccountViewModel model);
2019
Task<bool> HasPassword(Guid userId);
21-
Task<IEnumerable<EventHistoryData>> GetHistoryLogs(string username);
22-
20+
Task<ListOf<EventHistoryData>> GetEvents(string username, PagingViewModel paging);
21+
2322
Task<UserViewModel> GetUserDetails(string username);
2423
Task<UserViewModel> GetUserAsync(Guid value);
2524
Task UpdateUser(UserViewModel model);
@@ -32,8 +31,8 @@ public interface IUserManageAppService : IDisposable
3231
Task SaveRole(SaveUserRoleViewModel model);
3332
Task<IEnumerable<UserLoginViewModel>> GetLogins(string userName);
3433
Task RemoveLogin(RemoveUserLoginViewModel model);
35-
Task<IEnumerable<UserListViewModel>> GetUsersInRole(string[] role);
34+
Task<IEnumerable<UserListViewModel>> GetUsersInRole(string role);
3635
Task ResetPassword(AdminChangePasswordViewodel model);
37-
Task<ListOfUsersViewModel> GetUsers(PagingViewModel page);
36+
Task<ListOf<UserListViewModel>> GetUsers(PagingViewModel page);
3837
}
3938
}

0 commit comments

Comments
 (0)