Skip to content

Commit

Permalink
fmt: run goimports
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas authored and arekkas committed Jul 9, 2017
1 parent 361b368 commit 35941c2
Show file tree
Hide file tree
Showing 12 changed files with 6,190 additions and 34 deletions.
3 changes: 2 additions & 1 deletion access_request_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"net/http"
"strings"

"github.com/pkg/errors"
"net/url"

"github.com/pkg/errors"
)

// Implements
Expand Down
20 changes: 10 additions & 10 deletions compose/compose_oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
// an access token, refresh token and authorize code validator.
func OAuth2AuthorizeExplicitFactory(config *Config, storage interface{}, strategy interface{}) interface{} {
return &oauth2.AuthorizeExplicitGrantHandler{
AccessTokenStrategy: strategy.(oauth2.AccessTokenStrategy),
RefreshTokenStrategy: strategy.(oauth2.RefreshTokenStrategy),
AuthorizeCodeStrategy: strategy.(oauth2.AuthorizeCodeStrategy),
CoreStorage: storage.(oauth2.CoreStorage),
AuthCodeLifespan: config.GetAuthorizeCodeLifespan(),
AccessTokenLifespan: config.GetAccessTokenLifespan(),
ScopeStrategy: config.GetScopeStrategy(),
AccessTokenStrategy: strategy.(oauth2.AccessTokenStrategy),
RefreshTokenStrategy: strategy.(oauth2.RefreshTokenStrategy),
AuthorizeCodeStrategy: strategy.(oauth2.AuthorizeCodeStrategy),
CoreStorage: storage.(oauth2.CoreStorage),
AuthCodeLifespan: config.GetAuthorizeCodeLifespan(),
AccessTokenLifespan: config.GetAccessTokenLifespan(),
ScopeStrategy: config.GetScopeStrategy(),
}
}

Expand All @@ -35,10 +35,10 @@ func OAuth2ClientCredentialsGrantFactory(config *Config, storage interface{}, st
// an access token, refresh token and authorize code validator.
func OAuth2RefreshTokenGrantFactory(config *Config, storage interface{}, strategy interface{}) interface{} {
return &oauth2.RefreshTokenGrantHandler{
AccessTokenStrategy: strategy.(oauth2.AccessTokenStrategy),
RefreshTokenStrategy: strategy.(oauth2.RefreshTokenStrategy),
AccessTokenStrategy: strategy.(oauth2.AccessTokenStrategy),
RefreshTokenStrategy: strategy.(oauth2.RefreshTokenStrategy),
TokenRevocationStorage: storage.(oauth2.TokenRevocationStorage),
AccessTokenLifespan: config.GetAccessTokenLifespan(),
AccessTokenLifespan: config.GetAccessTokenLifespan(),
}
}

Expand Down
12 changes: 6 additions & 6 deletions compose/compose_openid.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ func OpenIDConnectImplicitFactory(config *Config, storage interface{}, strategy
func OpenIDConnectHybridFactory(config *Config, storage interface{}, strategy interface{}) interface{} {
return &openid.OpenIDConnectHybridHandler{
AuthorizeExplicitGrantHandler: &oauth2.AuthorizeExplicitGrantHandler{
AccessTokenStrategy: strategy.(oauth2.AccessTokenStrategy),
RefreshTokenStrategy: strategy.(oauth2.RefreshTokenStrategy),
AuthorizeCodeStrategy: strategy.(oauth2.AuthorizeCodeStrategy),
CoreStorage: storage.(oauth2.CoreStorage),
AuthCodeLifespan: config.GetAuthorizeCodeLifespan(),
AccessTokenLifespan: config.GetAccessTokenLifespan(),
AccessTokenStrategy: strategy.(oauth2.AccessTokenStrategy),
RefreshTokenStrategy: strategy.(oauth2.RefreshTokenStrategy),
AuthorizeCodeStrategy: strategy.(oauth2.AuthorizeCodeStrategy),
CoreStorage: storage.(oauth2.CoreStorage),
AuthCodeLifespan: config.GetAuthorizeCodeLifespan(),
AccessTokenLifespan: config.GetAccessTokenLifespan(),
},
ScopeStrategy: config.GetScopeStrategy(),
AuthorizeImplicitGrantTypeHandler: &oauth2.AuthorizeImplicitGrantTypeHandler{
Expand Down
3 changes: 2 additions & 1 deletion compose/config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package compose

import (
"github.com/ory/fosite"
"time"

"github.com/ory/fosite"
)

type Config struct {
Expand Down
1,026 changes: 1,026 additions & 0 deletions coverage.tmp

Large diffs are not rendered by default.

5,125 changes: 5,125 additions & 0 deletions coverage.txt

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion equalKeys_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package fosite_test

import (
"testing"

"github.com/oleiade/reflections"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
)

func TestAssertObjectsAreEqualByKeys(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions handler/openid/flow_hybrid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ func TestHybrid_HandleAuthorizeEndpointRequest(t *testing.T) {
areq := fosite.NewAuthorizeRequest()
h := OpenIDConnectHybridHandler{
AuthorizeExplicitGrantHandler: &oauth2.AuthorizeExplicitGrantHandler{
AuthorizeCodeStrategy: hmacStrategy,
AccessTokenLifespan: time.Hour,
AuthCodeLifespan: time.Hour,
AccessTokenStrategy: hmacStrategy,
CoreStorage: storage.NewMemoryStore(),
AuthorizeCodeStrategy: hmacStrategy,
AccessTokenLifespan: time.Hour,
AuthCodeLifespan: time.Hour,
AccessTokenStrategy: hmacStrategy,
CoreStorage: storage.NewMemoryStore(),
},
AuthorizeImplicitGrantTypeHandler: &oauth2.AuthorizeImplicitGrantTypeHandler{
AccessTokenLifespan: time.Hour,
Expand Down
3 changes: 2 additions & 1 deletion handler/openid/flow_refresh_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package openid
import (
"context"

"time"

"github.com/ory/fosite"
"github.com/pkg/errors"
"time"
)

type OpenIDConnectRefreshHandler struct {
Expand Down
6 changes: 3 additions & 3 deletions handler/openid/strategy_jwt.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package openid

import (
"time"
"context"
"time"

"github.com/mohae/deepcopy"
"github.com/ory/fosite"
"github.com/ory/fosite/token/jwt"
"github.com/pkg/errors"
"github.com/mohae/deepcopy"
"github.com/pborman/uuid"
"github.com/pkg/errors"
)

const defaultExpiryTime = time.Hour
Expand Down
12 changes: 6 additions & 6 deletions integration/refresh_token_grant_test.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package integration_test

import (
"testing"
"net/http"
"testing"
"time"

"github.com/ory/fosite/compose"
"github.com/ory/fosite/handler/openid"
"github.com/ory/fosite/internal"
"github.com/ory/fosite/token/jwt"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/oauth2"
"github.com/ory/fosite/internal"
"github.com/ory/fosite/handler/openid"
"github.com/ory/fosite/token/jwt"
)

func TestRefreshTokenFlow(t *testing.T) {
Expand All @@ -38,10 +38,10 @@ func TestRefreshTokenFlow(t *testing.T) {
}{
{
description: "should fail because refresh scope missing",
setup: func() {
setup: func() {
oauthClient.Scopes = []string{"fosite"}
},
pass: false,
pass: false,
},
{
description: "should pass but not yield id token",
Expand Down
1 change: 1 addition & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fosite

import (
"time"

"github.com/mohae/deepcopy"
)

Expand Down

0 comments on commit 35941c2

Please sign in to comment.