Files
ClubPenguinServer/MareSynchronosServer/MareSynchronosShared/Utils/MareConfigurationAuthBase.cs
rootdarkarchon 5f0c12ecfa Switch to JWT authentication (#19)
* switch to jwt authentication

* fix delete files

* adjust saving of deletion of all files

* update api to main/jwt

Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
2023-01-02 17:07:34 +01:00

28 lines
1.1 KiB
C#

using System.Text;
namespace MareSynchronosShared.Utils;
public class MareConfigurationAuthBase : MareConfigurationBase
{
public Uri MainServerGrpcAddress { get; set; } = null;
[RemoteConfiguration]
public int FailedAuthForTempBan { get; set; } = 5;
[RemoteConfiguration]
public int TempBanDurationInMinutes { get; set; } = 5;
[RemoteConfiguration]
public List<string> WhitelistedIps { get; set; } = new();
[RemoteConfiguration]
public string Jwt { get; set; } = string.Empty;
public override string ToString()
{
StringBuilder sb = new();
sb.AppendLine(base.ToString());
sb.AppendLine($"{nameof(MainServerGrpcAddress)} => {MainServerGrpcAddress}");
sb.AppendLine($"{nameof(FailedAuthForTempBan)} => {FailedAuthForTempBan}");
sb.AppendLine($"{nameof(TempBanDurationInMinutes)} => {TempBanDurationInMinutes}");
sb.AppendLine($"{nameof(Jwt)} => {Jwt}");
sb.AppendLine($"{nameof(WhitelistedIps)} => {string.Join(", ", WhitelistedIps)}");
return sb.ToString();
}
}