Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
webprofusion-chrisc committed Jul 28, 2024
1 parent d9db785 commit 4994249
Show file tree
Hide file tree
Showing 40 changed files with 30 additions and 84 deletions.
1 change: 0 additions & 1 deletion src/Certify.CLI/CertifyCLI.Backup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Certify.Client;
using Certify.Models.Config.Migration;
using Newtonsoft.Json;

Expand Down
1 change: 0 additions & 1 deletion src/Certify.CLI/CertifyCLI.RunCertDiagnostics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Certify.Management;
using Certify.Models;
using Microsoft.Extensions.Logging;
using Serilog;

namespace Certify.CLI
{
Expand Down
2 changes: 1 addition & 1 deletion src/Certify.Client/CertifyServiceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public async Task ConnectStatusStreamAsync()
_legacyConnection.TraceLevel = TraceLevels.All;
_legacyConnection.TraceWriter = writer;
#endif

await _legacyConnection.Start();

}
Expand Down
1 change: 0 additions & 1 deletion src/Certify.Client/ManagementServerClient.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Threading.Tasks;
using Certify.API.Management;
using Certify.Models;
using Microsoft.AspNetCore.SignalR.Client;
using Microsoft.Extensions.DependencyInjection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Certify.API.Management;
using Certify.Client;
using Certify.Core.Management;
using Certify.Models;
using Certify.Models.Config.Migration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Management.Automation;
using System.Threading.Tasks;
using Certify.Models;
using Certify.Models.API;
Expand Down Expand Up @@ -560,7 +559,7 @@ public async Task<LogItem[]> GetItemLog(string id, int limit)
var str = await streamReader.ReadToEndAsync();
stream.Close();

var log =str.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries)
var log = str.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries)
.Reverse()
.Take(limit)
.ToArray();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Certify.API.Management;
using Certify.Client;
using Certify.Models;
using Certify.Models.Shared.Validation;
using System.Text.Json;
using Certify.Shared.Core.Utils;
using Serilog;

namespace Certify.Management
{
Expand Down
4 changes: 2 additions & 2 deletions src/Certify.Core/Management/CertifyManager/CertifyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,13 @@ private LoggingLevelSwitch LogLevelSwitchFromLogLevel(LogLevel level)
{
switch (level)
{
case LogLevel.Error:
case LogLevel.Error:
return new LoggingLevelSwitch(Serilog.Events.LogEventLevel.Error);
case LogLevel.Debug:
return new LoggingLevelSwitch(Serilog.Events.LogEventLevel.Debug);
case LogLevel.Warning:
return new LoggingLevelSwitch(Serilog.Events.LogEventLevel.Warning);
default:
default:
return new LoggingLevelSwitch(Serilog.Events.LogEventLevel.Information);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Certify.Providers/ACME/Anvil/AnvilACMEProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Globalization;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

using System.Collections.Frozen;
using Certify.API.Management;
using Certify.API.Management;
using Certify.Client;
using Certify.Models.API;
using Certify.Server.Api.Public.SignalR.ManagementHub;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Certify.Client;
using Certify.Models;
using Certify.Models;
using Certify.Server.Api.Public.Services;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using Certify.Client;
using Certify.Models;
using Certify.Models.API;
using Certify.Models.Reporting;
using Certify.Server.Api.Public.Services;
using Certify.Server.Api.Public.SignalR.ManagementHub;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;

namespace Certify.Server.Api.Public.Controllers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Concurrent;
using System.Diagnostics;
using Certify.API.Management;
using Certify.Models;
using Certify.API.Management;
using Certify.Models.Reporting;
using Microsoft.AspNetCore.SignalR;

Expand Down Expand Up @@ -183,7 +179,7 @@ public Task ReceiveCommandResult(InstanceCommandResult result)

_stateProvider.UpdateInstanceItemInfo(instanceId, val.Items);
}
else if (cmd.CommandType == ManagementHubCommands.GetStatusSummary && result?.Value!=null)
else if (cmd.CommandType == ManagementHubCommands.GetStatusSummary && result?.Value != null)
{
// got status summary
var val = System.Text.Json.JsonSerializer.Deserialize<StatusSummary>(result.Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Certify.API.Management;
using Certify.Models;
using Certify.Models.Reporting;
using Microsoft.IdentityModel.Logging;

namespace Certify.Server.Api.Public.SignalR.ManagementHub
{
Expand All @@ -24,7 +23,7 @@ public interface IInstanceManagementStateProvider
public void UpdateCachedManagedInstanceItem(string instanceId, ManagedCertificate managedCertificate);
public void DeleteCachedManagedInstanceItem(string instanceId, string managedCertificateId);
public bool HasItemsForManagedInstance(string instanceId);

public bool HasStatusSummaryForManagedInstance(string instanceId);
public ConcurrentDictionary<string, StatusSummary> GetManagedInstanceStatusSummaries();
}
Expand Down
2 changes: 0 additions & 2 deletions src/Certify.Server/Certify.Server.Api.Public/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Reflection.Metadata.Ecma335;
using Certify.Client;
using Certify.Server.Api.Public.Middleware;
using Certify.Server.Api.Public.Services;
Expand All @@ -9,7 +8,6 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Models;

namespace Certify.Server.API
Expand Down
5 changes: 2 additions & 3 deletions src/Certify.Service/APIHost.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Diagnostics;
using System.Diagnostics;
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
Expand Down Expand Up @@ -82,7 +81,7 @@ public void Configuration(IAppBuilder appBuilder)
// inject single CertifyManager for service to use
_container.Register<Management.ICertifyManager, Management.CertifyManager>(new PerContainerLifetime());


var currentCertifyManager = _container.GetInstance<Management.ICertifyManager>();

var sw = Stopwatch.StartNew();
Expand Down
2 changes: 1 addition & 1 deletion src/Certify.Service/OwinService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void Start(int? portOverride = null)
try
{
_webApp = WebApp.Start<APIHost>(serviceUri);

Program.LogEvent(null, $"Service API bound OK to {serviceUri}", false);
}
catch (Exception exp)
Expand Down
4 changes: 1 addition & 3 deletions src/Certify.Shared.Extensions/Utils/PowerShellManager.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.AccessControl;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
using Certify.Management.Utils;
using Certify.Models;
using Certify.Models.Config;
using SimpleImpersonation;
Expand Down
2 changes: 0 additions & 2 deletions src/Certify.Shared/Management/CredentialsUtil.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using Certify.Models.Config;
using Certify.Providers;

namespace Certify.Management
Expand Down
2 changes: 1 addition & 1 deletion src/Certify.Shared/Management/PluginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public PluginManager()
.WriteTo.File(Path.Combine(EnvironmentUtil.CreateAppDataPath("logs"), "plugins.log"), shared: true, flushToDiskInterval: new TimeSpan(0, 0, 10))
.CreateLogger();

var msLogger = new SerilogLoggerFactory(serilogLogger).CreateLogger<PluginManager>();
var msLogger = new SerilogLoggerFactory(serilogLogger).CreateLogger<PluginManager>();

_log = new Models.Loggy(msLogger);

Expand Down
2 changes: 0 additions & 2 deletions src/Certify.Shared/Utils/DemoDataGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Certify.Models;
using Certify.Models.Shared.Validation;
using Org.BouncyCastle.Tls;

namespace Certify.Shared.Core.Utils
{
Expand Down
2 changes: 1 addition & 1 deletion src/Certify.SourceGenerators/PublicAPISourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public void Initialize(GeneratorInitializationContext context)
// then add a watch on
if (!Debugger.IsAttached)
{
//Debugger.Launch();
//Debugger.Launch();
}
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using Certify.Models;
using Certify.Providers.ACME.Anvil;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Serilog;

namespace Certify.Core.Tests
{
Expand All @@ -35,7 +34,7 @@ public class CertRequestTests : IntegrationTestBase, IDisposable

public CertRequestTests()
{

certifyManager = new CertifyManager();
certifyManager.Init().Wait();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Diagnostics;
using System.Threading.Tasks;
using Certify.Datastore.SQLite;
using Certify.Management;
using Certify.Models.Providers;
using Microsoft.VisualStudio.TestTools.UnitTesting;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Diagnostics;
using System.Threading.Tasks;
using Certify.Datastore.SQLite;
using Certify.Management;
using Certify.Models.Providers;
using Microsoft.VisualStudio.TestTools.UnitTesting;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Diagnostics;
using System.Threading.Tasks;
using Certify.Datastore.SQLite;
using Certify.Management;
using Certify.Models.Providers;
using Microsoft.VisualStudio.TestTools.UnitTesting;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Threading.Tasks;
using Certify.Core.Management.Access;
using Certify.Datastore.SQLite;
using Certify.Management;
using Certify.Models.Config.AccessControl;
using Certify.Providers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Certify.Management.Servers;
using Certify.Models;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Serilog;

namespace Certify.Core.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Certify.Models;
using Certify.Models.Config;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Serilog;

namespace Certify.Core.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Certify.Models.Providers;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Serilog;

namespace Certify.Core.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using Serilog;

namespace Certify.Core.Tests.Unit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Certify.Models;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Serilog;

namespace Certify.Core.Tests.Unit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using Serilog;

namespace Certify.Core.Tests.Unit
{
Expand All @@ -40,7 +39,7 @@ public class CertifyManagerAccountTests
[ClassInitialize]
public static async Task ClassInit(TestContext context)
{

_log = new Loggy(LoggerFactory.Create(builder => builder.AddDebug()).CreateLogger<CertifyManagerAccountTests>());

_caDomain = _isContainer ? "step-ca" : "localhost";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System.Threading.Tasks;
using Certify.Models;
using Certify.Shared.Core.Utils;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Serilog;

namespace Certify.Core.Tests.Unit
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Certify.Shared.Core.Utils;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Serilog;

namespace Certify.Core.Tests.Unit
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Certify.Core.Management.Challenges;
using Certify.Datastore.SQLite;
Expand Down
Loading

0 comments on commit 4994249

Please sign in to comment.