refactor: Projektdateien migriert. Cloud-NuGet-Pakete durch lokale NuGet-Projekte ersetzt.

This commit is contained in:
Developer 02
2024-08-01 18:44:39 +02:00
parent 0d82f7af6f
commit 62ddd4873f
206 changed files with 10927 additions and 1 deletions

View File

@@ -0,0 +1,49 @@
using System.Collections.Generic;
namespace HRD.LDAPService.JWT
{
public static class JwtTokenConfig
{
private static string secret;
public static int ExpirationInMin { get; set; }
public static string Secret { get; set; }
public static string Issuer { get; internal set; }
public static string Audience { get; internal set; }
#warning use internal setter
public static List<JwtRole> JwtRoleList { get; set; } = new List<JwtRole>();
public static List<string> AuthorizationFilterWhitelistPath { get; set; }
public static List<string> AuthorizationFilterBlacklistPath { get; set; }
public static bool AktivateAuthorizationFilter { get; set; }
public static bool DeaktivateLDAP { get; set; }
public static bool IsInWhiteList(string path)
{
if (string.IsNullOrEmpty(path)) { return false; }
foreach (var item in JwtTokenConfig.AuthorizationFilterWhitelistPath)
{
if (path.Contains(item, System.StringComparison.InvariantCultureIgnoreCase))
{
return true;
}
}
return false;
}
public static bool IsInBlackList(string path)
{
if (string.IsNullOrEmpty(path)) { return false; }
foreach (var item in JwtTokenConfig.AuthorizationFilterBlacklistPath)
{
if (path.Contains(item, System.StringComparison.InvariantCultureIgnoreCase))
{
return true;
}
}
return false;
}
}
}