Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TT-13405] Setting session in Go plugins ignores hashing config #6606

Open
dragosussy opened this issue Oct 7, 2024 · 0 comments
Open

[TT-13405] Setting session in Go plugins ignores hashing config #6606

dragosussy opened this issue Oct 7, 2024 · 0 comments

Comments

@dragosussy
Copy link

v5.6.0-rc3

  • Branch/Version: master

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:

  1. Implement Go auth_check plugin
  2. 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.

@dragosussy dragosussy added the bug label Oct 7, 2024
@andyo-tyk 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants