Repository navigation
Show the signed-in user in whoami from /v1/me - #189
Merged
Merged
Conversation
whoami now reads the user of a sign-in from the body of GET /v1/me as received (data.user), not from the generated type, because the vendored API document does not describe the field yet. It is read leniently: a missing field, null or a malformed value is no user, never an error. The User line and the --json user string keep their name and type. They are filled from the API first, formatted as Name <email>, and the authorization server's userinfo endpoint is only asked when the API gives no user. For a key the field is ignored. Every string is cleaned before it is printed. No extra request is made, and nothing changes in the output until the API returns the field. Closes #182 Signed-off-by: d0ubl3g <48954024+d0ubl3g@users.noreply.github.com>
Gorka Gonzalo (d0ubl3g)
marked this pull request as ready for review
October 15, 2026 17:05
This was referenced Oct 15, 2026
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.
whoamireads the signed-in user fromdata.userofGET /v1/me, taken from the body as received because the vendored API document (2026-10-19) does not describe the field yet. A missing field,nullor a malformed value is no user and never an error.Userline and--jsonuserkeep their name and type (a string):Name <email>, from the API first, then the userinfo endpoint as the fallback, as before.userin the answer is ignored.This waits for the API to return
userinGET /v1/mefor sign-ins. It is safe to merge before: until then the output is unchanged.Tests: unit tests with a user (including an escape sequence), no field,
null, malformed values, the userinfo fallback and a key; a contract test that a key ignores a user in the answer.Closes #182