Skip to content

Commit

Permalink
all: Rearrange commits with goreturns
Browse files Browse the repository at this point in the history
Signed-off-by: aeneasr <[email protected]>
  • Loading branch information
aeneasr committed Oct 24, 2018
1 parent f97e451 commit 211b43b
Show file tree
Hide file tree
Showing 113 changed files with 323 additions and 295 deletions.
8 changes: 4 additions & 4 deletions access_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ package fosite_test

import (
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"testing"

"fmt"

"github.com/golang/mock/gomock"
. "github.com/ory/fosite"
. "github.com/ory/fosite/internal"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

. "github.com/ory/fosite"
. "github.com/ory/fosite/internal"
)

func TestWriteAccessError(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions access_request_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@
package fosite_test

import (
"context"
"encoding/base64"
"fmt"
"net/http"
"net/url"
"testing"

"context"

"github.com/golang/mock/gomock"
. "github.com/ory/fosite"
"github.com/ory/fosite/internal"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

. "github.com/ory/fosite"
"github.com/ory/fosite/internal"
)

func TestNewAccessRequest(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion access_response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ package fosite_test
import (
"testing"

. "github.com/ory/fosite"
"github.com/stretchr/testify/assert"

. "github.com/ory/fosite"
)

func TestAccessResponse(t *testing.T) {
Expand Down
9 changes: 4 additions & 5 deletions access_response_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@
package fosite_test

import (
"testing"

"context"

"fmt"
"testing"

"github.com/golang/mock/gomock"
. "github.com/ory/fosite"
"github.com/ory/fosite/internal"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

. "github.com/ory/fosite"
"github.com/ory/fosite/internal"
)

func TestNewAccessResponse(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions access_write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
package fosite_test

import (
"testing"

"net/http"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"

. "github.com/ory/fosite"
. "github.com/ory/fosite/internal"
"github.com/stretchr/testify/assert"
)

func TestWriteAccessResponse(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions authorize_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
package fosite_test

import (
"fmt"
"net/http"
"net/url"
"testing"

"fmt"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"

. "github.com/ory/fosite"
. "github.com/ory/fosite/internal"
"github.com/stretchr/testify/assert"
)

// Test for
Expand Down
7 changes: 2 additions & 5 deletions authorize_request_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@
package fosite

import (
"net/http"
"strings"

"context"

"fmt"

"io/ioutil"
"net/http"
"strings"

"github.com/dgrijalva/jwt-go"
"github.com/ory/go-convenience/stringslice"
Expand Down
11 changes: 5 additions & 6 deletions authorize_request_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,19 @@
package fosite_test

import (
"context"
"fmt"
"net/http"
"net/url"
"testing"

"context"

"fmt"

"github.com/golang/mock/gomock"
. "github.com/ory/fosite"
. "github.com/ory/fosite/internal"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

. "github.com/ory/fosite"
. "github.com/ory/fosite/internal"
)

// Should pass
Expand Down
3 changes: 1 addition & 2 deletions authorize_response_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
package fosite

import (
"context"
"net/http"
"net/url"

"context"

"github.com/pkg/errors"
)

Expand Down
8 changes: 4 additions & 4 deletions authorize_response_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
package fosite_test

import (
"testing"

"context"
"testing"

"github.com/golang/mock/gomock"
. "github.com/ory/fosite"
. "github.com/ory/fosite/internal"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"

. "github.com/ory/fosite"
. "github.com/ory/fosite/internal"
)

func TestNewAuthorizeResponse(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion authorize_write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ import (
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"

. "github.com/ory/fosite"
. "github.com/ory/fosite/internal"
"github.com/stretchr/testify/assert"
)

func TestWriteAuthorizeResponse(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions client_authentication_jwks_strategy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ import (
"net/http/httptest"
"testing"

. "github.com/ory/fosite"
"github.com/ory/fosite/internal"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/square/go-jose.v2"

. "github.com/ory/fosite"
"github.com/ory/fosite/internal"
)

func TestDefaultJWKSFetcherStrategy(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions client_authentication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
package fosite_test

import (
"context"
"crypto/rsa"
"encoding/base64"
"encoding/json"
Expand All @@ -32,16 +33,15 @@ import (
"testing"
"time"

"context"

"github.com/dgrijalva/jwt-go"
. "github.com/ory/fosite"
"github.com/ory/fosite/internal"
"github.com/ory/fosite/storage"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/square/go-jose.v2"

. "github.com/ory/fosite"
"github.com/ory/fosite/internal"
"github.com/ory/fosite/storage"
)

func mustGenerateAssertion(t *testing.T, claims jwt.MapClaims, key *rsa.PrivateKey, kid string) string {
Expand Down
2 changes: 1 addition & 1 deletion compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func Compose(config *Config, storage interface{}, strategy interface{}, hasher f
}

f := &fosite.Fosite{
Store: storage.(fosite.Storage),
Store: storage.(fosite.Storage),
AuthorizeEndpointHandlers: fosite.AuthorizeEndpointHandlers{},
TokenEndpointHandlers: fosite.TokenEndpointHandlers{},
TokenIntrospectionHandlers: fosite.TokenIntrospectionHandlers{},
Expand Down
6 changes: 3 additions & 3 deletions compose/compose_pkce.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import (
// OAuth2PKCEFactory creates a PKCE handler.
func OAuth2PKCEFactory(config *Config, storage interface{}, strategy interface{}) interface{} {
return &pkce.Handler{
AuthorizeCodeStrategy: strategy.(oauth2.AuthorizeCodeStrategy),
Storage: storage.(pkce.PKCERequestStorage),
Force: config.EnforcePKCE,
AuthorizeCodeStrategy: strategy.(oauth2.AuthorizeCodeStrategy),
Storage: storage.(pkce.PKCERequestStorage),
Force: config.EnforcePKCE,
EnablePlainChallengeMethod: config.EnablePKCEPlainChallengeMethod,
}
}
5 changes: 3 additions & 2 deletions fosite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ package fosite_test
import (
"testing"

. "github.com/ory/fosite"
"github.com/ory/fosite/handler/oauth2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

. "github.com/ory/fosite"
"github.com/ory/fosite/handler/oauth2"
)

func TestAuthorizeEndpointHandlers(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions handler/oauth2/flow_authorize_code_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
package oauth2

import (
"context"
"strings"
"time"

"context"
"github.com/pkg/errors"

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

// AuthorizeExplicitGrantTypeHandler is a response handler for the Authorize Code grant using the explicit grant type
Expand Down
6 changes: 3 additions & 3 deletions handler/oauth2/flow_authorize_code_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import (
"net/url"
"strings"
"testing"

"time"

"github.com/ory/fosite"
"github.com/ory/fosite/storage"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/ory/fosite"
"github.com/ory/fosite/storage"
)

func parseUrl(uu string) *url.URL {
Expand Down
3 changes: 2 additions & 1 deletion handler/oauth2/flow_authorize_code_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import (
"context"
"time"

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

"github.com/ory/fosite"
)

// HandleTokenEndpointRequest implements
Expand Down
14 changes: 4 additions & 10 deletions handler/oauth2/flow_authorize_code_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,14 @@
package oauth2

import (
"context"
"fmt"
"net/url"
"testing"

//"time"

"testing" //"time"
//"github.com/golang/mock/gomock"
"github.com/ory/fosite"
//"github.com/ory/fosite/internal"
"time"

"context"

"fmt"

"github.com/ory/fosite" //"github.com/ory/fosite/internal"
"github.com/ory/fosite/storage"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
Expand Down
6 changes: 3 additions & 3 deletions handler/oauth2/flow_authorize_implicit.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
package oauth2

import (
"context"
"strconv"
"strings"
"time"

"context"
"strconv"
"github.com/pkg/errors"

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

// AuthorizeImplicitGrantTypeHandler is a response handler for the Authorize Code grant using the implicit grant type
Expand Down
8 changes: 4 additions & 4 deletions handler/oauth2/flow_authorize_implicit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
package oauth2

import (
"fmt"
"testing"
"time"

"fmt"

"github.com/golang/mock/gomock"
"github.com/ory/fosite"
"github.com/ory/fosite/internal"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"

"github.com/ory/fosite"
"github.com/ory/fosite/internal"
)

func TestAuthorizeImplicit_EndpointHandler(t *testing.T) {
Expand Down
Loading

0 comments on commit 211b43b

Please sign in to comment.