Skip to content

Commit

Permalink
Merge pull request #476 from markbates/update-github-actions
Browse files Browse the repository at this point in the history
update github actions
  • Loading branch information
techknowlogick authored Oct 17, 2022
2 parents 4eb5389 + 82bfa37 commit 45d69da
Show file tree
Hide file tree
Showing 58 changed files with 169 additions and 163 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Restore cache
uses: actions/cache@v2
with:
Expand All @@ -31,6 +31,6 @@ jobs:
${{ runner.os }}-go-
- name: Format
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
if: matrix.os != 'windows-latest'
if: matrix.os != 'windows-latest' && matrix.go-version == '1.19.x'
- name: Test
run: go test -race ./...
4 changes: 2 additions & 2 deletions providers/amazon/amazon.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ func userFromReader(r io.Reader, user *goth.User) error {
return nil
}

//RefreshTokenAvailable refresh token is provided by auth provider or not
// RefreshTokenAvailable refresh token is provided by auth provider or not
func (p *Provider) RefreshTokenAvailable() bool {
return true
}

//RefreshToken get new access token based on the refresh token
// RefreshToken get new access token based on the refresh token
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
token := &oauth2.Token{RefreshToken: refreshToken}
ts := p.config.TokenSource(goth.ContextForClient(p.Client()), token)
Expand Down
4 changes: 2 additions & 2 deletions providers/auth0/auth0.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ func userFromReader(r io.Reader, user *goth.User) error {
return nil
}

//RefreshTokenAvailable refresh token is provided by auth provider or not
// RefreshTokenAvailable refresh token is provided by auth provider or not
func (p *Provider) RefreshTokenAvailable() bool {
return true
}

//RefreshToken get new access token based on the refresh token
// RefreshToken get new access token based on the refresh token
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
token := &oauth2.Token{RefreshToken: refreshToken}
ts := p.config.TokenSource(oauth2.NoContext, token)
Expand Down
4 changes: 2 additions & 2 deletions providers/azuread/azuread.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
return user, err
}

//RefreshTokenAvailable refresh token is provided by auth provider or not
// RefreshTokenAvailable refresh token is provided by auth provider or not
func (p *Provider) RefreshTokenAvailable() bool {
return true
}

//RefreshToken get new access token based on the refresh token
// RefreshToken get new access token based on the refresh token
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
token := &oauth2.Token{RefreshToken: refreshToken}
ts := p.config.TokenSource(goth.ContextForClient(p.Client()), token)
Expand Down
4 changes: 2 additions & 2 deletions providers/azureadv2/azureadv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
return user, err
}

//RefreshTokenAvailable refresh token is provided by auth provider or not
// RefreshTokenAvailable refresh token is provided by auth provider or not
func (p *Provider) RefreshTokenAvailable() bool {
return true
}

