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

43 Commits

Author SHA1 Message Date
e51f5fe7c9 Refactor GitHub to EnrichSessionState 2020-10-19 14:09:45 -07:00
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
d05e08cba3 Create generic Authorization Header constructor 2020-08-16 20:04:34 +01:00
d4dd34a65a Move provider URLs to package level vars 2020-07-19 18:34:55 +01:00
de9e65a63a Migrate all requests to result pattern 2020-07-06 20:38:00 +01:00
53142455b6 Migrate all requests to new builder pattern 2020-07-06 18:31:09 +01:00
d8d43bb51b Support new option "github-user" (#421)
* feat(github): support new option "github-user"

* feat(github): rename github-user to github-users

* feat(github): update docs for github-users option

* feat(github): remove unneeded code

* feat(github): remove logging

* feat(github-user): use github-user as flagset options

* feat(github-user): remove optionns.go

* feat(github-user): add github-user flagset

* feat(github): improve readability in the docs

* feat(github-user): refactored SetUsers method

* Update flag description

Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
2020-06-01 20:02:07 +01:00
7cf685140b Restrict access using Github collaborators (#497)
* Allow access based on Github repository
2020-05-11 18:02:40 +01:00
e642daef4e Support context in providers (#519)
Co-authored-by: Henry Jenkins <henry@henryjenkins.name>
2020-05-10 13:34:59 +01:00
dd05e7ff0b Add new linters (#486)
* add new linters and fix issues

* fix deprecated warnings

* simplify return

* update CHANGELOG

* fix staticcheck issues

* remove a deprecated linter, minor fixes of variable initialization
2020-04-14 09:36:44 +01:00
802754caad Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
2033ce81c3 Implement ValidateSessionState for GitHubProvider (#385)
Refactors the setting of the Authorization header into getGitHubHeader.

Refs #382

Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
2020-02-15 15:11:14 +00:00
3a843f815d GitHub Provider - Fallback to secondary verified email (#372)
* Fallback to secondary verified email

* Add change to changelog
2020-02-15 13:36:28 +00:00
e71797b409 ReadAll() & Close()  close together. 2019-10-11 16:02:04 +09:00
31d7b61cc4 Added handling of link header in githubAPI paging process
======================================================
changelog note

[#274](https://github.com/pusher/oauth2_proxy/pull/274)  Add github api pagination support (@toshi-miura ,@apratina)

======================================================

I didn't edit CHANGELOG.md.
Since # 102 was taken over and the change difference of CHANGELOG.md was large
2019-10-10 05:35:00 +09:00
1c36b5e2e9 Merge branch 'ap-gh-paginate' of https://github.com/apratina/oauth2_proxy into ap-gh-pagination-with-lastpage 2019-10-03 22:34:56 +09: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
2ab8a7d95d Move SessionState to its own package 2019-05-18 13:09:56 +02:00
8ec025f536 Auth and standard logging with file rolling 2019-04-12 08:59:46 -07:00
24f36f27a7 fix: check if it is both primary and verified 2019-03-20 13:52:30 -03:00
6d15fe004e change per_page value from 200 to 100 2019-03-15 08:00:20 -07:00
e73f6501f0 limit => per_page 2019-03-14 20:04:45 -07:00
3c19c364bd add pagination support for /user/teams 2019-03-12 21:24:47 -07:00
b49aeb222b fix: should check if email is verified 2019-03-11 14:52:08 -03:00
e200bd5c20 Add comments to exported methods for providers package 2018-12-20 10:37:59 +00:00
8ee802d4e5 Lint for non-comment linter errors 2018-11-29 14:26:41 +00:00
882fcf0a01 providers: iterate across all pages from /user/orgs github endpoint.
For some GHE instances where a user can have more than 100
organizations, traversing the other pages is important otherwise
oauth2_proxy will consider the user unauthorized. This change traverses
the list returned by the API to avoid that.

Update github provider tests to include this case.
2017-12-04 15:51:48 -05:00
731fa9f8e0 Github provider: use login as user
- Save both user and email in session state:
    Encoding/decoding methods save both email and user
    field in session state, for use cases when User is not derived from
    email's local-parth, like for GitHub provider.

    For retrocompatibility, if no user is obtained by the provider,
    (e.g. User is an empty string) the encoding/decoding methods fall back
    to the previous behavior and use the email's local-part

    Updated also related tests and added two more tests to show behavior
    when session contains a non-empty user value.

- Added first basic GitHub provider tests

- Added GetUserName method to Provider interface
    The new GetUserName method is intended to return the User
    value when this is not the email's local-part.

    Added also the default implementation to provider_default.go

- Added call to GetUserName in redeemCode

    the new GetUserName method is used in redeemCode
    to get SessionState User value.

    For backward compatibility, if GetUserName error is
    "not implemented", the error is ignored.

- Added GetUserName method and tests to github provider.
2017-11-20 20:02:27 +01:00
17b1fa31dd use Authorization header, not access_token query parameter 2017-05-18 03:45:34 +00:00
c566648127 add stripParam and stripToken methods to obfuscate log output 2016-08-02 21:01:44 -06:00
bcb8064831 github: fix github enterprise support 2016-06-20 08:15:07 -04:00
cdebfd6436 base64 cookie support 2016-06-20 07:45:43 -04:00
338e99773a github provider: allow multiple teams 2016-02-17 23:17:08 +01:00
a9cf8b3313 adding enterprise github provider
print the error stack trace

point to my fork in oauthproxy.go

addint pointers to ruta-goomba fork in mulitple files

change api endpoint

replace hard-coded github api endpoint with variables

resetting fall through github urls to point to github.com

fix malformed url

changes to enable use with enterprise github
2016-01-21 21:22:18 +00:00
51a2e4e48c *: rename Url to URL everywhere
Go coding style says that acronyms should be all lower or all upper. Fix
Url to URL.
2015-11-09 00:47:44 +01:00
8da7325683 Update github.go 2015-08-26 00:11:24 +08:00
0692c3763f More robust handling for missing email 2015-07-24 16:26:40 -04:00
c1bf1ad167 github: better debug output for org/team validation 2015-07-24 16:10:10 -04:00
d49c3e167f SessionState refactoring; improve token renewal and cookie refresh
* New SessionState to consolidate email, access token and refresh token
* split ServeHttp into individual methods
* log on session renewal
* log on access token refresh
* refactor cookie encription/decription and session state serialization
2015-07-02 23:09:11 -04:00
f5db2e1ff7 More complete HTTP error logging 2015-06-07 21:03:53 -04:00
a6694ad3c7 github: handle users part of an Org not on a team 2015-06-06 14:44:42 -04:00
37b38dd2f4 Github provider 2015-05-21 02:21:19 -04:00