-
Notifications
You must be signed in to change notification settings - Fork 34
Swagger changes #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swagger changes #69
Conversation
WalkthroughThis update introduces configuration toggles for enabling or disabling Springdoc OpenAPI documentation and Swagger UI using environment variables in the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant JwtUserIdValidationFilter
participant API (Swagger UI / Docs)
participant Application
Client->>JwtUserIdValidationFilter: HTTP Request (e.g., /swagger-ui, /v3/api-docs, /user/refreshToken)
JwtUserIdValidationFilter-->>API (Swagger UI / Docs): Skips JWT validation for excluded paths
API (Swagger UI / Docs)-->>Client: Returns documentation or refresh token response
Client->>JwtUserIdValidationFilter: HTTP Request (other endpoints)
JwtUserIdValidationFilter->>Application: Performs JWT validation
Application-->>Client: Returns application response
Suggested reviewers
Poem
β¨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
π§Ή Nitpick comments (1)
src/main/java/com/iemr/tm/utils/JwtUserIdValidationFilter.java (1)
58-60: LGTM! Appropriate exclusions added for Swagger and token refresh endpoints.The filter now correctly excludes Swagger UI, API documentation endpoints, and token refresh endpoint from JWT validation. This allows access to documentation without authentication and supports the token refresh workflow.
Consider adding a comment explaining the purpose of these exclusions:
// Skip login and public endpoints if (path.equals(contextPath + "/user/userAuthenticate") || path.equalsIgnoreCase(contextPath + "/user/logOutUserFromConcurrentSession") + // Skip Swagger UI, API docs, and token refresh endpoints from JWT validation || path.startsWith(contextPath + "/swagger-ui") || path.startsWith(contextPath + "/v3/api-docs") || path.startsWith(contextPath + "/user/refreshToken") || path.startsWith(contextPath + "/public")) {
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (2)
src/main/environment/common_ci.properties(1 hunks)src/main/java/com/iemr/tm/utils/JwtUserIdValidationFilter.java(1 hunks)
β° Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (java)
π Additional comments (1)
src/main/environment/common_ci.properties (1)
76-78: LGTM! Properties added to control Swagger documentation visibility.The addition of these configuration properties allows toggling Springdoc OpenAPI documentation and Swagger UI through the environment variable
SWAGGER_DOC_ENABLED. This is a good practice for controlling API documentation visibility across different environments.



π Description
JIRA ID: AMM-1186
Please provide a summary of the change and the motivation behind it. Include relevant context and details.
β Type of Change
βΉοΈ Additional Information
Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.
Summary by CodeRabbit
New Features
Bug Fixes