merge queue: checking #1806 on main (251e0f0) - #1822
Closed
mergify[bot] wants to merge 2 commits into
Closed
mergify[bot] wants to merge 2 commits into
mergify[bot] wants to merge 2 commits into
Conversation
The three commands that give a machine a Mergify credential, take it away, and say which one it holds. `login` prints a URL and a code and waits. The credential lands in the OS keychain, or in a `0600` file when the machine has none, and the command says which -- a user who has to reason about where their secret is should not have to guess. `logout` revokes server-side before it deletes locally, because the server's copy is the one that matters and a token whose only trace was the file we just deleted can no longer be revoked from here at all. If the revocation fails the local copy still goes: a `logout` that left the credential in place because the network blinked would have done nothing at all. The command says so, and names where to finish the job. `status` asks the API rather than trusting the disk. A token revoked from the dashboard is still on the machine and still carries a year-away expiry, so a `status` that read only the local copy would report a dead credential as live. Three deliberate calls: - **No `--json`.** The surface is exactly `login|logout|status [--api-url URL]`, which is what the docs are being written against right now. - **No browser is opened.** The device grant exists because the CLI runs where there is no browser to open -- over SSH, in a container -- and a command that only works when there is one would be a different feature. - **A deployment without `GET /v1/user` still works.** Self-hosted installs upgrade on their own schedule, so a 404 there means "cannot name the account", not "login failed" -- `login` stores the credential and `status` reports it, both saying what they could not check. `login` revokes the credential it replaces, and the one it minted but could not store. Neither is reachable from this machine afterwards, and both stay live on the server for a year -- leaking one per login walks the user into the twenty-token cap that only the dashboard can clear. When the revocation of the *replaced* one fails, the command says so out loud rather than in a debug line: that token is the leak this block exists to prevent, and the user is the only one who can finish it. The other case stays quiet, since the command is already returning its own error about a token that never reached the store. Two ordering rules, both about a grant the user may have approved: - The store is read **before** the grant is opened, not merely before it is spent. A corrupt `credentials.json` read afterwards kills the command with the approval page already on screen, and whatever the user approves there mints a token nothing stores and nothing revokes. `authorize` needs no store, so this costs nothing. - `logout`'s no-credential branch still asks the store to forget, and now reports what a *refused* answer there means. A keychain can deny a read and still delete -- macOS deletes an item whose read ACL it refuses, since deleting needs no decrypt -- so a credential can be removed without ever being read, which is a token this command could not ask the server to revoke. The error names the dashboard. `auth status` exits 8 when there is no usable credential, which is the code every Mergify command has always returned for that condition. The published description of that code said "configuration file", which was never true of a missing token; it now says configuration *or* credentials. The credential is stored but nothing else reads it yet; the next commit puts it in the resolution chain. No message here claims otherwise. Fixes MRGFY-8703 Change-Id: Ib0b7d16696fa41fc733f2d0fa6ef34246ad8eeb9
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎉 This pull request has been checked successfully and will be merged soon. 🎉
#1806 is queued for merge on branch main (251e0f0).
This pull request has been created by Mergify to check the mergeability of #1806.
You don't need to do anything. Mergify will close this pull request automatically when it is complete.
Required conditions of queue rule
defaultfor merge:github-review-approved[🛡 GitHub branch protection]github-review-approved[🛡 GitHub repository ruleset ruleRequire pull request for default branch]Enforce conventional commit]:title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:👀 Review Requirements]:#approved-reviews-by>=2author = dependabot[bot]author = mergify-ci-botauthor = renovate[bot]📕 PR description]:body ~= (?ms:.{48,})🔎 Reviews]:#changes-requested-reviews-by = 0#review-requested = 0#review-threads-unresolved = 0🤖 Continuous Integration]:check-success=ci-gateRequired conditions to stay in the queue:
base=maingithub-review-approved[🛡 GitHub branch protection]github-review-approved[🛡 GitHub repository ruleset ruleRequire pull request for default branch]label!=manual mergeEnforce conventional commit]:title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:👀 Review Requirements]:#approved-reviews-by>=2author = dependabot[bot]author = mergify-ci-botauthor = renovate[bot]📕 PR description]:body ~= (?ms:.{48,})🔎 Reviews]:#changes-requested-reviews-by = 0#review-requested = 0#review-threads-unresolved = 0🤖 Continuous Integration]:check-success=ci-gate