Skip to content

Conversation

chlins
Copy link
Member

@chlins chlins commented May 15, 2025

This pull request refactors the routing logic for the /configs API endpoints in manager/router/router.go to simplify middleware handling. The most important change consolidates the jwt.MiddlewareFunc() and rbac middleware into the group definition, reducing redundancy in individual route declarations.

Routing refactor:

  • Consolidated jwt.MiddlewareFunc() and rbac middleware into the group definition for /configs API endpoints, simplifying the route definitions. Individual routes no longer explicitly include these middleware calls. ([manager/router/router.goL207-R211](https://github.com/dragonflyoss/dragonfly/pull/4067/files#diff-accc11d77962a73f2df2837787ed0d45a6a0d5ca6a020c3eec7726f447db2d9cL207-R211))

Description

Related Issue

Motivation and Context

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

Signed-off-by: chlins <chlins.zhang@gmail.com>
@chlins chlins requested a review from a team as a code owner May 15, 2025 06:25
@chlins chlins added the enhancement New feature or request label May 15, 2025
@chlins chlins enabled auto-merge (squash) May 15, 2025 06:25
Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

codecov bot commented May 15, 2025

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 34.39%. Comparing base (2483762) to head (ca1b404).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
manager/router/router.go 0.00% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4067   +/-   ##
=======================================
  Coverage   34.39%   34.39%           
=======================================
  Files         346      346           
  Lines       40451    40451           
=======================================
  Hits        13914    13914           
  Misses      25621    25621           
  Partials      916      916           
Flag Coverage Δ
unittests 34.39% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
manager/router/router.go 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@Liam-Zhao Liam-Zhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chlins chlins merged commit 6c6e295 into main May 15, 2025
30 of 38 checks passed
@chlins chlins deleted the fix/get-configs-auth branch May 15, 2025 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants