auth: make interactive login origin-aware, and warn on a forge mismatch #701

Open
opened 2026-10-03 18:29:10 +00:00 by hexajon · 0 comments
Owner

Why

I want interactive login to notice when the repo's origin lives on a different
forge from the one in madtea's config. Call that one the configured forge.

What I want

  • Interactive madtea auth login compares 2 hosts: the host of the configured
    forge, and the host of the repo's origin.
  • The comparison ignores letter case.
  • The comparison ignores a trailing :22.
  • When the hosts differ, login prints a warning.
  • When the hosts differ, login offers 4 options:
    1. Add credentials for the origin forge. If that forge already has a token,
      the option updates it. This option is the default.
    2. Re-authenticate the configured forge.
    3. Log in to a different forge, by URL.
    4. Cancel.
  • When the hosts match, the login menu does not change.
  • When the repo has no origin, the login menu does not change.
  • The comparison never changes the key under which credentials are stored.

Acceptance

  • Each case above has a test.
## Why I want interactive login to notice when the repo's origin lives on a different forge from the one in madtea's config. Call that one the configured forge. ## What I want - Interactive `madtea auth login` compares 2 hosts: the host of the configured forge, and the host of the repo's origin. - The comparison ignores letter case. - The comparison ignores a trailing `:22`. - When the hosts differ, login prints a warning. - When the hosts differ, login offers 4 options: 1. Add credentials for the origin forge. If that forge already has a token, the option updates it. This option is the default. 2. Re-authenticate the configured forge. 3. Log in to a different forge, by URL. 4. Cancel. - When the hosts match, the login menu does not change. - When the repo has no origin, the login menu does not change. - The comparison never changes the key under which credentials are stored. ## Acceptance - Each case above has a test.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea#701
No description provided.