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

2190 Commits

Author SHA1 Message Date
dc8b1623a2 feat(cookie): add feature support for cookie-secret-file (#3104)
* feat: add feature support for cookie-secret-file

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-Authored-By: Sandy Chen <Yuxuan.Chen@morganstanley.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2025-07-22 18:59:55 +02:00
137e59d526 fix: regex substitution for $ signs in upstream path handling before running envsubst (#2524)
* Perform a regex replace of $NUM to $$NUM before running envsubst

* Perform a regex replace of $NUM to $$NUM before running envsubst

* add test case; fix linter warnings; add method documentation

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

* 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>
2025-07-22 08:52:23 +02:00
a88306be98 feat: add SourceHut (sr.ht) provider (#2359)
* Add SourceHut (sr.ht) provider

* fix 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>
2025-07-22 08:16:32 +02:00
4d17bc1d68 feat: allow use more possible google admin-sdk api scopes (#2743)
* feat: Allow use more possible google admin-sdk api scopes.

* reduce cognitive complexity

Signed-off-by: Bob Du <i@bobdu.cc>

* remove unnecessary else block / indentation

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

* add changelog entry

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

* slight formatting and error message rephrasing

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

---------

Signed-off-by: Bob Du <i@bobdu.cc>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2025-07-21 09:06:17 +02:00
3ac834dbcf Fix local-environment ports (#3136)
* Change Dex port in local-environment from 4190 to 5556

Port 4190 is blocked by standards-compliant browsers (e.g. Firefox), as per https://fetch.spec.whatwg.org/#port-blocking.
Port 5556 is used by Dex in its example config files: 745e1114f3/examples/config-dev.yaml (L50)

* Fix upstream in local-environment/oauth2-proxy.cfg

http://httpbin.localtest.me:8080 is only exposed to the host, not to httpbin Docker network.
Causes Bad Gateway before.

* Do not expose unauthenticated httpbin service in local-environment

This defeats the point of having oauth2-proxy.
It has already been misleading by causing the bug fixed in cafc6af48fc38f6fe4395fb0c7e2638bc84e6091.
It serves as a bad example: users might accidentally expose the service they're trying to protect in the first place.

* Remove unnecessary httpbin.localtest.me alias from local-environment
2025-07-20 20:32:50 +02:00
5e7f14bdcb fix: show login page on broken session cookie (#2605)
* fix: redirect on invalid cookie

* docs: update changelog

* chore: remove duplicated code

* fix: status code handling if wrong http method is used

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2025-07-20 17:17:24 +02:00
b57c82181d feat(cookie) csrf per request limit (#3134)
* Allow setting maximum number of csrf cookies, deleting the oldest if necessary

* Add a test for multiple CSRF cookies to remove the old cookie

* Add docs/changelog

* If limit is <=0 do not clear

Signed-off-by: test <bert@transtrend.com>

* Better docs

Co-authored-by: Jan Larwig <jan@larwig.com>

* direct check of option value

Co-authored-by: Jan Larwig <jan@larwig.com>

* direct use of option value

Co-authored-by: Jan Larwig <jan@larwig.com>

* sort based on clock compare vs time compare

Co-authored-by: Jan Larwig <jan@larwig.com>

* clock.Clock does not implement Compare, fix csrf cookie extraction after rename

Signed-off-by: Bert Helderman <bert@transtrend.com>

* Linter fix

* add method signature documentation and slight formatting

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

* fix: test case for csrf cookie limit and flag

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

---------

Signed-off-by: Bert Helderman <bert@transtrend.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: test <bert@transtrend.com>
Co-authored-by: bh-tt <71650427+bh-tt@users.noreply.github.com>
2025-07-20 16:44:42 +02:00
d5f8507cc8 chore(deps): update alpine docker tag to v3.22.1 (#3129)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-20 11:37:45 +02:00
20f561cf70 chore(deps): update docker-compose (#3130)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-20 11:08:44 +02:00
c403d61d73 chore(deps): update helm release oauth2-proxy to v7.14.1 (#3133)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-20 11:08:23 +02:00
658256d566 chore(deps): update gomod (#3132)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-20 11:08:02 +02:00
313a2cb38b chore(deps): update dependency @easyops-cn/docusaurus-search-local to ^0.52.0 (#3131)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-20 11:07:35 +02:00
78d2a3658f Merge pull request #3128 from oauth2-proxy/release/v7.10.0
release v7.10.0
v7.10.0
2025-07-17 13:02:09 +01:00
e25f9ec9d7 add changelog entry
Signed-off-by: Jan Larwig <jan@larwig.com>
2025-07-17 10:01:37 +02:00
5808f5376a update to release version v7.10.0 2025-07-17 07:56:01 +00:00
07a388d17e add new docs version 7.10.x 2025-07-17 07:56:01 +00:00
0e1dc9bb84 fix: return error for empty Redis URL list (#3101)
* fix: return error for empty Redis URL list

* 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>
2025-07-17 09:23:28 +02:00
6c30a3c70b chore(deps): update alpine base image to v3.22.0 (#3097)
* chore(deps): update alpine docker tag to v3.22.0

* add changelog entry

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

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2025-07-13 22:07:21 +02:00
b05bdc0fbd chore(deps): update helm examples (#2951)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-13 22:06:39 +02:00
40f3ef1ea5 chore(deps): update example docker-compose files (#3096)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-13 22:04:11 +02:00
d390877945 chore(deps): update dependency @easyops-cn/docusaurus-search-local to ^0.51.0 (#3098)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-13 22:00:12 +02:00
c4a02ecc95 chore(deps): update dependency golangci/golangci-lint to v2.2.2 (#3111)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-13 21:59:56 +02:00
abb0a35bf3 feat: bump to go1.24.5 and full dependency update (#3116)
* upgrade to go1.24.5

dependency updates

lint fixes

chore(deps): upgrade github.com/spf13/viper to v1.20.1

Note that this upgrade also implied to upgrade github.com/mitchellh/mapstructure
(nowadays unmaintained: https://gist.github.com/mitchellh/90029601268e59a29e64e55bab1c5bdc)
to github.com/go-viper/mapstructure/v2.

fix: adapt tests to match mapstructure v2 error messages

pkg/apis/options/load_test.go: skip tests on Go 1.23

Add a compile guard for Go < 1.24 for the pkg/apis/options/load_test.go
because the LoadYAML test depends on error messages produced by
encoding/json that changed slightly (names of embedded structs are now
reported). As we updated the test for go1.24, the test now fails on
1.23, but just for a slight difference, so we disable the test there.

fix: adapt tests to match mapstructure v2 error messages

remove pre 1.24 disclaimer

add changelog entry

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

Co-Authored-By: Olivier Mengué <dolmen@cpan.org>

* add exclusion for 'avoid meaningless package names' in .golangci.yml

* chore(dep): upgrade all dependencies

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

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Olivier Mengué <dolmen@cpan.org>
Co-authored-by: Jan Larwig <jan@larwig.com>
2025-07-13 21:55:57 +02:00
1a03217208 Merge pull request #3121 from oauth2-proxy/add-funding
Create FUNDING.yml
2025-07-11 10:11:24 +01:00
c8c160da79 Create FUNDING.yml 2025-07-11 09:58:16 +02:00
7731437af4 feat: support for multiple github orgs (#3072)
* fix for github teams

* Update github.go

* added errorhandling

* Update github.md

* refactored GitHub provider

refactored hasOrg, hasOrgAndTeams and hasTeam into hasAccess to stay within function limit

* reverted Refactoring

* refactored github.go

- joined hasOrgAndTeamAccess into checkRestrictions

* refactored github.go

- reduced number of returns of function checkRestrictions to 4

* updated GitHub provider to accept legacy team ids

* GoFmt and golangci-lint

Formatted with GoFmt and followed recommendations of GoLint

* added Tests

added Tests for checkRestrictions.

* refactored in maintainer feedback

* Removed code, documentation and tests for legacy ids

* add changelog and update docs

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2025-05-29 18:11:07 +02:00
fb7e33519a chores: major upgrade of golangci-lint from v1.64.8 to v2.1.6 (#3062)
.golangci.yml migrated with "golangci-lint migrated" and then tweaked to add comments back.
2025-05-26 21:12:58 +02:00
1225d611e9 chore(lint): fix staticcheck issues (#3061)
* chores: fix staticcheck QF1012

Fix use of fmt.Sprintf when writing to a writer.
https://staticcheck.dev/docs/checks/#QF1012
https://github.com/oauth2-proxy/oauth2-proxy/issues/3060

* chores: fix staticcheck QF1003

Use switch instead of multiple if/else.
https://staticcheck.dev/docs/checks/#QF1003
https://github.com/oauth2-proxy/oauth2-proxy/issues/3060

* chores: exclude staticcheck QF1008 for now

We aim to migrate golangci-lint to v2
Let's disable QF1008 (Omit embedded fields from selector expression)
for now.
https://staticcheck.dev/docs/checks/#QF1008

* chores: fix golangci config: run.deadline -> timeout

Rename config option to match v1 documentation: deadline -> timeout.
https://golangci.github.io/legacy-v1-doc/usage/configuration/#run-configuration

This error has been spotted by golangci-lint v2 migration tool.

* chores: fix staticcheck QF1012
2025-05-26 12:29:34 +02:00
09f6252ebf chore(deps): drop golang.org/x/exp/{slices,maps} (#3065)
Use Go 1.23 stdlib instead: slices, maps.
2025-05-26 12:20:49 +02:00
f82e90426a chore(deps): update docker-compose (#3074)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-23 16:49:24 +02:00
14d5355655 docs: add note about version obfuscation to footer option (#3051)
Signed-off-by: Jan Larwig <jan@larwig.com>
2025-05-03 21:44:30 +02:00
bae509d2ec docs: clear up multiple-providers is unimplemented (#3046)
* docs: clear up multiple-providers is unimplemented

Currently this configuration option is held up by #926. So users don't
assume this solution will work for them, and later find the feature is
not yet implemented -- own the shortcoming clearly.

* doc: add note about missing multi provider implementation to versioned docs

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2025-04-28 23:52:27 +02:00
2ecb2c64aa release: v7.9.0 (#3047)
* add new docs version 7.9.x

* update to release version v7.9.0

* doc: add changelog summary

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
v7.9.0
2025-04-28 18:22:58 +02:00
b7ff804506 feat: ability to parse JWT encoded profile claims (#3014)
* fix: parse JWT profile claims

* Comment with OIDC specs reference

* fix: formatting

* Updated changelog

---------

Co-authored-by: Jan Larwig <jan@larwig.com>
2025-04-28 16:39:09 +02:00
7b41c8e987 fix: role extraction from access token in keycloak oidc (#1916)
* Fix wrong token used in Keycloak OIDC provider

* Update CHANGELOG for PR #1916

* Update tests

* fix: keycloak oidc role extraction

---------

Co-authored-by: Jan Larwig <jan@larwig.com>
2025-04-28 10:23:19 +01:00
367183d7b8 chore(build): refactoring makefile for better usability and introducing a default help target (#2930) 2025-04-27 20:09:52 +02:00
4237358ac3 doc(entra-id): correct toml field in sample (#2946)
---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2025-04-27 19:36:16 +02:00
fc6ca1dde6 chore(deps): update ghcr.io/dexidp/dex docker tag to v2.42.1 (#3044) 2025-04-27 19:08:33 +02:00
7d85c99d8e fix(entra-id): use federated credentials for refresh token (#3031)
* fix: use federated credentials to refresh token in entra id

* fix: add some error handling

* chore: update changelog

* chore: update comments

* chore: update comments

* doc: reference entra id docs and clearer phrasing of comments

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

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2025-04-25 09:59:09 +02:00
3afae76103 chore(deps): update docker-compose (#3038) 2025-04-24 14:01:29 +02:00
07b60b1553 chore(deps): upgrade to latest golang v1.23.x release (#3041) 2025-04-24 13:47:48 +02:00
16e453e9f6 chore(deps): update module golang.org/x/net to v0.38.0 [security] (#3035)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-21 15:59:57 +02:00
8abdbb5a18 Add --bearer-token-login-fallback option (#2924)
* add --deny-invalid-bearer-tokens

* update changelog

* PR feedback, update api-routes description

* update --api-routes description

* revert load_test fix that I needed locally

---------

Co-authored-by: Justin Ryan <j.ryan@mwam.com>
2025-04-21 13:40:39 +01:00
bb6ff4ed14 chore(deps): update gitea/gitea docker tag to v1.23.7 (#3030)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-13 19:53:12 +02:00
7cee02cac3 Merge pull request #3015 from oauth2-proxy/renovate/docker-compose
chore(deps): update docker-compose
2025-04-03 15:39:45 +07:00
3325dcb2bd chore(deps): update docker-compose 2025-03-31 22:19:36 +00:00
f6b95c0df8 feat: allow to set non-default authorization request response mode (#3001)
* Update Go version in devcontainer

* Add option to change response mode in authorization request

* Fix option name

* Update docs and changelog

* Rename config value to underscore

* Add unit tests for added parameter

* Move change to upcoming release

* Generate alpha config

---------

Co-authored-by: Michael Cornel <michael@stieler.it>
2025-03-31 10:04:19 +02:00
b34b617aad docs: fix gitlab docs url for oauth2 integration (#3002)
* Update gitlab.md with correct url for creating an application

* docs: fix gitlab docs url for oauth2 integration

---------

Co-authored-by: Jan Larwig <jan@larwig.com>
2025-03-29 10:47:54 +01:00
99c4c654d9 chore(deps): update docker-compose (#3005) 2025-03-25 21:14:00 +01:00
b2c69e25eb feat: update HashNonce to use crypto/sha256 (#2967)
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
2025-03-25 21:12:37 +01:00