Commit Graph
21 Commits
Author SHA1 Message Date
Jan LarwigandSimon Engmann 46be69c276 fix: propagate errors during route building (#3383)
* Propagate errors during route building

This fixes cases such as invalid paths being silently discarded after
creation by throwing a visible error in such cases.
Due to the way gorilla/mux's fluent API is designed, it is necessary to
manually call `.GetError()` to check for errors while building routes.

Signed-off-by: Simon Engmann <simon.engmann@sovity.de>

* Add test for route building error propagation

Signed-off-by: Simon Engmann <simon.engmann@sovity.de>

* Add route building error propagation to changelog

Signed-off-by: Simon Engmann <simon.engmann@sovity.de>

---------

Signed-off-by: Simon Engmann <simon.engmann@sovity.de>
Co-authored-by: Simon Engmann <simon.engmann@sovity.de>
2026-03-23 11:25:20 +01:00
Jan Larwig 638fba417f deref everything but now with default constants
Signed-off-by: Jan Larwig <jan@larwig.com>
2025-11-16 22:38:56 +01:00
Jan Larwig ceb9a387b1 deref everything... but why?
Signed-off-by: Jan Larwig <jan@larwig.com>
2025-11-16 22:38:54 +01:00
Jan Larwig 9d70e04262 feat: migrate all alpha config booleans to pointers
Signed-off-by: Jan Larwig <jan@larwig.com>
2025-11-16 22:38:49 +01:00
Ian Roberts cb53401c3a Don't use http.StripPrefix when a file: upstream has rewriteTarget
A regular (non-regex) file: upstream needs to strip the prefix so that it is equivalent to "mounting" the specified directory under the configured path in the URL space, but with regex rewriting the target path is determined by the rewriteTarget.

Fixes oauth2-proxy/oauth2-proxy#2242
2024-09-02 11:27:28 +01:00
kvanzuijlen f8efdbae5f chore: Updated go-jwt to v5 2024-03-04 01:42:00 +01:00
Damien Degois 70571d96e1 Add support for unix socket as upstream (#1866)
* Add support for unix socket as upstream

* Add CHANGELOG.md entry

* Add Unix socket documentation

* Don't export unixRoundTripper, switch from string prefix to Scheme match

* Add basic unix server mock

* Add some tests and comments
2023-10-26 10:57:00 +01:00
Fabian Stelzer 88f32aeaa1 rename Upstreams to UpstreamConfig and its Configs member to Upstreams then 2021-09-17 12:37:57 +00:00
Fabian Stelzer d51556515e Introduce ProxyRawPath flag
Setting this flag will configure the upstream proxy to pass encoded urls
as-is.
2021-09-17 12:37:56 +00:00
Fabian Stelzer 12ab4ef529 Make the Upstreams mux configurable
This commit changes Upstreams from []Upstream to a struct{}
moving the previous []Upstream into .Configs and adjusts all uses of it.
2021-09-17 12:31:18 +00:00
Joel Speed 075cb9c3a0 Ensure upstreams are sorted by longest first 2021-06-23 12:20:48 +01:00
Joel Speed 8a06779d41 Redirect request if it would match with an appended trailing slash 2021-06-23 12:20:47 +01:00
Joel Speed 6c62b25bf1 Allow request paths to be rewritten before proxying to upstream server 2021-06-23 12:20:46 +01:00
Joel Speed d2d62bb452 Replace standard serve mux with gorilla mux 2021-06-23 12:20:21 +01:00
Joel Speed befcdd9d04 Add pagewriter to upstream proxy 2021-05-10 11:14:05 +01:00
Joel Speed a63ed0225c Use ErrorPage to render proxy error page 2021-02-12 21:12:27 +00:00
Mitsuo HeijoandJoel Speed 3fa42edb73 Fix import path for v7 (#800)
* fix import path for v7

find ./ -name "*.go" | xargs sed -i -e 's|"github.com/oauth2-proxy/oauth2-proxy|"github.com/oauth2-proxy/oauth2-proxy/v7|'

* fix module path

* go mod tidy

* fix installation docs

* update CHANGELOG

* Update CHANGELOG.md

Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>

Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
2020-09-29 17:44:42 +01:00
Joel Speed b40517bbe3 Fix conversion of static responses in upstreams 2020-08-31 16:54:01 +01:00
Phil TaproggeandJoel Speed d69fd6af22 Allow Logging to stdout with separate Error Log Channel (#718)
* Add dedicated error logging writer

* Document new errors to stdout flag

* Update changelog

* Thread-safe the log buffer

* Address feedback

* Remove duplication by adding log level

* Clean up error formatting

* Apply suggestions from code review

Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
2020-08-10 11:44:08 +01:00
Nick Meves 65c228394f Address gosec findings
Mostly handling unhandled errors appropriately.
If logging to STDERR fails, we panic. Added #nosec
comments to findings we are OK with.
2020-08-09 07:55:39 -07:00
Joel Speed e1c3e938cc Add upstream package with Proxy server implementation 2020-07-05 10:21:05 +01:00