-
Notifications
You must be signed in to change notification settings - Fork 5
Swagger: Add token authentication to article, profile, and user endpoints #145
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
Conversation
- Implemented token authentication for create, update, delete, and fetch operations in articles, profiles, and users. - Updated API documentation to reflect the new security requirements for these endpoints.
WalkthroughThe pull request removes a global security configuration block from the Swagger documentation setup in the application module and adds explicit security properties to the API endpoint configurations in the articles, profiles, and users plugins. In each of these plugins, the endpoints now include a Changes
Assessment against linked issues
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 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/articles/articles.plugin.ts (1)
75-80: Fix typo in endpoint summaryThere's a typo in the endpoint summary - "Artifle Feed" should be "Article Feed".
- summary: 'Artifle Feed', + summary: 'Article Feed',
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/app.module.ts(0 hunks)src/articles/articles.plugin.ts(4 hunks)src/profiles/profiles.plugin.ts(3 hunks)src/users/users.plugin.ts(2 hunks)
💤 Files with no reviewable changes (1)
- src/app.module.ts
🔇 Additional comments (8)
src/users/users.plugin.ts (2)
58-62: Well implemented security configuration for the Current User endpointThe addition of the
securityproperty withtokenAuthto the API documentation aligns well with the endpoint's existing authentication throughrequireLogin. This enhances the documentation to accurately reflect that token authentication is required.
79-83: Well implemented security configuration for the Update User endpointThe security property addition here matches the existing authentication middleware, properly documenting the token authentication requirement in the API documentation.
src/profiles/profiles.plugin.ts (3)
26-30: Proper security documentation for Profile endpointThe added security configuration correctly reflects the authentication requirement already implemented through the
requireLoginmiddleware.
46-50: Proper security documentation for Follow Profile endpointThe security property matches the existing authentication check, ensuring API documentation accurately represents token requirements.
67-71: Proper security documentation for Unfollow Profile endpointThe security configuration appropriately documents the authentication requirement consistent with the
requireLoginmiddleware.src/articles/articles.plugin.ts (3)
52-56: Well-implemented security for Create Article endpointThe addition of the security property with tokenAuth aligns with the existing beforeHandle authentication requirement.
109-113: Proper security documentation for Update Article endpointThe security property addition matches the existing authentication requirements.
129-133: Well-documented security for Delete Article endpointThe security configuration appropriately reflects the token authentication requirement.
We can definitely try grouping, I'm not sure how it would look like 🤔 But manually adding them also doesn't seem that painful, the security details can be extracted into a constant that we just use in each place to avoid writing a lot of duplicated code I'm thinking something simple like this: |
|
Great points. Continued in #147 |


Description
Implemented OpenAPI (swagger) token authentication for create, update, delete, and fetch operations in articles, profiles, and users.
Closes #131
PR Checklist
bun docsSummary by CodeRabbit