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,37 @@
using HRD.LDAPService;
using HRD.LDAPService.JWT;
using HRD.WebApi;
using System.Collections.Generic;
namespace StaffDBServer.Extends
{
public static class JwtMiddlewareOptionsHelper
{
public static JwtMiddlewareOptions GetJwtMiddlewareOptions()
{
var list = new List<JwtRole>();
var ADGroupPrefix = WebApiConfig.IsLive ? "" : "__Test";
//Admin Role
list.Add(new JwtRole(JwtGlobals.ROLE_ADMIN, "GG_WebApp" + ADGroupPrefix + "_StaffDB_Admin"));
//Core RoleList
list.Add(new JwtRole(JwtGlobals.ROLE_USER, "GG_WebApp" + ADGroupPrefix + "_StaffDB_User")); //(RO) nur eigene
list.Add(new JwtRole(JwtGlobals.ROLE_MASTER, "GG_WebApp" + ADGroupPrefix + "_StaffDB_Master")); //RW ALLE Abteilungen
list.Add(new JwtRole(JwtGlobals.ROLE_DEPARTMENTUSER, "GG_WebApp" + ADGroupPrefix + "_StaffDB_DepartmentUser")); //(RW) auch andere aus eigener Abteilung
list.Add(new JwtRole(JwtGlobals.ROLE_DEPARTMENTMASTER, "GG_WebApp" + ADGroupPrefix + "_StaffDB_DepartmentMaster")); //(RW) auch andere aus eigener Abteilung
JwtMiddlewareOptions options = new JwtMiddlewareOptions()
{
Secret = "12345678901234567809_MY_VERY_LONG_SECRET",
JwtRoleList = list,
ExpirationInMin = 60 * 24 * 30 * 1, //1 Month
AktivateAuthorizationFilter = true,
AuthorizationFilterWhitelistPath = new List<string>() { "api/WebAppUser/LoginWithNameAndPassword", "api/Info" },
AuthorizationFilterBlacklistPath = new List<string>() { "api/WebAppUser/all" }
};
return options;
}
}
}