//RefreshToken get new access token based on the refresh token
// RefreshToken get new access token based on the refresh token
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
token := &oauth2.Token{RefreshToken: refreshToken}
ts := p.config.TokenSource(goth.ContextForClient(p.Client()), token)
Expand Down
83 changes: 43 additions & 40 deletions providers/azureadv2/scopes.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,19 @@ const (
// roles, directory settings, policy, and many more.
//
// The Directory.ReadWrite.All permission grants the following privileges:
// - Full read of all directory resources (both declared properties and navigation properties)
// - Create and update users
// - Disable and enable users (but not company administrator)
// - Set user alternative security id (but not administrators)
// - Create and update groups
// - Manage group memberships
// - Update group owner
// - Manage license assignments
// - Define schema extensions on applications
// - Note: No rights to reset user passwords
// - Note: No rights to delete resources (including users or groups)
// - Note: Specifically excludes create or update for resources not listed above. This includes: application,
// oAauth2Permissiongrant, appRoleAssignment, device, servicePrincipal, organization, domains, and so on.
// - Full read of all directory resources (both declared properties and navigation properties)
// - Create and update users
// - Disable and enable users (but not company administrator)
// - Set user alternative security id (but not administrators)
// - Create and update groups
// - Manage group memberships
// - Update group owner
// - Manage license assignments
// - Define schema extensions on applications
// - Note: No rights to reset user passwords
// - Note: No rights to delete resources (including users or groups)
// - Note: Specifically excludes create or update for resources not listed above. This includes: application,
// oAauth2Permissiongrant, appRoleAssignment, device, servicePrincipal, organization, domains, and so on.
//
// See also https://developer.microsoft.com/en-us/graph/docs/concepts/permissions_reference
const (
Expand Down Expand Up @@ -615,30 +615,32 @@ const (
// For work or school accounts, the full profile includes all of the declared properties of the User resource. On reads,
// only a limited number of properties are returned by default. To read properties that are not in the default set, use
// $select. The default properties are:
// displayName
// givenName
// jobTitle
// mail
// mobilePhone
// officeLocation
// preferredLanguage
// surname
// userPrincipalName
//
// displayName
// givenName
// jobTitle
// mail
// mobilePhone
// officeLocation
// preferredLanguage
// surname
// userPrincipalName
//
// User.ReadWrite and User.Readwrite.All delegated permissions allow the app to update the following profile properties
// for work or school accounts:
// aboutMe
// birthday
// hireDate
// interests
// mobilePhone
// mySite
// pastProjects
// photo
// preferredName
// responsibilities
// schools
// skills
//
// aboutMe
// birthday
// hireDate
// interests
// mobilePhone
// mySite
// pastProjects
// photo
// preferredName
// responsibilities
// schools
// skills
//
// With the User.ReadWrite.All application permission, the app can update all of the declared properties of work or
// school accounts except for password.
Expand All @@ -649,12 +651,13 @@ const (
// The User.ReadBasic.All permission constrains app access to a limited set of properties known as the basic profile.
// This is because the full profile might contain sensitive directory information. The basic profile includes only the
// following properties:
// displayName
// givenName
// mail
// photo
// surname
// userPrincipalName
//
// displayName
// givenName
// mail
// photo
// surname
// userPrincipalName
//
// To read the group memberships of a user (memberOf), the app must have either Group.Read.All or Group.ReadWrite.All.
// However, if the user also has membership in a directoryRole or an administrativeUnit, the app will need effective
Expand Down
4 changes: 2 additions & 2 deletions providers/battlenet/battlenet.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ func newConfig(provider *Provider, scopes []string) *oauth2.Config {
return c
}

//RefreshTokenAvailable refresh token is provided by auth provider or not
// RefreshTokenAvailable refresh token is provided by auth provider or not
func (p *Provider) RefreshTokenAvailable() bool {
return false
}

//RefreshToken get new access token based on the refresh token
// RefreshToken get new access token based on the refresh token
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
return nil, nil
}
4 changes: 2 additions & 2 deletions providers/bitbucket/bitbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ func newConfig(provider *Provider, scopes []string) *oauth2.Config {
return c
}

//RefreshTokenAvailable refresh token is provided by auth provider or not
// RefreshTokenAvailable refresh token is provided by auth provider or not
func (p *Provider) RefreshTokenAvailable() bool {
return true
}

//RefreshToken get new access token based on the refresh token
// RefreshToken get new access token based on the refresh token
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
token := &oauth2.Token{RefreshToken: refreshToken}
ts := p.config.TokenSource(goth.ContextForClient(p.Client()), token)
Expand Down
4 changes: 2 additions & 2 deletions providers/box/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ func userFromReader(r io.Reader, user *goth.User) error {
return nil
}

//RefreshTokenAvailable refresh token is provided by auth provider or not
// RefreshTokenAvailable refresh token is provided by auth provider or not
func (p *Provider) RefreshTokenAvailable() bool {
return true
}

//RefreshToken get new access token based on the refresh token
// RefreshToken get new access token based on the refresh token
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
token := &oauth2.Token{RefreshToken: refreshToken}
ts := p.config.TokenSource(goth.ContextForClient(p.Client()), token)
Expand Down
4 changes: 2 additions & 2 deletions providers/cloudfoundry/cf.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ func userFromReader(r io.Reader, user *goth.User) error {
return nil
}

//RefreshTokenAvailable refresh token is provided by auth provider or not
// RefreshTokenAvailable refresh token is provided by auth provider or not
func (p *Provider) RefreshTokenAvailable() bool {
return true
}

//RefreshToken get new access token based on the refresh token
// RefreshToken get new access token based on the refresh token
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
token := &oauth2.Token{RefreshToken: refreshToken}
ctx := context.WithValue(goth.ContextForClient(p.Client()), oauth2.HTTPClient, goth.HTTPClientWithFallBack(p.Client()))
Expand Down
4 changes: 2 additions & 2 deletions providers/deezer/deezer.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ func newConfig(provider *Provider, scopes []string) *oauth2.Config {
return c
}

//RefreshTokenAvailable refresh token is not provided by deezer
// RefreshTokenAvailable refresh token is not provided by deezer
func (p *Provider) RefreshTokenAvailable() bool {
return false
}

//RefreshToken refresh token is not provided by deezer
// RefreshToken refresh token is not provided by deezer
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
return nil, errors.New("Refresh token is not provided by deezer")
}
4 changes: 2 additions & 2 deletions providers/digitalocean/digitalocean.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ func newConfig(provider *Provider, scopes []string) *oauth2.Config {
return c
}

//RefreshTokenAvailable refresh token is provided by auth provider or not
// RefreshTokenAvailable refresh token is provided by auth provider or not
func (p *Provider) RefreshTokenAvailable() bool {
return true
}

//RefreshToken get new access token based on the refresh token
// RefreshToken get new access token based on the refresh token
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
token := &oauth2.Token{RefreshToken: refreshToken}
ts := p.config.TokenSource(goth.ContextForClient(p.Client()), token)
Expand Down
4 changes: 2 additions & 2 deletions providers/dropbox/dropbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ func userFromReader(r io.Reader, user *goth.User) error {
return nil
}

//RefreshToken refresh token is not provided by dropbox
// RefreshToken refresh token is not provided by dropbox
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
return nil, errors.New("Refresh token is not provided by dropbox")
}

//RefreshTokenAvailable refresh token is not provided by dropbox
// RefreshTokenAvailable refresh token is not provided by dropbox
func (p *Provider) RefreshTokenAvailable() bool {
return false
}
4 changes: 2 additions & 2 deletions providers/eveonline/eveonline.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ func newConfig(provider *Provider, scopes []string) *oauth2.Config {
return c
}

//RefreshTokenAvailable refresh token is provided by auth provider or not
// RefreshTokenAvailable refresh token is provided by auth provider or not
func (p *Provider) RefreshTokenAvailable() bool {
return true
}

//RefreshToken get new access token based on the refresh token
// RefreshToken get new access token based on the refresh token
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
token := &oauth2.Token{RefreshToken: refreshToken}
ts := p.config.TokenSource(goth.ContextForClient(p.Client()), token)
Expand Down
4 changes: 2 additions & 2 deletions providers/facebook/facebook.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ func newConfig(provider *Provider, scopes []string) *oauth2.Config {
return c
}

//RefreshToken refresh token is not provided by facebook
// RefreshToken refresh token is not provided by facebook
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
return nil, errors.New("Refresh token is not provided by facebook")
}

