using ClaudeDo.Worker.Online.Interfaces;

namespace ClaudeDo.Worker.Online;

/// <summary>
/// Simple <see cref="IOnlineAuthProvider"/> that returns a fixed token supplied at construction.
/// Used as the default DI registration until <c>ZitadelAuthProvider</c> is wired (Phase 2).
/// Also serves as the test double.
/// </summary>
public sealed class StaticTokenAuthProvider : IOnlineAuthProvider
{
    private readonly string? _token;

    public StaticTokenAuthProvider(string? token = null)
    {
        _token = token;
    }

    public Task<string?> GetAccessTokenAsync(CancellationToken ct = default)
        => Task.FromResult(_token);

    public Task<string?> GetAccessTokenAsync(bool forceRefresh, CancellationToken ct = default)
        => Task.FromResult(_token);
}
