📄 src/Cli/YouTubeAuth/YouTubeServiceCollectionExtensions.cs
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Slopper.Infrastructure.YouTube;

namespace Slopper.Cli.YouTubeAuth;

public static class YouTubeServiceCollectionExtensions
{
    extension(IServiceCollection services)
    {
        public IServiceCollection AddYouTubeAuth()
        {
            services.AddOptions<YouTubeOptions>().BindConfiguration("YouTube").ValidateOnStart();
            services.AddTransient<IValidateOptions<YouTubeOptions>, YouTubeOptionsValidator>();

            services.AddSingleton<IYouTubeCredentialsProvider, YouTubeCredentialsProvider>();

            return services;
        }
    }
}