forked from TrueCloudLab/frostfs-http-gw
[#44] add tracing support refactoring
Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
This commit is contained in:
parent
8a22991326
commit
cdaab4feab
9 changed files with 78 additions and 137 deletions
|
@ -48,18 +48,6 @@ func BearerTokenFromCookie(h *fasthttp.RequestHeader) []byte {
|
|||
return auth
|
||||
}
|
||||
|
||||
// StoreBearerToken extracts a bearer token from the header or cookie and stores
|
||||
// it in the request context.
|
||||
func StoreBearerToken(ctx *fasthttp.RequestCtx) error {
|
||||
tkn, err := fetchBearerToken(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// This is an analog of context.WithValue.
|
||||
ctx.SetUserValue(bearerTokenKey, tkn)
|
||||
return nil
|
||||
}
|
||||
|
||||
// StoreBearerTokenAppCtx extracts a bearer token from the header or cookie and stores
|
||||
// it in the application context.
|
||||
func StoreBearerTokenAppCtx(ctx *fasthttp.RequestCtx, appCtx context.Context) (context.Context, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue