1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-08-06 22:42:56 +02:00

feat: differentiate between "no available key" and error for redis sessions (#3093)

* add some better error handling

* add changelog entry

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
nobletrout
2025-07-24 02:33:06 -04:00
committed by GitHub
parent e75a258299
commit f4b33b64bd
2 changed files with 6 additions and 1 deletions

View File

@ -16,6 +16,8 @@
- [#3104](https://github.com/oauth2-proxy/oauth2-proxy/pull/3104) feat(cookie): add feature support for cookie-secret-file (@sandy2008) - [#3104](https://github.com/oauth2-proxy/oauth2-proxy/pull/3104) feat(cookie): add feature support for cookie-secret-file (@sandy2008)
- [#3055](https://github.com/oauth2-proxy/oauth2-proxy/pull/3055) feat: support non-default authorization request response mode also for OIDC providers (@stieler-it) - [#3055](https://github.com/oauth2-proxy/oauth2-proxy/pull/3055) feat: support non-default authorization request response mode also for OIDC providers (@stieler-it)
- [#3138](https://github.com/oauth2-proxy/oauth2-proxy/pull/3138) feat: make google_groups argument optional when using google provider (@sourava01) - [#3138](https://github.com/oauth2-proxy/oauth2-proxy/pull/3138) feat: make google_groups argument optional when using google provider (@sourava01)
- [#3093](https://github.com/oauth2-proxy/oauth2-proxy/pull/3093) feat: differentiate between "no available key" and error for redis sessions (@nobletrout)
# V7.10.0 # V7.10.0

View File

@ -49,9 +49,12 @@ func (store *SessionStore) Save(ctx context.Context, key string, value []byte, e
// cookie within the HTTP request object // cookie within the HTTP request object
func (store *SessionStore) Load(ctx context.Context, key string) ([]byte, error) { func (store *SessionStore) Load(ctx context.Context, key string) ([]byte, error) {
value, err := store.Client.Get(ctx, key) value, err := store.Client.Get(ctx, key)
if err != nil { if err == redis.Nil {
return nil, fmt.Errorf("session does not exist")
} else if err != nil {
return nil, fmt.Errorf("error loading redis session: %v", err) return nil, fmt.Errorf("error loading redis session: %v", err)
} }
return value, nil return value, nil
} }