Skip to content

feat(auth): add auth login --device-name to override the hostname - #1887

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/sileht/mrgfy-9268-auth-login-device-name/add-auth-login-device-name-override-hostname--f4f97700
Oct 6, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
devs/sileht/mrgfy-9268-auth-login-device-name/add-auth-login-device-name-override-hostname--f4f97700

Conversation

@sileht

@sileht sileht commented Oct 5, 2026

Copy link
Copy Markdown
Member

mergify auth login sends the machine's hostname as device_name so the
approval page can default the token name to this machine. Hostnames often
carry a person's name, and POST /v1/oauth/device/code is unauthenticated:
the value sits on the pending grant server-side before anyone approves, so
editing the field on the page does not un-send it. It is also a poor label
for someone with several machines on one account.

--device-name NAME replaces the detected hostname and is sent as typed;
the server caps and sanitizes it. A blank value (--device-name=, which
also survives Windows PowerShell 5.1 dropping a "" argument) sends no
name at all, the same request a machine that cannot name itself already
makes, and the server keeps its own default label. Without the flag
nothing changes.

Fixes MRGFY-9268

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

`mergify auth login` sends the machine's hostname as `device_name` so the
approval page can default the token name to this machine. Hostnames often
carry a person's name, and `POST /v1/oauth/device/code` is unauthenticated:
the value sits on the pending grant server-side before anyone approves, so
editing the field on the page does not un-send it. It is also a poor label
for someone with several machines on one account.

`--device-name NAME` replaces the detected hostname and is sent as typed;
the server caps and sanitizes it. A blank value (`--device-name=`, which
also survives Windows PowerShell 5.1 dropping a `""` argument) sends no
name at all, the same request a machine that cannot name itself already
makes, and the server keeps its own default label. Without the flag
nothing changes.

Fixes MRGFY-9268

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Change-Id: If4f977008ded4d2acd0cb1ce5492c60c3f4df4e3
Copilot AI balanced review requested due to automatic review settings October 5, 2026 16:07
@mergify

mergify Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 6 merge protections satisfied — ready to merge.

Show 6 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 🔎 Reviews

  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@mergify
mergify Bot deployed to Mergify Merge Protections October 5, 2026 16:07 Active

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused change preserves default behavior, covers override and opt-out cases, and has no identified blocking issues.

Review effort: Balanced
Findings: None

What changed in this PR

Adds auth login --device-name so users can replace the hostname sent during device authorization or omit it for privacy.

Changes:

  • Wires the option through CLI dispatch and login, preserving hostname detection when omitted.
  • Adds override and blank-value tests, updates help snapshots, and documents usage.
File Description
README.md Documents custom names and hostname opt-out.
crates/​mergify-cli/​src/​snapshots/​mergify__tests__cli_schema_golden.snap Records the new option’s CLI schema.
crates/​mergify-cli/​src/​main.rs Parses, dispatches, and tests the option.
crates/​mergify-auth/​src/​login.rs Applies the override or omission and tests request bodies.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sileht
sileht deployed to func-tests-live October 5, 2026 16:09 — with GitHub Actions Active
@mergify
mergify Bot requested a review from a team October 5, 2026 16:16
@sileht
sileht marked this pull request as ready for review October 6, 2026 07:30
@mergify
mergify Bot requested a review from a team October 6, 2026 07:39
@mergify

mergify Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 8 minutes 25 seconds in the queue, including 8 minutes 6 seconds running CI.

Required conditions to merge

@mergify mergify Bot mentioned this pull request Oct 6, 2026
34 of 40 tasks
@mergify mergify Bot added the queued label Oct 6, 2026
@mergify
mergify Bot merged commit 03ccd8b into main Oct 6, 2026
24 checks passed
@mergify
mergify Bot deleted the devs/sileht/mrgfy-9268-auth-login-device-name/add-auth-login-device-name-override-hostname--f4f97700 branch October 6, 2026 07:53
@mergify mergify Bot removed the queued label Oct 6, 2026

This branch was successfully deployed

2 active deployments
func-tests-live — 7e3ded68 Deployed Oct 5, 2026 by sileht via live-tests #1981
Mergify Merge Protections — 7e3ded68 Deployed Oct 5, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants