summaryrefslogtreecommitdiffstats
path: root/modules/auth
diff options
context:
space:
mode:
authorSandro Santilli <strk@kbt.io>2017-03-21 01:55:00 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2017-03-21 08:55:00 +0800
commitf73e7344111645b836e767bbf80b96834651805f (patch)
tree0315cb59a9b56bcb594d2cd4dccf385557e834ba /modules/auth
parent888dee3b5f931062ea97e57130b26d1943e5173e (diff)
downloadgitea-f73e7344111645b836e767bbf80b96834651805f.tar.gz
gitea-f73e7344111645b836e767bbf80b96834651805f.zip
Run "make fmt" with go-1.6 (#1333)
Diffstat (limited to 'modules/auth')
-rw-r--r--modules/auth/openid/discovery_cache.go3
-rw-r--r--modules/auth/openid/discovery_cache_test.go5
-rw-r--r--modules/auth/openid/openid.go4
-rw-r--r--modules/auth/user_form.go2
-rw-r--r--modules/auth/user_form_auth_openid.go4
5 files changed, 7 insertions, 11 deletions
diff --git a/modules/auth/openid/discovery_cache.go b/modules/auth/openid/discovery_cache.go
index cf9f5ae70c..68cd7a8756 100644
--- a/modules/auth/openid/discovery_cache.go
+++ b/modules/auth/openid/discovery_cache.go
@@ -18,7 +18,7 @@ type timedDiscoveredInfo struct {
type timedDiscoveryCache struct {
cache map[string]timedDiscoveredInfo
- ttl time.Duration
+ ttl time.Duration
mutex *sync.Mutex
}
@@ -56,4 +56,3 @@ func (s *timedDiscoveryCache) Get(id string) openid.DiscoveredInfo {
}
return nil
}
-
diff --git a/modules/auth/openid/discovery_cache_test.go b/modules/auth/openid/discovery_cache_test.go
index 9de65a57bb..2e37058cc3 100644
--- a/modules/auth/openid/discovery_cache_test.go
+++ b/modules/auth/openid/discovery_cache_test.go
@@ -9,7 +9,8 @@ import (
"time"
)
-type testDiscoveredInfo struct {}
+type testDiscoveredInfo struct{}
+
func (s *testDiscoveredInfo) ClaimedID() string {
return "claimedID"
}
@@ -21,7 +22,7 @@ func (s *testDiscoveredInfo) OpLocalID() string {
}
func TestTimedDiscoveryCache(t *testing.T) {
- dc := newTimedDiscoveryCache(1*time.Second)
+ dc := newTimedDiscoveryCache(1 * time.Second)
// Put some initial values
dc.Put("foo", &testDiscoveredInfo{}) //openid.opEndpoint: "a", openid.opLocalID: "b", openid.claimedID: "c"})
diff --git a/modules/auth/openid/openid.go b/modules/auth/openid/openid.go
index aebdf15155..ffe0aba2b6 100644
--- a/modules/auth/openid/openid.go
+++ b/modules/auth/openid/openid.go
@@ -17,8 +17,7 @@ import (
// least
// the nonceStore between them.
var nonceStore = openid.NewSimpleNonceStore()
-var discoveryCache = newTimedDiscoveryCache(24*time.Hour)
-
+var discoveryCache = newTimedDiscoveryCache(24 * time.Hour)
// Verify handles response from OpenID provider
func Verify(fullURL string) (id string, err error) {
@@ -34,4 +33,3 @@ func Normalize(url string) (id string, err error) {
func RedirectURL(id, callbackURL, realm string) (string, error) {
return openid.RedirectURL(id, callbackURL, realm)
}
-
diff --git a/modules/auth/user_form.go b/modules/auth/user_form.go
index 9c6e38c460..bac9622fcc 100644
--- a/modules/auth/user_form.go
+++ b/modules/auth/user_form.go
@@ -155,7 +155,7 @@ func (f *ChangePasswordForm) Validate(ctx *macaron.Context, errs binding.Errors)
// AddOpenIDForm is for changing openid uri
type AddOpenIDForm struct {
- Openid string `binding:"Required;MaxSize(256)"`
+ Openid string `binding:"Required;MaxSize(256)"`
}
// Validate validates the fields
diff --git a/modules/auth/user_form_auth_openid.go b/modules/auth/user_form_auth_openid.go
index 582c6dc69f..0ef821dd9e 100644
--- a/modules/auth/user_form_auth_openid.go
+++ b/modules/auth/user_form_auth_openid.go
@@ -9,10 +9,9 @@ import (
"gopkg.in/macaron.v1"
)
-
// SignInOpenIDForm form for signing in with OpenID
type SignInOpenIDForm struct {
- Openid string `binding:"Required;MaxSize(256)"`
+ Openid string `binding:"Required;MaxSize(256)"`
Remember bool
}
@@ -42,4 +41,3 @@ type ConnectOpenIDForm struct {
func (f *ConnectOpenIDForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
-