[#44] add tracing support refactoring

Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
This commit is contained in:
Pavel Pogodaev 2023-05-30 17:01:20 +03:00
parent 8a22991326
commit cdaab4feab
9 changed files with 78 additions and 137 deletions

View file

@ -3,6 +3,7 @@
package tokens
import (
"context"
"encoding/base64"
"testing"
@ -153,10 +154,11 @@ func Test_checkAndPropagateBearerToken(t *testing.T) {
ctx := makeTestRequest(t64, "")
// Expect to see the token within the context.
require.NoError(t, StoreBearerToken(ctx))
appCtx, err := StoreBearerTokenAppCtx(ctx, context.Background())
require.NoError(t, err)
// Expect to see the same token without errors.
actual, err := LoadBearerToken(ctx)
actual, err := LoadBearerToken(appCtx)
require.NoError(t, err)
require.Equal(t, tkn, actual)
}