OAuth2 GHE Always Register BustedURL
When going through the oauth2 module in go, there is a list of "busted" URLs which don't implement OAuth2 properly. Github is on that list, however Github Enterprise(GHE) uses different URLs for each instance. Instead of adding all of these to the global list in the oauth module, we can simply flag all of our tokens as broken until github updates their API.
This commit is contained in:
parent
e932bc8871
commit
5b58768d63
1 changed files with 3 additions and 0 deletions
|
@ -67,6 +67,9 @@ func New(opts Opts) (remote.Remote, error) {
|
||||||
remote.URL = strings.TrimSuffix(opts.URL, "/")
|
remote.URL = strings.TrimSuffix(opts.URL, "/")
|
||||||
remote.API = remote.URL + "/api/v3/"
|
remote.API = remote.URL + "/api/v3/"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hack to enable oauth2 access in older GHE
|
||||||
|
oauth2.RegisterBrokenAuthHeaderProvider(remote.URL)
|
||||||
return remote, nil
|
return remote, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue