feat(me): move /me to users tag with getMe() operationId#724
feat(me): move /me to users tag with getMe() operationId#724rickyrombo merged 4 commits intomainfrom
Conversation
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>
api/swagger/swagger-v1.yaml
Outdated
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/transaction_history_count_response" | ||
| /oauth/me: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
I think /me is fairly standard, i think we should do it
There was a problem hiding this comment.
oh yes i think /v1/me or /v1/users/me, just not oauth i mean
There was a problem hiding this comment.
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/meto return{ data: User }instead of a custom JWT-claims-shaped object. - Add
/oauth/metoswagger-v1.yamlwith OAuth2readsecurity anduser_response_singleresponse schema. - Introduce a new
oauthtag 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.
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>
Summary
/meendpoint tag fromoauthtousersso it groups with other user endpoints in the generated clientoperationIdtoGet Meso the OpenAPI generator producesusersApi.getMe()Test plan
/meunder theuserstagusersApi.getMe()🤖 Generated with Claude Code