Update authorization for PAT to be Bearer as documented (#3039)
This commit is contained in:
parent
62eca94e45
commit
2646456677
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
"encoding/base64"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
@ -835,8 +834,7 @@ func (c *Client) getRunnerRegistrationToken(ctx context.Context) (*registrationT
|
||||||
bearerToken := ""
|
bearerToken := ""
|
||||||
|
|
||||||
if c.creds.Token != "" {
|
if c.creds.Token != "" {
|
||||||
encodedToken := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("github:%v", c.creds.Token)))
|
bearerToken = fmt.Sprintf("Bearer %v", c.creds.Token)
|
||||||
bearerToken = fmt.Sprintf("Basic %v", encodedToken)
|
|
||||||
} else {
|
} else {
|
||||||
accessToken, err := c.fetchAccessToken(ctx, c.config.ConfigURL.String(), c.creds.AppCreds)
|
accessToken, err := c.fetchAccessToken(ctx, c.config.ConfigURL.String(), c.creds.AppCreds)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue