1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-17 00:17:40 +02:00

Add new linters (#486)

* add new linters and fix issues

* fix deprecated warnings

* simplify return

* update CHANGELOG

* fix staticcheck issues

* remove a deprecated linter, minor fixes of variable initialization
This commit is contained in:
Mitsuo Heijo
2020-04-14 17:36:44 +09:00
committed by GitHub
parent 4341ab4420
commit dd05e7ff0b
21 changed files with 88 additions and 79 deletions

View File

@ -2,6 +2,7 @@ package providers
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"errors"
@ -15,10 +16,10 @@ import (
"github.com/oauth2-proxy/oauth2-proxy/pkg/apis/sessions"
"github.com/oauth2-proxy/oauth2-proxy/pkg/logger"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
admin "google.golang.org/api/admin/directory/v1"
"google.golang.org/api/googleapi"
"google.golang.org/api/option"
)
// GoogleProvider represents an Google based Identity Provider
@ -184,8 +185,9 @@ func getAdminService(adminEmail string, credentialsReader io.Reader) *admin.Serv
}
conf.Subject = adminEmail
client := conf.Client(oauth2.NoContext)
adminService, err := admin.New(client)
ctx := context.Background()
client := conf.Client(ctx)
adminService, err := admin.NewService(ctx, option.WithHTTPClient(client))
if err != nil {
logger.Fatal(err)
}