Commit Graph

23 Commits

Author SHA1 Message Date
Jan Larwig 1f29953b7b
docs: add todo for revamping the usage / naming of PassHostHeader
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-01-17 11:06:24 +01:00
Pascal 1d6721f7ba
fix: WebSocket proxy to respect PassHostHeader setting (#3290)
* Fix WebSocket proxy to respect PassHostHeader setting

When PassHostHeader is set to false, the regular HTTP proxy correctly
sets the Host header to the upstream backend URL. However, the WebSocket
proxy was not respecting this setting, causing WebSocket connections to
fail when backend services validate the Host header.

This commit:
- Adds passHostHeader parameter to newWebSocketReverseProxy()
- Applies setProxyUpstreamHostHeader() when PassHostHeader=false
- Ensures consistent behavior between HTTP and WebSocket proxies

Fixes #3288

Signed-off-by: Pascal Schmiel <pascal.schmiel@gmail.com>

* chore(): add tests, update changelog

Signed-off-by: Pascal Schmiel <pascal.schmiel@gmail.com>

---------

Signed-off-by: Pascal Schmiel <pascal.schmiel@gmail.com>
2026-01-16 20:30:16 +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 527c72f23f
feat: add ensure defaults to all migrated structs
Signed-off-by: Jan Larwig <jan@larwig.com>
2025-11-16 22:38:52 +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
tuunit 7c20001045
introduce mapstructure decoder for yaml parsing
remove color output in tests for better readability in github actions

bugfix: remove google as default provider for alpha options

fix conversion flow for toml to yaml

revert ginkgo color deactivation

revert claim- and secret source back to pointers

regenerate alpha config

Signed-off-by: Jan Larwig <jan@larwig.com>
2025-11-16 22:37:37 +01:00
Jan Larwig fcf4e7947b
fix: hmacauth dependency licensing issue (#3253)
* fix: upstream licensing issue by adopting hmacauth library and changing asserting library for its test cases

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

* fix: golang code quality and linting issues for hmacauth

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

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
2025-11-09 20:14:54 +01:00
jet f18a0b7b07
feat: allow disable-keep-alives configuration in upstream (#3156)
Signed-off-by: Jan Larwig <jan@larwig.com>
2025-08-19 07:56:16 +02: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
Jack Henschel 7a27cb04df Implement configurable timeout for upstream connections
Signed-off-by: Jack Henschel <jack.henschel@cern.ch>
2022-05-18 11:41:17 +01:00
Matt Lilley 3957183fd5
Use the httputil.NewSingleHostReverseProxy instead of yhat/wsutil for … (#1348)
* Use the httputil.NewSingleHostReverseProxy instad of yhat/wsutil for websocket proxying. This correctly handles 404 responses with keep-alive by terminating the tunnel rather than keeping it alive

* Tidy up dependencies - yhat/wsutil is no longer required

* Update changelog to include reference to 1348

Co-authored-by: Matt Lilley <matt.lilley@securitease.com>
Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
2021-10-03 15:38:40 +01:00
Joel Speed 92ae5d9d24
Remove duplication in proxy directors 2021-03-22 13:07:41 +00:00
Joel Speed 025ef3eca4
Fix upstream proxy appending `?` to requests 2021-03-22 13:07:36 +00:00
Nick Meves 602dac7852
Move Logging to Middleware Package (#1070)
* Use a specialized ResponseWriter in middleware

* Track User & Upstream in RequestScope

* Wrap responses in our custom ResponseWriter

* Add tests for logging middleware

* Inject upstream metadata into request scope

* Use custom ResponseWriter only in logging middleware

* Assume RequestScope is never nil
2021-03-06 17:27:16 +00:00
Joel Speed aed43a54da
Add DefaultUpstreamFlushInterval to replace magic time.Second value 2020-11-19 10:39:21 +00:00
Joel Speed b6d6f31ac1
Introduce Duration so that marshalling works for duration strings 2020-11-19 10:35:29 +00:00
Mitsuo Heijo 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
Nick Meves ad52587ae6
Document GoSec nosec skip comments 2020-08-09 07:55:40 -07: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 d43b372ca9
Use bool pointers for upstream options that default to true 2020-07-19 14:01:36 +01:00
Joel Speed 5b95ed3033
Add tests for upstream package 2020-07-05 10:21:05 +01:00
Joel Speed e1c3e938cc
Add upstream package with Proxy server implementation 2020-07-05 10:21:05 +01:00