Skip to content

Introduce unified Rust domain registrar abstraction with provider fallback semantics#1

Draft
Copilot wants to merge 4 commits into
mainfrom
copilot/unified-domain-registrar-library
Draft

Introduce unified Rust domain registrar abstraction with provider fallback semantics#1
Copilot wants to merge 4 commits into
mainfrom
copilot/unified-domain-registrar-library

Conversation

Copy link
Copy Markdown

Copilot AI commented May 26, 2026

This PR establishes a unified domain registrar library so callers can interact with multiple registrar providers through one API. It standardizes availability checks, registration flow, and failure handling across providers.

  • Core API

    • Added DomainRegistrar trait for provider implementations:
      • name()
      • is_domain_available(domain)
      • register_domain(domain, years)
    • Added UnifiedRegistrar as orchestration layer over Vec<Box<dyn DomainRegistrar>>.
  • Unified routing behavior

    • is_domain_available returns true if any provider reports availability.
    • register_domain attempts registration against available providers in order and falls back on provider failure.
    • Returns the selected provider name on successful registration.
  • Error model and guardrails

    • Added explicit domain registration errors:
      • NoRegistrarsConfigured
      • InvalidRegistrationPeriod(u8) (enforces 1..=10)
      • DomainUnavailable
      • ProviderFailure(String)
    • Improved provider-failure propagation to retain useful context across multi-provider attempts.
  • Library docs

    • Updated README to describe the crate as a unified domain registrar library and clarify its role.
let registrar = UnifiedRegistrar::new(vec![
    Box::new(ProviderA::new()),
    Box::new(ProviderB::new()),
]);

if registrar.is_domain_available("example.com")? {
    let provider = registrar.register_domain("example.com", 1)?;
    println!("registered via {}", provider);
}
Original prompt

Unified domain registrar library

Copilot AI changed the title [WIP] Add unified domain registrar library Introduce unified Rust domain registrar abstraction with provider fallback semantics May 26, 2026
Copilot AI requested a review from vsilent May 26, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants