Skip to content

Commit

Permalink
Merge pull request #2538 from SolidProgramming/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tpurschke committed Sep 16, 2024
2 parents 0cf748b + c597b65 commit 9b5bf79
Show file tree
Hide file tree
Showing 21 changed files with 179 additions and 82 deletions.
10 changes: 3 additions & 7 deletions roles/FWO.sln
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FWO.Recert", "lib\files\FWO
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "files", "files", "{B48F8BD5-1056-4670-BEFA-F4A260293B6F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FWO.Encryption", "lib\files\FWO.Encryption\FWO.Encryption.csproj", "{6EBEBF57-3399-4008-BA10-0D21F6827244}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FWO.Encryption", "lib\files\FWO.Encryption\FWO.Encryption.csproj", "{6EBEBF57-3399-4008-BA10-0D21F6827244}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FWO.GlobalConstants", "lib\files\FWO.GlobalConstants\FWO.GlobalConstants.csproj", "{0CBD4CC5-3E39-4134-A0E1-4DB8999619F3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FWO.GlobalConstants", "lib\files\FWO.GlobalConstants\FWO.GlobalConstants.csproj", "{0CBD4CC5-3E39-4134-A0E1-4DB8999619F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FWO.Tufin.SecureChange", "lib\files\FWO.Tufin.SecureChange\FWO.Tufin.SecureChange.csproj", "{17AA0E0C-BB46-42FE-A08C-68539EA7FD53}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FWO.Tufin.SecureChange", "lib\files\FWO.Tufin.SecureChange\FWO.Tufin.SecureChange.csproj", "{17AA0E0C-BB46-42FE-A08C-68539EA7FD53}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -103,10 +103,6 @@ Global
{520779B1-20EB-45D9-8A02-D0C4DFEC9302}.Debug|Any CPU.Build.0 = Debug|Any CPU
{520779B1-20EB-45D9-8A02-D0C4DFEC9302}.Release|Any CPU.ActiveCfg = Release|Any CPU
{520779B1-20EB-45D9-8A02-D0C4DFEC9302}.Release|Any CPU.Build.0 = Release|Any CPU
{14B56819-F629-4CE9-BBC0-7579392EFC83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14B56819-F629-4CE9-BBC0-7579392EFC83}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14B56819-F629-4CE9-BBC0-7579392EFC83}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14B56819-F629-4CE9-BBC0-7579392EFC83}.Release|Any CPU.Build.0 = Release|Any CPU
{6EBEBF57-3399-4008-BA10-0D21F6827244}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6EBEBF57-3399-4008-BA10-0D21F6827244}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6EBEBF57-3399-4008-BA10-0D21F6827244}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
4 changes: 4 additions & 0 deletions roles/database/files/sql/idempotent/fworch-texts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6224,3 +6224,7 @@ INSERT INTO txt VALUES ('H9053', 'English', 'The assigned modeller can reject th

INSERT INTO txt VALUES ('H9054', 'German', 'Nachricht die auf der Anmeldeseite angezeigt werden soll.');
INSERT INTO txt VALUES ('H9054', 'English', 'Message that is displayed on Login Page.');
INSERT INTO txt VALUES ('PagerPagesize', 'German', 'Seitengröße');
INSERT INTO txt VALUES ('PagerPagesize', 'English', 'Page size');
INSERT INTO txt VALUES ('PagerSubmit', 'German', 'Speichern');
INSERT INTO txt VALUES ('PagerSubmit', 'English', 'Save');
2 changes: 1 addition & 1 deletion roles/lib/files/FWO.Config.File/FWO.Config.File.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.6.3" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.24" />
<PackageReference Include="RestSharp" Version="111.4.0" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="111.4.0" />
<PackageReference Include="RestSharp" Version="112.0.0" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="112.0.0" />
<PackageReference Include="RestSharp.Serializers.SystemTextJson" Version="106.15.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.24" />
<PackageReference Include="RestSharp" Version="111.4.0" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="111.4.0" />
<PackageReference Include="RestSharp" Version="112.0.0" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="112.0.0" />
<PackageReference Include="RestSharp.Serializers.SystemTextJson" Version="106.15.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion roles/lib/files/FWO.Middleware/FWO.Middleware.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.6.3" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion roles/lib/files/FWO.Tufin.SecureChange/ExternalTicket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public async Task<RestResponse<int>> CreateTicketInTufin(ExternalTicketSystem tu
string taskText = "";

// set templates from config
if (!tufinSystem.TicketTemplate.IsNullOrEmpty() && !tufinSystem.TasksTemplate.IsNullOrEmpty())
if (!string.IsNullOrEmpty(tufinSystem.TicketTemplate) && !string.IsNullOrEmpty(tufinSystem.TasksTemplate))
{
TicketTemplate = tufinSystem.TicketTemplate;
TasksTemplate = tufinSystem.TasksTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.24" />
<PackageReference Include="RestSharp" Version="111.4.0" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="111.4.0" />
<PackageReference Include="RestSharp" Version="112.0.0" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="112.0.0" />
<PackageReference Include="RestSharp.Serializers.SystemTextJson" Version="106.15.0" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions roles/middleware/files/FWO.Middleware.Server/AppDataImport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ private async Task AddAllGroupMembersToUiUser(string userGroupDn)
// find the user in all connected ldaps
foreach (Ldap ldap in connectedLdaps)
{
if (!ldap.UserSearchPath.IsNullOrEmpty() && userDn.ToLower().Contains(ldap.UserSearchPath!.ToLower()))
if (!string.IsNullOrEmpty(ldap.UserSearchPath) && userDn.ToLower().Contains(ldap.UserSearchPath!.ToLower()))
{
LdapEntry? ldapUser = ldap.GetUserDetailsFromLdap(userDn);

Expand Down Expand Up @@ -320,7 +320,7 @@ private async Task<Tenant> DeriveTenantFromLdap(Ldap ldap, LdapEntry ldapUser)
string tenantName = "";

// can we derive the users tenant purely from its ldap?
if (!ldap.GlobalTenantName.IsNullOrEmpty() || ldap.TenantLevel > 0)
if (!string.IsNullOrEmpty(ldap.GlobalTenantName) || ldap.TenantLevel > 0)
{
if (ldap.TenantLevel > 0)
{
Expand All @@ -329,7 +329,7 @@ private async Task<Tenant> DeriveTenantFromLdap(Ldap ldap, LdapEntry ldapUser)
}
else
{
if (!ldap.GlobalTenantName.IsNullOrEmpty())
if (!string.IsNullOrEmpty(ldap.GlobalTenantName))
{
tenantName = ldap.GlobalTenantName ?? "";
}
Expand Down
2 changes: 1 addition & 1 deletion roles/middleware/files/FWO.Middleware.Server/Ldap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private string GetGroupSearchFilter(string searchPattern)
List<LdapEntry> possibleUserEntries = [];

// If dn was already provided
if (!user.Dn.IsNullOrEmpty())
if (!string.IsNullOrEmpty(user.Dn))
{
// Try to read user entry directly
LdapEntry? userEntry = connection.Read(user.Dn);
Expand Down
6 changes: 3 additions & 3 deletions roles/test/files/FWO.Test/FWO.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

<ItemGroup>
<PackageReference Include="Haukcode.WkHtmlToPdfDotNet" Version="1.5.90" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.0.0" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 10 additions & 1 deletion roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAlerts.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
@if(InitComplete)
{
<div class="vheight75">
<Table TableClass="table table-bordered table-sm th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="Alert" Items="alertEntrys" PageSize="10">
<PageSizeComponent PageSizeCallback="UpdatePageSize" PageSize="PageSize"></PageSizeComponent>
<Table TableClass="table table-bordered table-sm th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="Alert" Items="alertEntrys" PageSize="PageSize">
<Column TableItem="Alert" Title="@(userConfig.GetText("id"))" Field="@(x => x.Id)" Sortable="true" Filterable="true"/>
<Column TableItem="Alert" Title="@(userConfig.GetText("timestamp"))" Field="@(x => x.Timestamp)" Sortable="true" Filterable="true"/>
<Column TableItem="Alert" Title="@(userConfig.GetText("source"))" Field="@(x => x.Source)" Sortable="true" Filterable="true"/>
Expand Down Expand Up @@ -52,11 +53,14 @@ else
[CascadingParameter]
Action<Exception?, string, string, bool> DisplayMessageInUi { get; set; } = DefaultInit.DoNothing;

private int PageSize { get; set; } = 10;

private List<Alert> alertEntrys = new List<Alert>();
private List<UiUser> uiUsers = new List<UiUser>();
private List<Management> managements = new List<Management>();
private bool InitComplete = false;


protected override async Task OnInitializedAsync()
{
try
Expand All @@ -78,4 +82,9 @@ else
DisplayMessageInUi(exception, userConfig.GetText("fetch_alerts"), "", true);
}
}

private void UpdatePageSize(int pageSize)
{
PageSize = pageSize;
}
}
11 changes: 9 additions & 2 deletions roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAll.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@using System.Text
@using FWO.Config.Api
@using FWO.Ui.Shared

@inject ApiConnection apiConnection
@inject UserConfig userConfig
Expand All @@ -12,7 +13,8 @@
@if(InitComplete)
{
<div class="vheight75">
<Table TableClass="table table-bordered table-sm th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="LogEntry" Items="logEntrys" PageSize="10">
<PageSizeComponent PageSizeCallback="UpdatePageSize" PageSize="PageSize"></PageSizeComponent>
<Table TableClass="table table-bordered table-sm th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="LogEntry" Items="logEntrys" PageSize="PageSize">
<Column TableItem="LogEntry" Title="@(userConfig.GetText("id"))" Field="@(x => x.Id)" Sortable="true" Filterable="true"/>
<Column TableItem="LogEntry" Title="@(userConfig.GetText("source"))" Field="@(x => x.Source)" Sortable="true" Filterable="true"/>
<Column TableItem="LogEntry" Title="@(userConfig.GetText("severity"))" Field="@(x => x.Severity)" Sortable="true" Filterable="true"/>
Expand Down Expand Up @@ -48,6 +50,8 @@ else
private List<LogEntry> logEntrys = new List<LogEntry>();
private bool InitComplete = false;

private int PageSize { get; set; } = 10;

protected override async Task OnInitializedAsync()
{
try
Expand All @@ -61,5 +65,8 @@ else
}
}


private void UpdatePageSize(int pageSize)
{
PageSize = pageSize;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@using FWO.Config.Api
@using FWO.Middleware.Client
@using FWO.Ui.Shared
@inject ApiConnection apiConnection
@inject UserConfig userConfig

Expand All @@ -13,7 +14,8 @@
@if(InitComplete)
{
<div class="vheight75">
<Table TableClass="table table-bordered table-sm th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="LogEntry" Items="logEntrys" PageSize="100">
<PageSizeComponent PageSizeCallback="UpdatePageSize" PageSize="PageSize"></PageSizeComponent>
<Table TableClass="table table-bordered table-sm th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="LogEntry" Items="logEntrys" PageSize="PageSize">
<Column TableItem="LogEntry" Title="@(userConfig.GetText("id"))" Field="@(x => x.Id)" Sortable="true" Filterable="true"/>
<Column TableItem="LogEntry" Title="@(userConfig.GetText("timestamp"))" Field="@(x => x.Timestamp)" Sortable="true" Filterable="true"/>
<Column TableItem="LogEntry" Title="@(userConfig.GetText("found_by"))" Field="@(x => x.UserId)" Sortable="true">
Expand Down Expand Up @@ -51,6 +53,8 @@ else
private List<Management> managements = new List<Management>();
private bool InitComplete = false;

private int PageSize { get; set; } = 10;

protected override async Task OnInitializedAsync()
{
try
Expand All @@ -73,4 +77,9 @@ else
DisplayMessageInUi(exception, userConfig.GetText("fetch_log_entrys"), "", true);
}
}

private void UpdatePageSize(int pageSize)
{
PageSize = pageSize;
}
}
11 changes: 10 additions & 1 deletion roles/ui/files/FWO.UI/Pages/Monitoring/MonitorDailyChecks.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using FWO.Config.Api
@using FWO.Ui.Shared

@inject ApiConnection apiConnection
@inject UserConfig userConfig
Expand All @@ -13,7 +14,8 @@
@if(InitComplete)
{
<div class="vheight75">
<Table TableClass="table table-bordered table-sm th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="LogEntry" Items="logEntrys" PageSize="100">
<PageSizeComponent PageSizeCallback="UpdatePageSize" PageSize="PageSize"></PageSizeComponent>
<Table TableClass="table table-bordered table-sm th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="LogEntry" Items="logEntrys" PageSize="PageSize">
<Column TableItem="LogEntry" Title="@(userConfig.GetText("id"))" Field="@(x => x.Id)" Sortable="true" Filterable="true"/>
<Column TableItem="LogEntry" Title="@(userConfig.GetText("timestamp"))" Field="@(x => x.Timestamp)" Sortable="true" Filterable="true"/>
<Column TableItem="LogEntry" Title="@(userConfig.GetText("severity"))" Field="@(x => x.Severity)" Sortable="true" Filterable="true"/>
Expand All @@ -39,6 +41,8 @@ else
private List<LogEntry> logEntrys = new List<LogEntry>();
private bool InitComplete = false;

private int PageSize { get; set; } = 10;

protected override async Task OnInitializedAsync()
{
try
Expand All @@ -51,4 +55,9 @@ else
DisplayMessageInUi(exception, userConfig.GetText("fetch_log_entrys"), "", true);
}
}

private void UpdatePageSize(int pageSize)
{
PageSize = pageSize;
}
}
11 changes: 10 additions & 1 deletion roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportLog.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using FWO.Config.Api
@using FWO.Ui.Shared

@inject ApiConnection apiConnection
@inject UserConfig userConfig
Expand All @@ -13,7 +14,8 @@
@if(InitComplete)
{
<div class="vheight75">
<Table TableClass="table table-bordered table-sm th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="LogEntry" Items="logEntrys" PageSize="10">
<PageSizeComponent PageSizeCallback="UpdatePageSize" PageSize="PageSize"></PageSizeComponent>
<Table TableClass="table table-bordered table-sm th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="LogEntry" Items="logEntrys" PageSize="PageSize">
<Column TableItem="LogEntry" Title="@(userConfig.GetText("id"))" Field="@(x => x.Id)" Sortable="true" Filterable="true"/>
<Column TableItem="LogEntry" Title="@(userConfig.GetText("severity"))" Field="@(x => x.Severity)" Sortable="true" Filterable="true"/>
<Column TableItem="LogEntry" Title="@(userConfig.GetText("description"))" Field="@(x => x.Description)" Sortable="true" Filterable="true"/>
Expand Down Expand Up @@ -46,6 +48,8 @@ else
private List<LogEntry> logEntrys = new List<LogEntry>();
private bool InitComplete = false;

private int PageSize { get; set; } = 10;

protected override async Task OnInitializedAsync()
{
try
Expand All @@ -58,4 +62,9 @@ else
DisplayMessageInUi(exception, userConfig.GetText("fetch_log_entrys"), "", true);
}
}

private void UpdatePageSize(int pageSize)
{
PageSize = pageSize;
}
}
11 changes: 10 additions & 1 deletion roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportStatus.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@using FWO.Api.Data
@using FWO.Api.Client
@using FWO.Config.Api
@using FWO.Ui.Shared

@page "/monitoring/import_status"
@attribute [Authorize(Roles = $"{Roles.Admin}, {Roles.Importer}, {Roles.Auditor}, {Roles.FwAdmin}")]
Expand All @@ -19,7 +20,8 @@
@if(InitComplete)
{
<div class="m-2 vheight75">
<Table class="table table-bordered th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="ImportStatus" Items="sortedImportStati" PageSize="0" ColumnReorder="true" TableRowClass="@(stat => getTableRowClass(stat))">
<PageSizeComponent PageSizeCallback="UpdatePageSize" PageSize="PageSize"></PageSizeComponent>
<Table class="table table-bordered th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="ImportStatus" Items="sortedImportStati" PageSize="PageSize" ColumnReorder="true" TableRowClass="@(stat => getTableRowClass(stat))">
<Column TableItem="ImportStatus" Title="@(userConfig.GetText("actions"))" Field="(x => x.MgmId)" Sortable="false" Filterable="false">
<Template>
<div class="btn-group">
Expand Down Expand Up @@ -106,6 +108,8 @@ else
private ImportStatus actStatus = new ImportStatus();
private bool InitComplete = false;
private int PageSize { get; set; } = 10;
protected override async Task OnInitializedAsync()
{
await fetchImportStati();
Expand Down Expand Up @@ -207,4 +211,9 @@ else
return "";
}
}

private void UpdatePageSize(int pageSize)
{
PageSize = pageSize;
}
}
11 changes: 10 additions & 1 deletion roles/ui/files/FWO.UI/Pages/Monitoring/MonitorUiLog.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using FWO.Config.Api
@using FWO.Ui.Shared

@inject ApiConnection apiConnection
@inject UserConfig userConfig
Expand Down Expand Up @@ -26,7 +27,8 @@
<hr />
}
<div class="vheight75">
<Table TableClass="table table-bordered table-sm th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="LogEntry" Items="logEntrys" PageSize="15">
<PageSizeComponent PageSizeCallback="UpdatePageSize" PageSize="PageSize"></PageSizeComponent>
<Table TableClass="table table-bordered table-sm th-bg-secondary table-responsive overflow-auto sticky-header" TableItem="LogEntry" Items="logEntrys" PageSize="PageSize">
<Column TableItem="LogEntry" Title="@(userConfig.GetText("id"))" Field="@(x => x.Id)" Sortable="true" Filterable="true"/>
<Column TableItem="LogEntry" Title="@(userConfig.GetText("severity"))" Field="@(x => x.Severity)" Sortable="true" Filterable="true"/>
<Column TableItem="LogEntry" Title="@(userConfig.GetText("timestamp"))" Field="@(x => x.Timestamp)" Sortable="true" Filterable="true"/>
Expand Down Expand Up @@ -65,6 +67,8 @@ else
private bool seeAllUsers = false;
private bool InitComplete = false;

private int PageSize { get; set; } = 10;

protected override async Task OnInitializedAsync()
{
try
Expand Down Expand Up @@ -112,4 +116,9 @@ else
{
await Refresh();
}

private void UpdatePageSize(int pageSize)
{
PageSize = pageSize;
}
}
Loading

0 comments on commit 9b5bf79

Please sign in to comment.