【新特性】添加自定义过滤器,可进行自定义登录认证逻辑

This commit is contained in:
SpringHgui 2020-09-27 09:09:53 +08:00
parent 926b16fa36
commit acf98dbae1
3 changed files with 15 additions and 3 deletions

View File

@ -78,8 +78,9 @@ namespace FastTunnel.Client
Content = new LogInMassage
{
Webs = config.Webs,
SSH = config.SSH
}
SSH = config.SSH,
AuthInfo = "ODadoNDONODHSoDMFMsdpapdoNDSHDoadpwPDNoWAHDoNfa"
},
});
return _client;

View File

@ -7,8 +7,19 @@ namespace FastTunnel.Core.Models
{
public class LogInMassage : TunnelMassage
{
/// <summary>
/// web穿透隧道列表
/// </summary>
public IEnumerable<WebConfig> Webs { get; set; }
/// <summary>
/// 端口转发隧道列表
/// </summary>
public IEnumerable<SSHConfig> SSH { get; set; }
/// <summary>
/// 身份信息,用于服务端认证
/// </summary>
public string AuthInfo { get; set; }
}
}

View File

@ -12,7 +12,7 @@ namespace FastTunnel.Server.Filters
{
public bool Authentication(FastTunnelServer server, LogInMassage requet)
{
return true;
return !string.IsNullOrEmpty(requet.AuthInfo) && requet.AuthInfo.Equals("ODadoNDONODHSoDMFMsdpapdoNDSHDoadpwPDNoWAHDoNfa");
}
}
}