Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
- Implement unit tests for RichGraphPublisher to verify graph publishing to CAS. - Implement unit tests for RichGraphWriter to ensure correct writing of canonical graphs and metadata. feat: Implement AOC Guard validation logic - Add AOC Guard validation logic to enforce document structure and field constraints. - Introduce violation codes for various validation errors. - Implement tests for AOC Guard to validate expected behavior. feat: Create Console Status API client and service - Implement ConsoleStatusClient for fetching console status and streaming run events. - Create ConsoleStatusService to manage console status polling and event subscriptions. - Add tests for ConsoleStatusClient to verify API interactions. feat: Develop Console Status component - Create ConsoleStatusComponent for displaying console status and run events. - Implement UI for showing status metrics and handling user interactions. - Add styles for console status display. test: Add tests for Console Status store - Implement tests for ConsoleStatusStore to verify event handling and state management.
78 lines
3.8 KiB
C#
78 lines
3.8 KiB
C#
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using StellaOps.Concelier.Storage.Postgres.Repositories;
|
|
using StellaOps.Infrastructure.Postgres;
|
|
using StellaOps.Infrastructure.Postgres.Options;
|
|
|
|
namespace StellaOps.Concelier.Storage.Postgres;
|
|
|
|
/// <summary>
|
|
/// Extension methods for configuring Concelier PostgreSQL storage services.
|
|
/// </summary>
|
|
public static class ServiceCollectionExtensions
|
|
{
|
|
/// <summary>
|
|
/// Adds Concelier PostgreSQL storage services.
|
|
/// </summary>
|
|
/// <param name="services">Service collection.</param>
|
|
/// <param name="configuration">Configuration root.</param>
|
|
/// <param name="sectionName">Configuration section name for PostgreSQL options.</param>
|
|
/// <returns>Service collection for chaining.</returns>
|
|
public static IServiceCollection AddConcelierPostgresStorage(
|
|
this IServiceCollection services,
|
|
IConfiguration configuration,
|
|
string sectionName = "Postgres:Concelier")
|
|
{
|
|
services.Configure<PostgresOptions>(sectionName, configuration.GetSection(sectionName));
|
|
services.AddSingleton<ConcelierDataSource>();
|
|
|
|
// Register repositories
|
|
services.AddScoped<IAdvisoryRepository, AdvisoryRepository>();
|
|
services.AddScoped<ISourceRepository, SourceRepository>();
|
|
services.AddScoped<IAdvisoryAliasRepository, AdvisoryAliasRepository>();
|
|
services.AddScoped<IAdvisoryCvssRepository, AdvisoryCvssRepository>();
|
|
services.AddScoped<IAdvisoryAffectedRepository, AdvisoryAffectedRepository>();
|
|
services.AddScoped<IAdvisoryReferenceRepository, AdvisoryReferenceRepository>();
|
|
services.AddScoped<IAdvisoryCreditRepository, AdvisoryCreditRepository>();
|
|
services.AddScoped<IAdvisoryWeaknessRepository, AdvisoryWeaknessRepository>();
|
|
services.AddScoped<IKevFlagRepository, KevFlagRepository>();
|
|
services.AddScoped<ISourceStateRepository, SourceStateRepository>();
|
|
services.AddScoped<IFeedSnapshotRepository, FeedSnapshotRepository>();
|
|
services.AddScoped<IAdvisorySnapshotRepository, AdvisorySnapshotRepository>();
|
|
services.AddScoped<IMergeEventRepository, MergeEventRepository>();
|
|
|
|
return services;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Adds Concelier PostgreSQL storage services with explicit options.
|
|
/// </summary>
|
|
/// <param name="services">Service collection.</param>
|
|
/// <param name="configureOptions">Options configuration action.</param>
|
|
/// <returns>Service collection for chaining.</returns>
|
|
public static IServiceCollection AddConcelierPostgresStorage(
|
|
this IServiceCollection services,
|
|
Action<PostgresOptions> configureOptions)
|
|
{
|
|
services.Configure(configureOptions);
|
|
services.AddSingleton<ConcelierDataSource>();
|
|
|
|
// Register repositories
|
|
services.AddScoped<IAdvisoryRepository, AdvisoryRepository>();
|
|
services.AddScoped<ISourceRepository, SourceRepository>();
|
|
services.AddScoped<IAdvisoryAliasRepository, AdvisoryAliasRepository>();
|
|
services.AddScoped<IAdvisoryCvssRepository, AdvisoryCvssRepository>();
|
|
services.AddScoped<IAdvisoryAffectedRepository, AdvisoryAffectedRepository>();
|
|
services.AddScoped<IAdvisoryReferenceRepository, AdvisoryReferenceRepository>();
|
|
services.AddScoped<IAdvisoryCreditRepository, AdvisoryCreditRepository>();
|
|
services.AddScoped<IAdvisoryWeaknessRepository, AdvisoryWeaknessRepository>();
|
|
services.AddScoped<IKevFlagRepository, KevFlagRepository>();
|
|
services.AddScoped<ISourceStateRepository, SourceStateRepository>();
|
|
services.AddScoped<IFeedSnapshotRepository, FeedSnapshotRepository>();
|
|
services.AddScoped<IAdvisorySnapshotRepository, AdvisorySnapshotRepository>();
|
|
services.AddScoped<IMergeEventRepository, MergeEventRepository>();
|
|
|
|
return services;
|
|
}
|
|
}
|