Commit Graph
20 Commits
Author SHA1 Message Date
Jan Larwig 13af1b4786 fix gitea token validation by allowing custom validation url and extracting the proper base api url for github cloud, github enterprise and gitea (#2194) 2023-09-14 10:09:57 +01:00
adamsongandJoel Speed fc686ae95c Corrects request endpoint (#1650)
* Fixes typo in repo endpoint

* Update CHANGELOG.md

* Fix the test to mock the correct endpoint

Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
2022-05-25 20:05:12 +01:00
Joel Speed d162b018a8 Move provider initialisation into providers package 2022-02-16 10:38:05 +00:00
Nick Meves e51f5fe7c9 Refactor GitHub to EnrichSessionState 2020-10-19 14:09:45 -07: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 d4dd34a65a Move provider URLs to package level vars 2020-07-19 18:34:55 +01:00
Yoshiki NakagawaandJoel Speed 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
John Clayton 7cf685140b Restrict access using Github collaborators (#497)
* Allow access based on Github repository
2020-05-11 18:02:40 +01:00
Mitsuo HeijoandHenry Jenkins e642daef4e Support context in providers (#519)
Co-authored-by: Henry Jenkins <henry@henryjenkins.name>
2020-05-10 13:34:59 +01:00
Joel Speed 802754caad Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
siarhei.navatski dec3647669 Fix linting error about const 2020-01-22 13:57:00 +03:00
toshi-miura 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
Joel Speed 2ab8a7d95d Move SessionState to its own package 2019-05-18 13:09:56 +02:00
Carlos Alexandro Becker 24f36f27a7 fix: check if it is both primary and verified 2019-03-20 13:52:30 -03:00
Akshay Pratinav 6d15fe004e change per_page value from 200 to 100 2019-03-15 08:00:20 -07:00
Akshay Pratinav e73f6501f0 limit => per_page 2019-03-14 20:04:45 -07:00
Carlos Alexandro Becker b49aeb222b fix: should check if email is verified 2019-03-11 14:52:08 -03:00
Joel Speed 8ee802d4e5 Lint for non-comment linter errors 2018-11-29 14:26:41 +00:00
Mark Maglana 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
Carlo Lobrano 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