aboutsummaryrefslogtreecommitdiffstats
path: root/services/auth/source/oauth2
diff options
context:
space:
mode:
Diffstat (limited to 'services/auth/source/oauth2')
-rw-r--r--services/auth/source/oauth2/jwtsigningkey.go2
-rw-r--r--services/auth/source/oauth2/providers.go6
-rw-r--r--services/auth/source/oauth2/providers_openid.go3
-rw-r--r--services/auth/source/oauth2/providers_simple.go1
-rw-r--r--services/auth/source/oauth2/source_callout.go2
5 files changed, 5 insertions, 9 deletions
diff --git a/services/auth/source/oauth2/jwtsigningkey.go b/services/auth/source/oauth2/jwtsigningkey.go
index 187c6999e0..24f2c41119 100644
--- a/services/auth/source/oauth2/jwtsigningkey.go
+++ b/services/auth/source/oauth2/jwtsigningkey.go
@@ -410,7 +410,7 @@ func loadOrCreateAsymmetricKey() (interface{}, error) {
return err
}
- f, err := os.OpenFile(keyPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
+ f, err := os.OpenFile(keyPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600)
if err != nil {
return err
}
diff --git a/services/auth/source/oauth2/providers.go b/services/auth/source/oauth2/providers.go
index 065c6884e0..45851c8799 100644
--- a/services/auth/source/oauth2/providers.go
+++ b/services/auth/source/oauth2/providers.go
@@ -139,10 +139,8 @@ func ClearProviders() {
goth.ClearProviders()
}
-var (
- // ErrAuthSourceNotActived login source is not actived error
- ErrAuthSourceNotActived = errors.New("auth source is not actived")
-)
+// ErrAuthSourceNotActived login source is not actived error
+var ErrAuthSourceNotActived = errors.New("auth source is not actived")
// used to create different types of goth providers
func createProvider(providerName string, source *Source) (goth.Provider, error) {
diff --git a/services/auth/source/oauth2/providers_openid.go b/services/auth/source/oauth2/providers_openid.go
index 838311b4a1..80ee56d4a4 100644
--- a/services/auth/source/oauth2/providers_openid.go
+++ b/services/auth/source/oauth2/providers_openid.go
@@ -13,8 +13,7 @@ import (
)
// OpenIDProvider is a GothProvider for OpenID
-type OpenIDProvider struct {
-}
+type OpenIDProvider struct{}
// Name provides the technical name for this provider
func (o *OpenIDProvider) Name() string {
diff --git a/services/auth/source/oauth2/providers_simple.go b/services/auth/source/oauth2/providers_simple.go
index a4d61eb2f3..0f118b596d 100644
--- a/services/auth/source/oauth2/providers_simple.go
+++ b/services/auth/source/oauth2/providers_simple.go
@@ -107,5 +107,4 @@ func init() {
return microsoftonline.New(clientID, secret, callbackURL, scopes...)
},
))
-
}
diff --git a/services/auth/source/oauth2/source_callout.go b/services/auth/source/oauth2/source_callout.go
index 8596dd187d..7447e5d453 100644
--- a/services/auth/source/oauth2/source_callout.go
+++ b/services/auth/source/oauth2/source_callout.go
@@ -18,7 +18,7 @@ func (source *Source) Callout(request *http.Request, response http.ResponseWrite
// don't use the default gothic begin handler to prevent issues when some error occurs
// normally the gothic library will write some custom stuff to the response instead of our own nice error page
- //gothic.BeginAuthHandler(response, request)
+ // gothic.BeginAuthHandler(response, request)
gothRWMutex.RLock()
defer gothRWMutex.RUnlock()