[tracing] refactor to use custom extension for trace id editing (#5420)

refactor to use custom extension for trace id editing
This commit is contained in:
Joe Kralicky 2025-01-08 16:06:33 -05:00
parent de68673819
commit 86bf8a1d5f
No known key found for this signature in database
GPG key ID: 75C4875F34A9FB79
36 changed files with 1144 additions and 2672 deletions

View file

@ -368,9 +368,8 @@ func TestAuthenticate_OAuthCallback(t *testing.T) {
params.Add("error", tt.paramErr)
params.Add("code", tt.code)
nonce := cryptutil.NewBase64Key() // mock csrf
// (nonce|timestamp|redirect_url|encrypt(redirect_url),mac(nonce,ts))
b := []byte(fmt.Sprintf("%s|%d|%s", nonce, tt.ts, tt.extraMac))
// (nonce|timestamp|trace_id+flags|encrypt(redirect_url),mac(nonce,ts))
b := []byte(fmt.Sprintf("%s|%d||%s", nonce, tt.ts, tt.extraMac))
enc := cryptutil.Encrypt(a.state.Load().cookieCipher, []byte(tt.redirectURI), b)
b = append(b, enc...)
encodedState := base64.URLEncoding.EncodeToString(b)