oauth2-proxy
oauth2-proxy copied to clipboard
fix: return error for empty Redis URL list
When no Redis URLs are provided when creating a Redis session store, the parseRedisURLs() function returns a nil pointer, rather than an error, and causes a nil pointer dereference error
Description
Add a check for the length of []string input for parseRedisURLs() and returns an error if it's empty
Motivation and Context
Fixes #3100
I ran into this when I was spinning up the oauth2-proxy helm chart and misspelling the sessionStorage.redis.sentinel key as sessionStorage.redis.sentinels.
How Has This Been Tested?
Updated the unit tests. Built new image locally, deployed it into a local cluster, and verified that the correct error was returned.
Checklist:
- [ ] My change requires a change to the documentation or CHANGELOG.
- [ ] I have updated the documentation/CHANGELOG accordingly.
- [x] I have created a feature (non-master) branch for my PR.
- [x] I have written tests for my code changes.