Repository navigation
feat(cli): sign in with telemetry.dev's client id metadata document - #119
Merged
Merged
Conversation
Merged
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.
telemetry loginregisters a new OAuth client on each machine, so telemetry.dev's consent page warns that the app isn't verified. telemetry.dev now serves a client ID metadata document for the CLI (telemetry-dev/telemetry.dev#548). On an https deployment that serves the document, the CLI uses its URL,https://telemetry.dev/oauth/cli.json, as its client_id. The consent page then names telemetry.dev as the app's publisher.Before it switches,
loginfetches the document and checks that itsclient_idis that URL. A deployment that doesn't serve the document keeps the client the CLI registered, so this can be released before or after #548 deploys. That covers production today, where the document is still a 404, and self-hosted deployments. Once the document is served, the nexttelemetry logindrops a client the CLI registered earlier.A sign-in started with
--no-browserand no terminal saves the client it started with along with the pending sign-in, and--finishcompletes it with that client. The saved client stays paired with the current tokens until the new sign-in finishes. A command that picks up tokens another command saved also takes up the client they were issued to, so a refresh never pairs one client's token with another client's ID.All CLI installs now share one client ID. telemetry.dev's refresh token reuse detection revokes every token a client holds for a person, so a detected reuse now signs that person out of the CLI on every machine, not only the one that reused the token. Claude and ChatGPT connections already work this way.
The tests' server runs over http, and the MCP client only accepts an https document URL, so the document path isn't covered by the tests. Against production, a sign-in started with a saved registered client kept that client while the document was a 404.
Part of telemetry-dev/telemetry.dev#547.