Skip to content

Commit

Permalink
Merge pull request #483 from Blazam-App/v1-Dev
Browse files Browse the repository at this point in the history
V1 Nightly update
  • Loading branch information
jacobsen9026 authored Aug 9, 2024
2 parents 80b542c + e7b2627 commit e6e5d27
Show file tree
Hide file tree
Showing 23 changed files with 45 additions and 108 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/deploy-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Build and deploy ASP.Net Core app to Azure Web App - blazam
on:
push:
branches:
- Beta-Nightly
- v1-Nightly
workflow_dispatch:

jobs:
Expand All @@ -17,11 +17,6 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.x
- name: Setup .NET Core SDK 8
uses: actions/setup-dotnet@v1
with:
Expand Down
4 changes: 0 additions & 4 deletions BLAZAM.Tests/BLAZAM.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 2 additions & 6 deletions BLAZAM/BLAZAM.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ServerGarbageCollection>false</ServerGarbageCollection>
<AssemblyVersion>1.0.0</AssemblyVersion>
<Version>2024.08.09.0701</Version>
<Version>2024.08.09.1713</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
Expand Down Expand Up @@ -58,12 +58,8 @@
<PackageReference Include="Cassia" Version="2.0.0.60" />
<PackageReference Include="DuoUniversal" Version="1.2.5" />
<PackageReference Include="MailKit" Version="4.7.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />
Expand Down
12 changes: 6 additions & 6 deletions BLAZAM/Pages/Users/ViewUser.razor
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<LogOnToModalContent User="User" />
}
</AppModal>
<AppModal Title=@AppLocalization["Logon Hours"] @ref=@LogonHoursModal Options=@(new DialogOptions(){CloseButton=true, FullWidth=true,MaxWidth=MaxWidth.ExtraExtraLarge})>
<AppModal Title=@AppLocalization["Logon Hours"] @ref=@LogonHoursModal Options=@(new DialogOptions(){CloseButton=true, FullWidth=true,MaxWidth=MaxWidth.ExtraExtraLarge})>
@if (LogonHoursModal?.IsShown == true)
{
<LogonHoursModalContent User="User" />
Expand Down Expand Up @@ -272,8 +272,8 @@
@AppLocalization["Log On To"]
</MudButton>

}
}

@if (User.CanReadField(ActiveDirectoryFields.LogonHours))
{
<MudButton Variant="Variant.Filled"
Expand Down Expand Up @@ -469,7 +469,7 @@


@code {
#nullable disable warnings
#nullable disable warnings
string password;

[Parameter]
Expand Down Expand Up @@ -554,7 +554,7 @@
if (jobResults.Result == JobResult.Passed)
{

foreach(var assignment in assignTo)
foreach (var assignment in assignTo)
{
await AuditLogger.User.Assigned(assignment.Member, assignment.Group);
await AuditLogger.Group.MemberAdded(assignment.Group, assignment.Member);
Expand All @@ -570,7 +570,7 @@
_ = OUNotificationService.PostAsync(User, NotificationType.Modify);
await AuditLogger.User.Changed(User, changes.Where(c => c.Field != ActiveDirectoryFields.MemberOf.FieldName).ToList());
}

EditMode = false;
Nav.WarnOnNavigation = false;
SnackBarService.Success("The changes made to this user have been saved.");
Expand Down
2 changes: 0 additions & 2 deletions BLAZAM/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
using Serilog;
using BLAZAM.Common.Data;
using BLAZAM.Server;
using BLAZAM.Services.Background;
using System.Net;
using BLAZAM.Database.Context;
using System.Diagnostics;
using System.Security.Cryptography.X509Certificates;
using System.Net.WebSockets;
using BLAZAM.Database.Models;

namespace BLAZAM
Expand Down
3 changes: 0 additions & 3 deletions BLAZAMActiveDirectory/ActiveDirectoryContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using BLAZAM.ActiveDirectory.Interfaces;
using BLAZAM.ActiveDirectory.Searchers;
using BLAZAM.Common.Data;
using BLAZAM.Common.Data.Database;
using BLAZAM.Common.Data.Services;
using BLAZAM.Database.Context;
using BLAZAM.Database.Models;
Expand All @@ -13,11 +12,9 @@
using System.DirectoryServices;
using System.DirectoryServices.Protocols;
using System.Net;
using System.Security.Claims;
using BLAZAM.Helpers;
using System.DirectoryServices.ActiveDirectory;
using System.Security.Cryptography;
using System.Diagnostics.Eventing.Reader;
using System.Security.Principal;

namespace BLAZAM.ActiveDirectory
Expand Down
6 changes: 0 additions & 6 deletions BLAZAMActiveDirectory/ActiveDirectoryContextFactory.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
using BLAZAM.ActiveDirectory.Interfaces;
using BLAZAM.Common.Data.Database;
using BLAZAM.Common.Data.Services;
using BLAZAM.Database.Context;
using BLAZAM.Notifications.Services;
using BLAZAM.Session.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLAZAM.ActiveDirectory
{
Expand Down
4 changes: 2 additions & 2 deletions BLAZAMActiveDirectory/Adapters/ADGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public List<IGroupableDirectoryAdapter> Members
}
}
/// <summary>
/// Removes a memeber from this group
/// Removes a member from this group
/// </summary>
/// <param name="member">The user or group to remove</param>
public void UnassignMember(IGroupableDirectoryAdapter member)
Expand All @@ -238,7 +238,7 @@ public void UnassignMember(IGroupableDirectoryAdapter member)

}
/// <summary>
/// Assigns a memeber to this group
/// Assigns a member to this group
/// </summary>
/// <param name="member"></param>
public void AssignMember(IGroupableDirectoryAdapter member)
Expand Down
9 changes: 1 addition & 8 deletions BLAZAMActiveDirectory/Adapters/ADUser.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
using BLAZAM.ActiveDirectory;
using BLAZAM.ActiveDirectory.Data;
using BLAZAM.ActiveDirectory.Data;
using BLAZAM.ActiveDirectory.Interfaces;
using BLAZAM.Common.Data;
using BLAZAM.Database.Models;
using BLAZAM.FileSystem;
using BLAZAM.Helpers;
using BLAZAM.Jobs;
using BLAZAM.Logger;
using Microsoft.IdentityModel.Tokens;
using System.ComponentModel.DataAnnotations;
using System.DirectoryServices.AccountManagement;
using System.DirectoryServices.ActiveDirectory;
using System.DirectoryServices.Protocols;
using System.Net;
using System.Security;
using System.Security.AccessControl;
using System.Text;

Expand Down
1 change: 0 additions & 1 deletion BLAZAMActiveDirectory/ScopedActiveDirectoryContext.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using BLAZAM.ActiveDirectory.Interfaces;
using BLAZAM.Common.Data.Services;
using BLAZAM.Session.Interfaces;

namespace BLAZAM.ActiveDirectory
Expand Down
4 changes: 1 addition & 3 deletions BLAZAMActiveDirectory/Searchers/ADGroupSearcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,7 @@ public bool IsAMemberOf(IADGroup group, IGroupableDirectoryAdapter? userOrGroup,
ExactMatch = false

}.Search<ADUser, IADUser>().Count>0;
string UserSearchFieldsQuery = "(&(memberOf:1.2.840.113556.1.4.1941:=" + group.DN + ")(distinguishedName=" + userOrGroup.DN + "))";
return SearchObjects(UserSearchFieldsQuery, userOrGroup.ObjectType, 50, ignoreDisabledUsers)?.Count > 0;


}
}
}
14 changes: 1 addition & 13 deletions BLAZAMActiveDirectory/Searchers/ADSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,11 @@
using BLAZAM.ActiveDirectory.Adapters;
using BLAZAM.ActiveDirectory.Interfaces;
using BLAZAM.Common.Data;
using BLAZAM.Common.Data.Database;
using BLAZAM.Database.Context;
using BLAZAM.Helpers;
using BLAZAM.Logger;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.IdentityModel.Tokens;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.DirectoryServices;
using System.DirectoryServices.Protocols;
using System.Drawing.Printing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLAZAM.ActiveDirectory.Searchers
{
Expand Down Expand Up @@ -61,7 +49,7 @@ public class ADSearch : SearchBase
/// <summary>
/// Indicates whether the search is single level or recursive default is recursive
/// </summary>
public System.DirectoryServices.SearchScope SearchScope { get; set; } = System.DirectoryServices.SearchScope.Subtree;
public SearchScope SearchScope { get; set; } = SearchScope.Subtree;

/// <summary>
/// The realtime results of this search.
Expand Down
5 changes: 0 additions & 5 deletions BLAZAMCommon.Tests/BLAZAMCommon.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />
Expand All @@ -21,10 +20,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion BLAZAMCommon/BLAZAMCommon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<PackageReference Include="Cassia" Version="2.0.0.60" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />
Expand Down
2 changes: 1 addition & 1 deletion BLAZAMCommon/Data/ApplicationVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public override int GetHashCode()
return Version.GetHashCode();
}

public override string? ToString()
public override string ToString()
{
return Version;
}
Expand Down
2 changes: 0 additions & 2 deletions BLAZAMCommon/Data/Encryption.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using BLAZAM.Helpers;
using Newtonsoft.Json;
using System;
using System.ComponentModel;
using System.Security.Cryptography;
using System.Text;

Expand Down
1 change: 0 additions & 1 deletion BLAZAMDatabase/BLAZAMDatabase.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.7" />
Expand Down
5 changes: 1 addition & 4 deletions BLAZAMFileSystem/SystemDirectory.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@


using Serilog;
using System.IO;
using System.Security.Permissions;
using System.Security;

namespace BLAZAM.FileSystem
{
/// <summary>
/// Represents a diretory in the filesystem
/// Represents a directory in the filesystem
/// </summary>
public class SystemDirectory : FileSystemBase
{
Expand Down
1 change: 0 additions & 1 deletion BLAZAMGui/BLAZAMGui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.7" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="8.0.7" />
<PackageReference Include="MudBlazor" Version="7.6.0" />
<PackageReference Include="MudBlazor.Markdown" Version="1.0.2" />
Expand Down
32 changes: 23 additions & 9 deletions BLAZAMJobs/Job.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

namespace BLAZAM.Jobs
{

/// <summary>
///
/// A flexible multi step Job that can have actions as trackable steps.
/// </summary>
public class Job : JobStepBase, IJob, IJobStep
public class Job : JobStepBase, IJob, IJobStep, IEquatable<IJob?>
{
private DateTime scheduledRunTime = DateTime.Now;
private Timer? runScheduler;

public string? User { get; set; } = "System";

private IList<IJobStep> _steps = new List<IJobStep>();
private IList<IJobStep> _steps = [];

public IList<IJobStep> Steps => _steps;

Expand Down Expand Up @@ -172,13 +173,26 @@ public override void Cancel()
}
}

public override bool Equals(object? obj)

public bool Equals(IJob? other)
{
if(obj is IJob job)
{
return job.Id.Equals(Id);
}
return false;
return other is not null &&
Id.Equals(other.Id);
}

public override int GetHashCode()
{
return HashCode.Combine(Id);
}

public static bool operator ==(Job? left, IJob? right)
{
return left.Equals(right);
}

public static bool operator !=(Job? left, IJob? right)
{
return !(left == right);
}
}

Expand Down
5 changes: 0 additions & 5 deletions BLAZAMNav/AppNavigationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.Extensions.Localization;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLAZAM.Nav
{
Expand Down
Loading

0 comments on commit e6e5d27

Please sign in to comment.