feat: Add GET /me endpoint for current user profile#7
Merged
Conversation
Add new API endpoint that returns the authenticated user's profile information based on the username extracted from JWT token. Changes: - Add GetCurrentUser handler in handler.go - Add CurrentUserResponse DTO with ISO 8601 timestamps - Register GET /me route with JWT authentication - Update CDK stack to include /me API Gateway resource - Add comprehensive handler tests with 100% coverage Tests: - TestHandler_GetCurrentUser: Success, invalid claims, user not found - TestHandler_GetCurrentUser_TimestampFormat: ISO 8601/RFC3339 validation - TestHandler_GetCurrentUser_DoesNotExposePassword: Security verification Security: - Password hash is never exposed in response - Only returns safe fields: username, name, created_at, updated_at 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Summary
Adds a new
GET /meAPI endpoint that returns the authenticated user's profile information based on the username extracted from the JWT token.Changes
API Handler
GetCurrentUserincmd/app/internal/handler/handler.goDTO
CurrentUserResponseincmd/app/internal/dto/dto.gousername,name,created_at,updated_atRouting
cmd/app/main.goGET /meInfrastructure
deployments/app/cdk.go/meAPI Gateway resourceTesting
Created comprehensive test suite in
cmd/app/internal/handler/handler_test.go:Test Coverage
TestHandler_GetCurrentUserTestHandler_GetCurrentUser_TimestampFormatTestHandler_GetCurrentUser_DoesNotExposePasswordTest Results
All existing tests continue to pass ✅
API Usage
Request
Response (200 OK)
{ "username": "john_doe", "name": "John Doe", "created_at": "2025-12-07T10:30:00Z", "updated_at": "2025-12-07T10:30:00Z" }Error Responses
Security
Breaking Changes
None. This is a purely additive change.
Checklist
🤖 Generated with Claude Code