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

Move the common middleware functions to go-mod-bootstrap #565

Closed
lindseysimple opened this issue Jul 19, 2023 · 3 comments · Fixed by #567
Closed

Move the common middleware functions to go-mod-bootstrap #565

lindseysimple opened this issue Jul 19, 2023 · 3 comments · Fixed by #567
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@lindseysimple
Copy link
Contributor

🚀 Feature Request

Relevant Package [REQUIRED]

This feature request is for all of the EdgeX micro services have a dependency on it

Description [REQUIRED]

Currently the common middleware functions (e.g., ManageHeader, LoggingMiddleware, UrlDecodeMiddleware) are defined and applied in the router of each EdgeX service separately as listed below:

Describe the solution you'd like

The common middleware functions can be defined in the go-mod-bootstrap and be applied in the CommonController to avoid the re-declaration of the functions and among each EdgeX service.

Note

The issue needs #557 to get merged first to avoid the code conflict.

@lindseysimple lindseysimple added the enhancement New feature or request label Jul 19, 2023
@github-project-automation github-project-automation bot moved this to New Issues in Technical WG Jul 19, 2023
@lindseysimple lindseysimple self-assigned this Jul 19, 2023
@lindseysimple lindseysimple added this to the Napa milestone Jul 19, 2023
@cloudxxx8 cloudxxx8 moved this from New Issues to Release Backlog in Technical WG Jul 19, 2023
@lenny-goodell
Copy link
Member

lenny-goodell commented Jul 19, 2023

@cloudxxx8 , @lindseysimple, should this be closed by #562

@cloudxxx8
Copy link
Member

No, #562 is for common API, not common middleware. Lindsey means the following:
https://github.com/edgexfoundry/edgex-go/blob/54d035bfa974c800c1254128570959cbd1217788/internal/pkg/correlation/middleware.go

@lenny-goodell
Copy link
Member

OH, ok. missed the middleware part in the title... THX!

@jumpingliu jumpingliu moved this from Release Backlog to In Progress in Technical WG Jul 25, 2023
lindseysimple added a commit to lindseysimple/go-mod-bootstrap that referenced this issue Jul 25, 2023
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]>
lindseysimple added a commit to lindseysimple/go-mod-bootstrap that referenced this issue Jul 25, 2023
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]>
@lindseysimple lindseysimple moved this from In Progress to QA/Code Review in Technical WG Jul 25, 2023
lindseysimple added a commit to lindseysimple/go-mod-bootstrap that referenced this issue Jul 26, 2023
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]>
cloudxxx8 pushed a commit that referenced this issue Jul 27, 2023
* feat: Move the common middlewares to go-mod-bootstrap

Closes #565.
- Define the common middleware funcs on the router level.
- Skip Ping in the auth handler func.

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

* fix: Return next handlerFunc for Ping instead of nil

Return next handlerFunc for Ping instead of nil in VaultAuthenticationHandlerFunc.

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

* fix: Invoke authenticationHook on the route level

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

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

---------

Signed-off-by: Lindsey Cheng <[email protected]>
@github-project-automation github-project-automation bot moved this from QA/Code Review to Napa Done in Technical WG Jul 27, 2023
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 a pull request may close this issue.

3 participants