Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
27 lines
944 B
C#
27 lines
944 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using StellaOps.Scanner.Analyzers.OS.Abstractions;
|
|
using StellaOps.Scanner.Analyzers.OS.Plugin;
|
|
|
|
namespace StellaOps.Scanner.Analyzers.OS.Homebrew;
|
|
|
|
/// <summary>
|
|
/// Plugin that registers the Homebrew package analyzer for macOS Cellar discovery.
|
|
/// </summary>
|
|
public sealed class HomebrewAnalyzerPlugin : IOSAnalyzerPlugin
|
|
{
|
|
/// <inheritdoc />
|
|
public string Name => "StellaOps.Scanner.Analyzers.OS.Homebrew";
|
|
|
|
/// <inheritdoc />
|
|
public bool IsAvailable(IServiceProvider services) => services is not null;
|
|
|
|
/// <inheritdoc />
|
|
public IOSPackageAnalyzer CreateAnalyzer(IServiceProvider services)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(services);
|
|
var loggerFactory = services.GetRequiredService<ILoggerFactory>();
|
|
return new HomebrewPackageAnalyzer(loggerFactory.CreateLogger<HomebrewPackageAnalyzer>());
|
|
}
|
|
}
|