Add LogContext middleware to inject org/user id#60
Conversation
6e54101 to
1f1618e
Compare
47ede04 to
73e938c
Compare
73e938c to
d584f19
Compare
|
In other places we've sent the UserID and OrgID as HTTP headers, any reason for the departure from that? |
|
@leth good point, I've seen both. Who is adding these HTTP headers? Clients? Authfe? And is there a middleware to extract it into the request context? |
|
Fairly sure it's authfe; though the middleware lives in the users directory: https://github.com/weaveworks/service/blob/master/users/client/middleware.go |
|
Sometimes in other clients directly too: https://github.com/weaveworks/cortex/blob/master/pkg/ruler/ruler.go#L223 |
| return hj.Hijack() | ||
| } | ||
|
|
||
| // LogContext is a middleware to inject the organization and user id into |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
|
Main misconception was that there was no injection (since I didn't run it through authfe locally). Another revelation was that |
We want to inject the organizationID and userID from named url path parameters in multiple places which this middleware helps with.
Not sure about the naming... open to alternatives.