You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The section of code called by ctx.SetSession sets the hashing configuration based on an array of booleans provided. If there's none provided, it will default to the tyk global configuration for hashing keys.
Reproduction steps
Steps to reproduce the behavior:
Implement Go auth_check plugin
Attempt to manually create and store a session with ctx.SetSession
Expected behavior
Providing one single argument for hashKey ...bool to the function correctly sets hashing configuration.
Actual behavior
2 or more arguments need to be provided in order to consider the hashKeys parameter.
Additional context https://github.com/TykTechnologies/tyk/blob/v5.6.0-rc3/ctx/ctx.go#L111C1-L117C2 func SetSession(r *http.Request, s *user.SessionState, scheduleUpdate bool, hashKey ...bool) { if len(hashKey) > 1 { ctxSetSession(r, s, scheduleUpdate, hashKey[0]) } else { ctxSetSession(r, s, scheduleUpdate, config.Global().HashKeys) } }
My assumption would be that this is a simle change from len(hashKey) > 1 to len(hashKey) > 0.
The text was updated successfully, but these errors were encountered:
andyo-tyk
changed the title
Setting session in Go plugins ignores hashing config
[TT-13405] Setting session in Go plugins ignores hashing config
Oct 25, 2024
v5.6.0-rc3
Describe the bug
The section of code called by
ctx.SetSession
sets the hashing configuration based on an array of booleans provided. If there's none provided, it will default to the tyk global configuration for hashing keys.Reproduction steps
Steps to reproduce the behavior:
ctx.SetSession
Expected behavior
Providing one single argument for
hashKey ...bool
to the function correctly sets hashing configuration.Actual behavior
2 or more arguments need to be provided in order to consider the hashKeys parameter.
Additional context
https://github.com/TykTechnologies/tyk/blob/v5.6.0-rc3/ctx/ctx.go#L111C1-L117C2
func SetSession(r *http.Request, s *user.SessionState, scheduleUpdate bool, hashKey ...bool) { if len(hashKey) > 1 { ctxSetSession(r, s, scheduleUpdate, hashKey[0]) } else { ctxSetSession(r, s, scheduleUpdate, config.Global().HashKeys) } }
My assumption would be that this is a simle change from
len(hashKey) > 1
tolen(hashKey) > 0
.The text was updated successfully, but these errors were encountered: