25 lines
888 B
C#
25 lines
888 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using StellaOps.Excititor.Attestation.Dsse;
|
|
using StellaOps.Excititor.Attestation.Transparency;
|
|
using StellaOps.Excititor.Core;
|
|
|
|
namespace StellaOps.Excititor.Attestation.Extensions;
|
|
|
|
public static class VexAttestationServiceCollectionExtensions
|
|
{
|
|
public static IServiceCollection AddVexAttestation(this IServiceCollection services)
|
|
{
|
|
services.AddSingleton<VexDsseBuilder>();
|
|
services.AddSingleton<IVexAttestationClient, VexAttestationClient>();
|
|
return services;
|
|
}
|
|
|
|
public static IServiceCollection AddVexRekorClient(this IServiceCollection services, Action<RekorHttpClientOptions> configure)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(configure);
|
|
services.Configure(configure);
|
|
services.AddHttpClient<ITransparencyLogClient, RekorHttpClient>();
|
|
return services;
|
|
}
|
|
}
|