mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-30 05:41:12 +00:00
added scopes to the oauth2 config
This commit is contained in:
parent
18feb303c2
commit
d9c369bdc7
1 changed files with 3 additions and 2 deletions
|
@ -53,7 +53,7 @@ func New(opts Opts) (remote.Remote, error) {
|
||||||
URL: defaultURL,
|
URL: defaultURL,
|
||||||
Client: opts.Client,
|
Client: opts.Client,
|
||||||
Secret: opts.Secret,
|
Secret: opts.Secret,
|
||||||
Scope: strings.Join(opts.Scopes, ","),
|
Scopes: opts.Scopes,
|
||||||
PrivateMode: opts.PrivateMode,
|
PrivateMode: opts.PrivateMode,
|
||||||
SkipVerify: opts.SkipVerify,
|
SkipVerify: opts.SkipVerify,
|
||||||
MergeRef: opts.MergeRef,
|
MergeRef: opts.MergeRef,
|
||||||
|
@ -73,7 +73,7 @@ type client struct {
|
||||||
API string
|
API string
|
||||||
Client string
|
Client string
|
||||||
Secret string
|
Secret string
|
||||||
Scope string
|
Scopes []string
|
||||||
Machine string
|
Machine string
|
||||||
Username string
|
Username string
|
||||||
Password string
|
Password string
|
||||||
|
@ -261,6 +261,7 @@ func (c *client) newConfig(redirect string) *oauth2.Config {
|
||||||
return &oauth2.Config{
|
return &oauth2.Config{
|
||||||
ClientID: c.Client,
|
ClientID: c.Client,
|
||||||
ClientSecret: c.Secret,
|
ClientSecret: c.Secret,
|
||||||
|
Scopes: c.Scopes,
|
||||||
Endpoint: oauth2.Endpoint{
|
Endpoint: oauth2.Endpoint{
|
||||||
AuthURL: fmt.Sprintf("%s/login/oauth/authorize", c.URL),
|
AuthURL: fmt.Sprintf("%s/login/oauth/authorize", c.URL),
|
||||||
TokenURL: fmt.Sprintf("%s/login/oauth/access_token", c.URL),
|
TokenURL: fmt.Sprintf("%s/login/oauth/access_token", c.URL),
|
||||||
|
|
Loading…
Reference in a new issue