Skip to content

feat: Add authentication provider registry for multi-platform support (GitHub + Azure DevOps) #2335

@mnriem

Description

@mnriem

Problem

Authentication is currently handled inline in _fetch_latest_release_tag() with hardcoded GH_TOKEN/GITHUB_TOKEN env var lookups and GitHub-specific Bearer token headers. As we add Azure DevOps support (and potentially GitLab, Bitbucket), this approach won't scale without scattering provider-specific logic across the codebase.

Proposal

After #2331 lands, create src/specify_cli/authentication/ as a self-contained subdirectory with a provider registry, following the same pattern as src/specify_cli/integrations/:

src/specify_cli/authentication/
├── __init__.py          # AUTH_REGISTRY + register_builtins()
├── base.py              # AuthProvider ABC
├── github.py            # GitHubAuth provider
└── azure_devops.py      # AzureDevOpsAuth provider

AuthProvider base class exposes:

  • key — provider identifier (e.g., "github", "azure-devops")
  • get_token() -> str | None — resolve credentials from env vars / config
  • auth_headers() -> dict — provider-specific auth headers
  • api_base_url() -> str — API endpoint root
  • is_configured() -> bool — whether credentials are available

Scope

Benefits

  • Follows existing registry pattern (integrations/)
  • Extensible for GitLab, Bitbucket, etc. without touching core CLI
  • Testable in isolation

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions