-
Notifications
You must be signed in to change notification settings - Fork 0
Implement authentication and authorization middleware with OpenAPI support #9
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
…I options, and improve request handling
- Implemented ExampleAuthService for token validation and role management. - Created routes for user management and document access with role and scope checks. - Added OpenAPI documentation support for the authentication example. - Introduced a simple example demonstrating basic CRUD operations with validation. - Configured custom OpenAPI documentation paths and enabled validation for requests.
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.
Pull Request Overview
Implements authentication and authorization middleware for fiber-oapi with OpenAPI security documentation support. Adds role-based access control, JWT/Bearer token authentication, and enhances request handling for complex data types.
Key changes:
- Added authentication service interface and middleware system
- Enhanced OpenAPI spec generation with security schemes and permissions
- Improved type handling for maps and interfaces in schema generation
Reviewed Changes
Copilot reviewed 10 out of 13 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| types.go | Adds authentication config fields and security metadata to OpenAPI options |
| group.go | Adds Use method for middleware support in groups |
| fiberoapi.go | Enhances config merging, OpenAPI security generation, and type schema handling |
| conditional_auth.go | Implements conditional authentication middleware with path exclusions |
| common.go | Updates request parsing with authorization validation and improved error handling |
| auth_helpers.go | Provides helper functions for defining secured routes with permissions |
| auth.go | Core authentication and authorization implementation with JWT support |
| _examples/simple/go.mod | Example module configuration |
| _examples/auth/main.go | Complete authentication example with role-based access control |
| _examples/auth/go.mod | Authentication example module configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull Request Overview
Copilot reviewed 10 out of 13 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Pull Request Overview
Copilot reviewed 14 out of 17 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
fiberoapi.go:1
- The comment contains French text 'Type de ressource concernée'. Consider using English for consistency: 'Type of concerned resource' or 'Resource type concerned'.
package fiberoapi
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ng JWT support and role-based access control examples
Introduce authentication and authorization middleware, enhance OpenAPI options, and improve request handling. Add role-based access control examples and configure custom documentation paths.