reverting formatting changes
This commit is contained in:
parent
8b5b97c399
commit
8600d79ff5
|
|
@ -12,6 +12,7 @@ import (
|
|||
"golang.org/x/exp/slices"
|
||||
|
||||
"github.com/bitly/go-simplejson"
|
||||
|
||||
"github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/options"
|
||||
"github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/sessions"
|
||||
"github.com/oauth2-proxy/oauth2-proxy/v7/pkg/logger"
|
||||
|
|
|
|||
|
|
@ -227,11 +227,14 @@ func (p *GitHubProvider) hasRepoAccess(ctx context.Context, accessToken string)
|
|||
Pull bool `json:"pull"`
|
||||
Push bool `json:"push"`
|
||||
}
|
||||
|
||||
type repository struct {
|
||||
Permissions permissions `json:"permissions"`
|
||||
Private bool `json:"private"`
|
||||
}
|
||||
|
||||
endpoint := p.makeGitHubAPIEndpoint("/repos/"+p.Repo, nil)
|
||||
|
||||
var repo repository
|
||||
err := requests.New(endpoint.String()).
|
||||
WithContext(ctx).
|
||||
|
|
@ -309,6 +312,7 @@ func (p *GitHubProvider) getEmail(ctx context.Context, s *sessions.SessionState)
|
|||
}
|
||||
|
||||
endpoint := p.makeGitHubAPIEndpoint("/user/emails", nil)
|
||||
|
||||
err := requests.New(endpoint.String()).
|
||||
WithContext(ctx).
|
||||
WithHeaders(makeGitHubHeader(s.AccessToken)).
|
||||
|
|
@ -359,7 +363,6 @@ func (p *GitHubProvider) getUser(ctx context.Context, s *sessions.SessionState)
|
|||
return nil
|
||||
}
|
||||
|
||||
// isVerifiedUser
|
||||
func (p *GitHubProvider) isVerifiedUser(username string) bool {
|
||||
for _, u := range p.Users {
|
||||
if username == u {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ func NewGitLabProvider(p *ProviderData, opts options.Provider) (*GitLabProvider,
|
|||
p.setProviderDefaults(providerDefaults{
|
||||
name: gitlabProviderName,
|
||||
})
|
||||
|
||||
if p.Scope == "" {
|
||||
p.Scope = gitlabDefaultScope
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ func NewNextcloudProvider(p *ProviderData) *NextcloudProvider {
|
|||
p.setProviderDefaults(providerDefaults{
|
||||
name: nextCloudProviderName,
|
||||
})
|
||||
|
||||
p.getAuthorizationHeaderFunc = makeOIDCHeader
|
||||
if p.EmailClaim == options.OIDCEmailClaim {
|
||||
// This implies the email claim has not been overridden, we should set a default
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ func TestOIDCProviderRedeem(t *testing.T) {
|
|||
RefreshToken: refreshToken,
|
||||
IDToken: idToken,
|
||||
})
|
||||
|
||||
server, provider := newTestOIDCSetup(body, []byte(`{}`), []byte(`{}`))
|
||||
defer server.Close()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue