package
0.0.0-20230728070032-dd9e68f319d5
Repository: https://github.com/weaveworks/common.git
Documentation: pkg.go.dev
# Functions
ExtractFromGRPCRequest extracts the user ID from the request metadata and returns the user ID and a context with the user ID injected.
ExtractOrgID gets the org ID from the context.
ExtractOrgIDFromHTTPRequest extracts the org ID from the request headers and returns the org ID and a context with the org ID embedded.
ExtractUserID gets the user ID from the context.
ExtractUserIDFromHTTPRequest extracts the org ID from the request headers and returns the org ID and a context with the org ID embedded.
InjectIntoGRPCRequest injects the orgID from the context into the request metadata.
InjectOrgID returns a derived context containing the org ID.
InjectOrgIDIntoHTTPRequest injects the orgID from the context into the request headers.
InjectUserID returns a derived context containing the user ID.
InjectUserIDIntoHTTPRequest injects the userID from the context into the request headers.
LogWith returns user and org information from the context as log fields.
# Constants
Errors that we return.
Errors that we return.
Errors that we return.
Errors that we return.
Errors that we return.
Errors that we return.
OrgIDHeaderName denotes the OrgID the request has been authenticated as.
UserIDHeaderName denotes the UserID the request has been authenticated as.