git.iko.soy/typeable/oauth2-proxy
on master help sign in
Corrects request endpoint (#1650)
fc686aeadamsong
CHANGELOG.md+1
@@ -41,6 +41,7 @@ If you are using an architecture specific tag (ex: v7.2.1-arm64) you should move
41- [#1594](https://github.com/oauth2-proxy/oauth2-proxy/pull/1594) Release ARMv8 docker images (@braunsonm)
41- [#1594](https://github.com/oauth2-proxy/oauth2-proxy/pull/1594) Release ARMv8 docker images (@braunsonm)
42- [#1649](https://github.com/oauth2-proxy/oauth2-proxy/pull/1649) Return a 400 instead of a 500 when a request contains an invalid redirect target (@niksko)
42- [#1649](https://github.com/oauth2-proxy/oauth2-proxy/pull/1649) Return a 400 instead of a 500 when a request contains an invalid redirect target (@niksko)
43- [#1638](https://github.com/oauth2-proxy/oauth2-proxy/pull/1638) Implement configurable upstream timeout (@jacksgt)
43- [#1638](https://github.com/oauth2-proxy/oauth2-proxy/pull/1638) Implement configurable upstream timeout (@jacksgt)
44+- [#1650](https://github.com/oauth2-proxy/oauth2-proxy/pull/1650) Fixed 500 when checking if user has repo (@adamsong)
44- [#1635](https://github.com/oauth2-proxy/oauth2-proxy/pull/1635) Added description and unit tests for ipv6 address (@t-katsumura)
45- [#1635](https://github.com/oauth2-proxy/oauth2-proxy/pull/1635) Added description and unit tests for ipv6 address (@t-katsumura)
45
46
46# V7.2.1
47# V7.2.1
providers/github.go+1−1
@@ -312,7 +312,7 @@ func (p *GitHubProvider) hasRepo(ctx context.Context, accessToken string) (bool,
312 endpoint := &url.URL{
312 endpoint := &url.URL{
313 Scheme: p.ValidateURL.Scheme,
313 Scheme: p.ValidateURL.Scheme,
314 Host: p.ValidateURL.Host,
314 Host: p.ValidateURL.Host,
315− Path: path.Join(p.ValidateURL.Path, "/repo/", p.Repo),
315+ Path: path.Join(p.ValidateURL.Path, "/repos/", p.Repo),
316 }
316 }
317
317
318 var repo repository
318 var repo repository
providers/github_test.go+2−2
@@ -34,7 +34,7 @@ func testGitHubProvider(hostname string, opts options.GitHubOptions) *GitHubProv
34
34
35func testGitHubBackend(payloads map[string][]string) *httptest.Server {
35func testGitHubBackend(payloads map[string][]string) *httptest.Server {
36 pathToQueryMap := map[string][]string{
36 pathToQueryMap := map[string][]string{
37− "/repo/oauth2-proxy/oauth2-proxy": {""},
37+ "/repos/oauth2-proxy/oauth2-proxy": {""},
38 "/repos/oauth2-proxy/oauth2-proxy/collaborators/mbland": {""},
38 "/repos/oauth2-proxy/oauth2-proxy/collaborators/mbland": {""},
39 "/user": {""},
39 "/user": {""},
40 "/user/emails": {""},
40 "/user/emails": {""},
@@ -229,7 +229,7 @@ func TestGitHubProvider_getEmailWithWriteAccessToPrivateRepo(t *testing.T) {
229
229
230func TestGitHubProvider_getEmailWithNoAccessToPrivateRepo(t *testing.T) {
230func TestGitHubProvider_getEmailWithNoAccessToPrivateRepo(t *testing.T) {
231 b := testGitHubBackend(map[string][]string{
231 b := testGitHubBackend(map[string][]string{
232− "/repo/oauth2-proxy/oauth2-proxy": {`{}`},
232+ "/repos/oauth2-proxy/oauth2-proxy": {`{}`},
233 })
233 })
234 defer b.Close()
234 defer b.Close()
235
235