Skip to content
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

feat: Move the common middlewares to go-mod-bootstrap #567

Merged
merged 3 commits into from
Jul 27, 2023

Conversation

lindseysimple
Copy link
Contributor

@lindseysimple lindseysimple commented Jul 25, 2023

Closes #565.

  • Define the common middleware funcs on the router level.
  • Skip Ping in the auth handler func.

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/go-mod-bootstrap/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

New Dependency Instructions (If applicable)

@cloudxxx8 cloudxxx8 requested a review from bnevis-i July 25, 2023 08:56
bootstrap/handlers/auth_middleware.go Outdated Show resolved Hide resolved
bootstrap/handlers/httpserver.go Show resolved Hide resolved
Closes edgexfoundry#565.
- Define the common middleware funcs on the router level.
- Skip Ping in the auth handler func.

Signed-off-by: Lindsey Cheng <[email protected]>
Return next handlerFunc for Ping instead of nil in VaultAuthenticationHandlerFunc.

Signed-off-by: Lindsey Cheng <[email protected]>
@codecov-commenter
Copy link

Codecov Report

Merging #567 (58d36b8) into main (eae20c3) will increase coverage by 0.06%.
The diff coverage is 65.45%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #567      +/-   ##
==========================================
+ Coverage   58.68%   58.75%   +0.06%     
==========================================
  Files          29       30       +1     
  Lines        2418     2468      +50     
==========================================
+ Hits         1419     1450      +31     
- Misses        907      922      +15     
- Partials       92       96       +4     
Files Changed Coverage Δ
bootstrap/handlers/auth_middleware.go 0.00% <0.00%> (ø)
bootstrap/handlers/httpserver.go 13.97% <0.00%> (-0.97%) ⬇️
bootstrap/handlers/common_middleware.go 75.00% <75.00%> (ø)
bootstrap/controller/commonapi.go 91.35% <100.00%> (-0.21%) ⬇️

Revert back to invoke authenticationHook on the route level instead of on the server router level.

Signed-off-by: Lindsey Cheng <[email protected]>
Copy link
Collaborator

@bnevis-i bnevis-i left a comment

Choose a reason for hiding this comment

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

LGTM

@cloudxxx8 cloudxxx8 merged commit 8addaa2 into edgexfoundry:main Jul 27, 2023
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.

Move the common middleware functions to go-mod-bootstrap
5 participants