Browse Source

Init UserSecurityLog.

pull/4675/head
maliming 6 years ago
parent
commit
a36fda11e3
  1. 1
      framework/src/Volo.Abp.Security/Volo.Abp.Security.csproj
  2. 9
      framework/src/Volo.Abp.Security/Volo/Abp/Users/SecurityLog/IUserSecurityLogStore.cs
  3. 53
      framework/src/Volo.Abp.Security/Volo/Abp/Users/SecurityLog/UserSecurityLogInfo.cs

1
framework/src/Volo.Abp.Security/Volo.Abp.Security.csproj

@ -16,6 +16,7 @@
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.Core\Volo.Abp.Core.csproj" />
<ProjectReference Include="..\Volo.Abp.ObjectExtending\Volo.Abp.ObjectExtending.csproj" />
</ItemGroup>
</Project>

9
framework/src/Volo.Abp.Security/Volo/Abp/Users/SecurityLog/IUserSecurityLogStore.cs

@ -0,0 +1,9 @@
using System.Threading.Tasks;
namespace Volo.Abp.Users.SecurityLog
{
public interface IUserSecurityLogStore
{
Task SaveAsync(UserSecurityLogInfo userSecurityLogInfo);
}
}

53
framework/src/Volo.Abp.Security/Volo/Abp/Users/SecurityLog/UserSecurityLogInfo.cs

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Data;
namespace Volo.Abp.Users.SecurityLog
{
[Serializable]
public class UserSecurityLogInfo : IHasExtraProperties
{
/// <summary>
/// The name of the application or service writing user security logs.
/// Default: null.
/// </summary>
public string ApplicationName { get; set; }
/// <summary>
/// Web, JWT, Identity, Identity_Server
/// </summary>
public string Identity { get; set; }
/// <summary>
/// login_successful, login_failed, logout, change_pwd, refresh_token...
/// </summary>
public string Action { get; set; }
public Dictionary<string, object> ExtraProperties { get; }
public Guid? UserId { get; set; }
public string UserName { get; set; }
public Guid? TenantId { get; set; }
public string TenantName { get; set; }
public string ClientId { get; set; }
public string ClientName { get; set; }
public string CorrelationId { get; set; }
public string ClientIpAddress { get; set; }
public string BrowserInfo { get; set; }
public DateTime CreationTime { get; set; }
public UserSecurityLogInfo()
{
ExtraProperties = new Dictionary<string, object>();
}
}
}
Loading…
Cancel
Save