-
Notifications
You must be signed in to change notification settings - Fork 25
swagger changes #43
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 #43
Conversation
WalkthroughThis update introduces new configuration properties to enable or disable Swagger API documentation features via environment variables. Additionally, it expands the exclusion logic in both the JWT validation filter and the HTTP request interceptor to allow Swagger-related endpoints and other specific paths to bypass authentication and authorization checks. No changes were made to public APIs or method signatures; all modifications are limited to configuration files and internal control logic for request filtering. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant JWTValidationFilter
participant HTTPRequestInterceptor
participant Application
Client->>JWTValidationFilter: Sends HTTP request
alt Path is excluded (Swagger, public, refreshToken, etc.)
JWTValidationFilter->>HTTPRequestInterceptor: Forward request
else
JWTValidationFilter->>JWTValidationFilter: Validate JWT
JWTValidationFilter->>HTTPRequestInterceptor: Forward if valid
end
HTTPRequestInterceptor->>Application: Forward request (if endpoint is allowed)
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/helpline104/utils/http/HTTPRequestInterceptor.java (1)
73-73: Complete inclusion of Swagger UI resources in authorization bypass list.The interceptor now correctly bypasses authorization checks for all required Swagger UI resources, which complements the JWT filter changes and ensures proper functioning of the API documentation interface.
Consider aligning the pattern matching approach between this interceptor and the JwtUserIdValidationFilter for consistency. The filter uses full path matching while this interceptor relies on the last URI segment.
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (3)
src/main/environment/104_ci.properties(1 hunks)src/main/java/com/iemr/helpline104/utils/JwtUserIdValidationFilter.java(1 hunks)src/main/java/com/iemr/helpline104/utils/http/HTTPRequestInterceptor.java(1 hunks)
β° Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (java)
π Additional comments (2)
src/main/environment/104_ci.properties (1)
23-24: Good addition of Swagger configuration properties.The addition of these Swagger configuration properties allows for environment-specific control of API documentation accessibility, which is a security best practice.
src/main/java/com/iemr/helpline104/utils/JwtUserIdValidationFilter.java (1)
59-63: Appropriate extension of JWT validation bypass for Swagger endpoints.The JWT validation filter has been correctly updated to bypass validation for Swagger UI and API documentation endpoints, which is necessary for these endpoints to be accessible for API exploration. Including the refresh token endpoint is also appropriate for token renewal functionality.



π Description
JIRA ID:
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