Skip to content

Add OpenAPI support and enhance JWT error handling#7

Merged
jeyongsong merged 4 commits intomainfrom
swagger-api
Feb 5, 2026
Merged

Add OpenAPI support and enhance JWT error handling#7
jeyongsong merged 4 commits intomainfrom
swagger-api

Conversation

@subsub97
Copy link
Collaborator

@subsub97 subsub97 commented Feb 4, 2026

This pull request introduces improvements to authentication error handling, updates environment variable usage for deployment, and adds Swagger API documentation configuration. The main changes enhance JWT token validation, provide more specific error responses, and improve developer experience with API docs.

Authentication & Error Handling Improvements:

  • Refactored JwtAuthenticationFilter to handle expired JWT tokens explicitly, returning an EXPIRED_TOKEN error code and message when a token is expired, and using a generic unauthorized error for other failures. The filter now catches ExpiredJwtException and distinguishes between missing, invalid, and expired tokens.
  • Added new error code EXPIRED_TOKEN to the ErrorCode enum, replacing the previous OIDC_PROVIDER_ERROR. This allows for clearer error messaging when tokens expire.
  • Expanded the list of excluded paths in JwtAuthenticationFilter to allow unauthenticated access to Swagger and API documentation endpoints, improving developer access to docs.

API Documentation:

  • Added a new SwaggerConfig class to configure OpenAPI/Swagger documentation, including JWT bearer authentication setup and ignoring the AuthenticatedMember annotation for documentation generation.

Deployment Configuration:

  • Updated the Docker deployment workflow to use the SPRING_PROFILES_ACTIVE environment variable instead of PROFILE for specifying the active Spring profile, aligning with Spring Boot conventions. (.github/workflows/prod-deploy.yml)

Submodule Update:

  • Updated the moa-secret submodule to a new commit, potentially updating secrets or configuration for the project.

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

Test Results

8 tests   8 ✅  0s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 72932d5.

♻️ This comment has been updated with latest results.

request.setAttribute(AuthConstants.CURRENT_MEMBER_ID, memberId)
filterChain.doFilter(request, response)
} catch (ex: ExpiredJwtException) {
writeErrorResponse(response, ErrorCode.EXPIRED_TOKEN)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이것저것 추가하려다가 당장 필요할 거 같은 것만 추가해뒀어

Copy link
Member

@jeyongsong jeyongsong left a comment

Choose a reason for hiding this comment

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

구우웃

@jeyongsong jeyongsong merged commit 27d1648 into main Feb 5, 2026
2 checks passed
@jeyongsong jeyongsong deleted the swagger-api branch February 5, 2026 14:56
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.

2 participants