Skip to content

Conversation

@moutonjeremy
Copy link
Member

Introduce authentication and authorization middleware, enhance OpenAPI options, and improve request handling. Add role-based access control examples and configure custom documentation paths.

Jeremy Mouton added 2 commits September 14, 2025 00:46
- 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.
Copy link
Contributor

Copilot AI left a 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.

moutonjeremy and others added 11 commits September 14, 2025 00:55
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>
Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI left a 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.

moutonjeremy and others added 3 commits September 14, 2025 11:25
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
@moutonjeremy moutonjeremy merged commit 38a2857 into main Sep 14, 2025
3 checks passed
@moutonjeremy moutonjeremy deleted the auth-middleware branch September 14, 2025 09:34
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