1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-15 00:15:00 +02:00
Commit Graph

252 Commits

Author SHA1 Message Date
3f7ed36e46 Add support for Redis with custom CA. 2019-11-08 10:47:18 +01:00
35f2ae9a36 Improved request errors (#286)
* worked on wrapping errors in requests.go, added defer statements

* removed .idea (generated by goland)

* added another require.NoError

* Update pkg/requests/requests.go

Co-Authored-By: Dan Bond <pm@danbond.io>

* fixed out-of-order imports

* changelog entry added

* swapped error definitions to use fmt.Errorf rather than Wrap()

* formatting changes, added new defers to requests_test.go

* suppot for go1.12 pipeline removed from travis pipeline, .idea/ added to gitignore

* Reorder changelog entry
2019-10-23 09:55:34 -07:00
e64e6fa514 Some code improvements
* Remove shadowing of predeclared identifier: new.
* strings.ReplaceAll instead of strings.Replace with -1.
* Change strings.ToLower comparison to strings.EqualFold.
* Rewrite if-else-if-else chain as a switch.
2019-10-09 15:44:26 +03:00
b57d7f77e1 Use ok naming convention for map presence check 2019-07-16 10:06:29 +12:00
289dfce28a logger.go ExcludedPaths changed to slice of paths.
- `logger.go` convert slice of paths to map for quicker lookup
- `options.go` combines csv paths and pingpath into slice
2019-07-16 10:04:09 +12:00
08021429ea formatting and extra test
Can probably slim down the `ExcludePath` tests.
2019-07-16 09:43:48 +12:00
c4f20fff3d Add exclude logging path option
Useful for excluding /ping endpoint to reduce log volume.
This is somewhat more verbose than a simple bool to disable logging of
the `/ping` endpoint.

Perhaps better to add `-silence-ping-logging` bool flag to `options.go` and
pass in the `/ping` endpoint as part of `logger` declaration in `options.go`.

Could be extended into a slice of paths similar to go-gin's `SkipPaths`:
https://github.com/gin-gonic/gin/blob/master/logger.go#L46
2019-07-16 09:43:47 +12:00
ec97000169 Add silence ping logging flag
Add ability to silence logging of requests to /ping endpoint, reducing
log clutter

Pros:
- Don't have to change all handlers to set/not set silent ping logging
- Don't have to duplicate `loggingHandler` (this could be preferable yet)

Cons:
- Leaking oauth2proxy logic into `package logger`
- Defining default pingPath in two locations

Alternative:
- Add generic exclude path to `logger.go` and pass in `/ping`.
2019-07-16 09:42:24 +12:00
6366690927 Fix gofmt for changed files 2019-06-15 11:34:00 +02:00
fb9616160e Move logger to pkg/logger 2019-06-15 11:33:58 +02:00
d1ef14becc Move cookie to pkg/encryption 2019-06-15 11:33:57 +02:00
8027cc454e Move api to pkg/requests 2019-06-08 07:40:43 +01:00
4721da02f2 Ensure SessionStores can handle recieving cookies for the wrong implementation
(cherry picked from commit 131206cf41697543583751ac2714287898c19ad0)
2019-06-05 00:11:42 -07:00
c1ae0ca807 Make sure the cookie exists before we clear the session in redis
(cherry picked from commit 6d7f0ab57d554706425f76aed4df60717dd63ece)
2019-06-05 00:11:42 -07:00
22199fa417 Fix ticket retrieval with an invalid ticket
(cherry picked from commit 66bbf146ec45d127bdd374120743aeef936894a7)
2019-06-05 00:11:42 -07:00
3155ada287 Ensure sessions are refreshable in redis session store
(cherry picked from commit 48edce3003d187a3eadc4ea96236845271dd9360)
2019-06-05 00:11:42 -07:00
2e2327af6c Check SaveSession works when an existing session is present
(cherry picked from commit 9dc1a96d817741632cb476456755a645b732db7d)
2019-06-05 00:11:42 -07:00
518c1d3e8e Add Redis sentinel compatibility
(cherry picked from commit ff36b61f8cee4ecf0b91a90b5e1b651b526bb6b6)
2019-06-05 00:11:42 -07:00
4f5dbace9f Refactor persistent tests with more Context 2019-06-05 00:10:51 -07:00
7e7bfb5daf Stop miniredis after each test 2019-06-05 00:10:51 -07:00
bc3d75a2ed Run persistent tests with multiple option groups 2019-06-05 00:10:51 -07:00
42f14a41d9 Clean up persistent SessionStore tests 2019-06-05 00:10:51 -07:00
a7693cc72a Tranfser all cookies in tests 2019-06-05 00:10:51 -07:00
93df7d9132 Remove spurious comment 2019-06-05 00:10:51 -07:00
a6b8f7bde2 Rename expire -> expiration 2019-06-05 00:10:51 -07:00
2f61e42c37 More obvious comment on CFB 2019-06-05 00:10:51 -07:00
f435fa68ab Make loadSessionFromString private 2019-06-05 00:10:51 -07:00
130d03758d Fix comments on Redis options 2019-06-05 00:10:51 -07:00
b255ed56ef Sign cookies in the Redis Session store 2019-06-05 00:10:51 -07:00
2c566a5f5b Use session CreatedAt for cookie timings 2019-06-05 00:10:51 -07:00
296d989e58 Simplify redis store options 2019-06-05 00:10:51 -07:00
42731f0617 Check cookie error and doc on cookie handling 2019-06-05 00:10:51 -07:00
b1bd3280db Add support for a redis session store 2019-06-05 00:10:51 -07:00
e881612ea6 Fix session_state type 2019-06-05 00:10:51 -07:00
093f9da881 Move cipher creation to options and away from oauth2_proxy.go 2019-05-20 11:26:13 +02:00
76bd23738f Simplify cookie creation form *options.CookieOptions 2019-05-20 11:26:12 +02:00
c61f3a1c65 Use SessionStore for session in proxy 2019-05-20 11:26:10 +02:00
34cbe0497c Add CreatedAt to SessionState 2019-05-20 11:26:09 +02:00
fbee5eae16 Initialise SessionStore in Options 2019-05-20 11:26:04 +02:00
1d29a0d094 Drop Session suffix from SessionStore methods 2019-05-18 13:10:12 +02:00
65302ed34b Rename RunCookieTests to RunSessionTests 2019-05-18 13:10:09 +02:00
02e80b7aab Check all information is encoded when cookie-secret set 2019-05-18 13:10:08 +02:00
553cf89579 Add tests for saving and loading a session in SessionStore 2019-05-18 13:10:08 +02:00
1c2ee715b3 Refactor session_store_test.go 2019-05-18 13:10:07 +02:00
b965f25c10 Implement SaveSession in Cookie SessionStore 2019-05-18 13:10:06 +02:00
15a2cf8b9e Implement ClearSession for cookie SessionStore 2019-05-18 13:10:05 +02:00
8b3a3853eb Implement LoadSession in Cookie SessionStore 2019-05-18 13:10:04 +02:00
0204054005 Add tests to check cookies set by SessionStores 2019-05-18 13:10:02 +02:00
6d162a1d78 Define session options and cookie session store types 2019-05-18 13:10:01 +02:00
530acff38c Add SessionStore interface 2019-05-18 13:10:00 +02:00