-
Notifications
You must be signed in to change notification settings - Fork 177
Introduce middleware for audit logs and authentication checks #157
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
|
/cc @manusa |
| options := []server.StreamableHTTPOption{ | ||
| server.WithHTTPContextFunc(contextFunc), | ||
| server.WithStreamableHTTPServer(httpServer), | ||
| server.WithStateLess(true), |
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.
This is not related to the changes in this PR. I updated this, because I think we want stateless streamable http server. If it is suggested that this change should be in a different PR, I can remove it from here.
I'm not sure if this is aligned with the According to the |
|
I think, it is not related but hard to say for sure. |
pkg/middleware/middleware.go
Outdated
| @@ -0,0 +1,61 @@ | |||
| package middleware | |||
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.
Not sure if this scope is too narrow, what do you think about a broader http package to include everything related to our customized http server?
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.
Firstly, I renamed it to http to be honest. But this name collides with the native Go http package. But I can rename it to, if you want to. And we can use package name as internalhttp.
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.
I'm fine whatever you decide.
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.
Your call, we can always change the name in the future.
For me it's uncomfortable to see the http server logic in root.go and I think that we should probably move that somewhere else (hence the broader scope for this package, to cover everything related to http/internalhttp).
In any case, this can be covered in the future.
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.
Renamed to http, because it is indeed better. We can move server logic under http in a followup PR.
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.
I'll move server logic in http package, when I wire the sig terms to the server.
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.
Opened this #164
manusa
left a comment
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.
besides the nitty comments, everything else looks good :)
manusa
left a comment
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.
LGTM, thx!
This PR is the continuation of #153. First commit basically is from #153. Second commit introduces the middleware.
This middleware;