//RefreshTokenAvailable refresh token is not provided by facebook
// RefreshTokenAvailable refresh token is not provided by facebook
func (p *Provider) RefreshTokenAvailable() bool {
return false
}
4 changes: 2 additions & 2 deletions providers/faux/faux.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ func (p *Provider) Client() *http.Client {
// Debug is used only for testing.
func (p *Provider) Debug(debug bool) {}

//RefreshTokenAvailable is used only for testing
// RefreshTokenAvailable is used only for testing
func (p *Provider) RefreshTokenAvailable() bool {
return false
}

//RefreshToken is used only for testing
// RefreshToken is used only for testing
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
return nil, nil
}
Expand Down
4 changes: 2 additions & 2 deletions providers/fitbit/fitbit.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func newConfig(provider *Provider, scopes []string) *oauth2.Config {
return c
}

//RefreshToken get new access token based on the refresh token
// RefreshToken get new access token based on the refresh token
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
token := &oauth2.Token{RefreshToken: refreshToken}
ts := p.config.TokenSource(oauth2.NoContext, token)
Expand All @@ -189,7 +189,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
return newToken, err
}

//RefreshTokenAvailable refresh token is not provided by fitbit
// RefreshTokenAvailable refresh token is not provided by fitbit
func (p *Provider) RefreshTokenAvailable() bool {
return true
}
5 changes: 3 additions & 2 deletions providers/gitea/gitea.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
// These vars define the default Authentication, Token, and Profile URLS for Gitea.
//
// Examples:
//
// gitea.AuthURL = "https://gitea.acme.com/oauth/authorize
// gitea.TokenURL = "https://gitea.acme.com/oauth/token
// gitea.ProfileURL = "https://gitea.acme.com/api/v3/user
Expand Down Expand Up @@ -169,12 +170,12 @@ func userFromReader(r io.Reader, user *goth.User) error {
return nil
}

//RefreshTokenAvailable refresh token is provided by auth provider or not
// RefreshTokenAvailable refresh token is provided by auth provider or not
func (p *Provider) RefreshTokenAvailable() bool {
return true
}

//RefreshToken get new access token based on the refresh token
// RefreshToken get new access token based on the refresh token
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
token := &oauth2.Token{RefreshToken: refreshToken}
ts := p.config.TokenSource(goth.ContextForClient(p.Client()), token)
Expand Down
5 changes: 3 additions & 2 deletions providers/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
// using GitHub enterprise you should change these values before calling New.
//
// Examples:
//
// github.AuthURL = "https://github.acme.com/login/oauth/authorize
// github.TokenURL = "https://github.acme.com/login/oauth/access_token
// github.ProfileURL = "https://github.acme.com/api/v3/user
Expand Down Expand Up @@ -228,12 +229,12 @@ func newConfig(provider *Provider, authURL, tokenURL string, scopes []string) *o
return c
}

//RefreshToken refresh token is not provided by github
// RefreshToken refresh token is not provided by github
func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) {
return nil, errors.New("Refresh token is not provided by github")
}

//RefreshTokenAvailable refresh token is not provided by github
// RefreshTokenAvailable refresh token is not provided by github
func (p *Provider) RefreshTokenAvailable() bool {
return false
}
Loading

0 comments on commit 45d69da

Please sign in to comment.