Skip to content

feat(me): move /me to users tag with getMe() operationId#724

Merged
rickyrombo merged 4 commits intomainfrom
mjp-oauth-me-user
Mar 17, 2026
Merged

feat(me): move /me to users tag with getMe() operationId#724
rickyrombo merged 4 commits intomainfrom
mjp-oauth-me-user

Conversation

@rickyrombo
Copy link
Contributor

@rickyrombo rickyrombo commented Mar 17, 2026

Summary

  • Changes /me endpoint tag from oauth to users so it groups with other user endpoints in the generated client
  • Updates operationId to Get Me so the OpenAPI generator produces usersApi.getMe()

Test plan

  • Swagger UI shows /me under the users tag
  • Generated client exposes usersApi.getMe()

🤖 Generated with Claude Code

Replaces the hand-rolled JWT-style response (userId, name, handle,
verified, sub, iat) with the standard User struct via the existing
v1UserResponse helper, matching every other user endpoint.

Adds /oauth/me as a documented path in swagger-v1.yaml under a new
oauth tag, referencing the existing user_response_single schema.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hape

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
application/json:
schema:
$ref: "#/components/schemas/transaction_history_count_response"
/oauth/me:
Copy link
Member

Choose a reason for hiding this comment

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

for my own education, why is there a specific /oauth/me route instead of a general /me route that just takes any form of auth and gets an authenticated user?

I guess bearer/api key auth doesn't really mean one user, but username + pw and private key auth do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do like v1/users/me or something better... now is the time to change it if we want... I can consult the AI on standards/expectations. Initially I think the pattern matching was most auth providers have a .getUser() call on their sdks, so it was appealing to that, but I think the endpoint itself can go wherever. Also agree any auth should do, idk why it manually grabbed user id like this here

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no v1?

Copy link
Member

Choose a reason for hiding this comment

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

oh yes i think /v1/me or /v1/users/me, just not oauth i mean

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the OAuth “who am I” endpoint to return the same { data: ... } response envelope used across the v1 API, and adds the endpoint to the v1 Swagger spec so it shows up in API docs under a dedicated oauth tag.

Changes:

  • Change /v1/oauth/me to return { data: User } instead of a custom JWT-claims-shaped object.
  • Add /oauth/me to swagger-v1.yaml with OAuth2 read security and user_response_single response schema.
  • Introduce a new oauth tag in Swagger for OAuth-related operations.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
api/v1_oauth.go Switch /oauth/me JSON response to the standard { data: User } envelope.
api/swagger/swagger-v1.yaml Document /oauth/me endpoint and add the oauth tag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

rickyrombo and others added 2 commits March 17, 2026 13:58
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Moves the endpoint to /v1/me and extracts it into its own file (v1_me.go).
The new handler uses the auth context already resolved by authMiddleware
(PKCE token, wallet signature, JWT, or API key) rather than requiring
a Bearer OAuth token specifically. Resolves userId from myId locals (set
for PKCE) or falls back to wallet→userId lookup for other auth methods.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rickyrombo rickyrombo merged commit f559dd1 into main Mar 17, 2026
5 checks passed
@rickyrombo rickyrombo deleted the mjp-oauth-me-user branch March 17, 2026 23:22
@rickyrombo rickyrombo changed the title feat(oauth): return standard User from /oauth/me, document in swagger feat(me): move /me to users tag with getMe() operationId Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants