From ab58468b1516860e473d72b65311e8ac57ed94c4 Mon Sep 17 00:00:00 2001 From: Michael Boke Date: Mon, 22 May 2017 16:21:32 +0200 Subject: [PATCH] oauth2: removed implicit storage as its never used - closes #165 (#171) Signed-off-by: Michael Boke --- generate-mocks.sh | 1 - handler/oauth2/flow_authorize_implicit.go | 2 +- .../oauth2/flow_authorize_implicit_storage.go | 11 ----- internal/oauth2_implicit_storage.go | 42 ------------------- 4 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 handler/oauth2/flow_authorize_implicit_storage.go delete mode 100644 internal/oauth2_implicit_storage.go diff --git a/generate-mocks.sh b/generate-mocks.sh index 3614a313b..a309df6f5 100755 --- a/generate-mocks.sh +++ b/generate-mocks.sh @@ -9,7 +9,6 @@ mockgen -package internal -destination internal/access_token_storage.go github.c mockgen -package internal -destination internal/refresh_token_strategy.go github.com/ory/fosite/handler/oauth2 RefreshTokenStorage mockgen -package internal -destination internal/oauth2_client_storage.go github.com/ory/fosite/handler/oauth2 ClientCredentialsGrantStorage mockgen -package internal -destination internal/oauth2_explicit_storage.go github.com/ory/fosite/handler/oauth2 AuthorizeCodeGrantStorage -mockgen -package internal -destination internal/oauth2_implicit_storage.go github.com/ory/fosite/handler/oauth2 ImplicitGrantStorage mockgen -package internal -destination internal/oauth2_owner_storage.go github.com/ory/fosite/handler/oauth2 ResourceOwnerPasswordCredentialsGrantStorage mockgen -package internal -destination internal/oauth2_refresh_storage.go github.com/ory/fosite/handler/oauth2 RefreshTokenGrantStorage mockgen -package internal -destination internal/oauth2_revoke_storage.go github.com/ory/fosite/handler/oauth2 TokenRevocationStorage diff --git a/handler/oauth2/flow_authorize_implicit.go b/handler/oauth2/flow_authorize_implicit.go index 9ccc43afd..336ce763c 100644 --- a/handler/oauth2/flow_authorize_implicit.go +++ b/handler/oauth2/flow_authorize_implicit.go @@ -18,7 +18,7 @@ import ( type AuthorizeImplicitGrantTypeHandler struct { AccessTokenStrategy AccessTokenStrategy - // ImplicitGrantStorage is used to persist session data across requests. + // AccessTokenStorage is used to persist session data across requests. AccessTokenStorage AccessTokenStorage // AccessTokenLifespan defines the lifetime of an access token. diff --git a/handler/oauth2/flow_authorize_implicit_storage.go b/handler/oauth2/flow_authorize_implicit_storage.go deleted file mode 100644 index b70c85b04..000000000 --- a/handler/oauth2/flow_authorize_implicit_storage.go +++ /dev/null @@ -1,11 +0,0 @@ -package oauth2 - -import ( - "context" - - "github.com/ory/fosite" -) - -type ImplicitGrantStorage interface { - CreateImplicitAccessTokenSession(ctx context.Context, token string, request fosite.Requester) (err error) -} diff --git a/internal/oauth2_implicit_storage.go b/internal/oauth2_implicit_storage.go deleted file mode 100644 index 4e089303d..000000000 --- a/internal/oauth2_implicit_storage.go +++ /dev/null @@ -1,42 +0,0 @@ -// Automatically generated by MockGen. DO NOT EDIT! -// Source: github.com/ory/fosite/handler/oauth2 (interfaces: ImplicitGrantStorage) - -package internal - -import ( - context "context" - - gomock "github.com/golang/mock/gomock" - fosite "github.com/ory/fosite" -) - -// Mock of ImplicitGrantStorage interface -type MockImplicitGrantStorage struct { - ctrl *gomock.Controller - recorder *_MockImplicitGrantStorageRecorder -} - -// Recorder for MockImplicitGrantStorage (not exported) -type _MockImplicitGrantStorageRecorder struct { - mock *MockImplicitGrantStorage -} - -func NewMockImplicitGrantStorage(ctrl *gomock.Controller) *MockImplicitGrantStorage { - mock := &MockImplicitGrantStorage{ctrl: ctrl} - mock.recorder = &_MockImplicitGrantStorageRecorder{mock} - return mock -} - -func (_m *MockImplicitGrantStorage) EXPECT() *_MockImplicitGrantStorageRecorder { - return _m.recorder -} - -func (_m *MockImplicitGrantStorage) CreateImplicitAccessTokenSession(_param0 context.Context, _param1 string, _param2 fosite.Requester) error { - ret := _m.ctrl.Call(_m, "CreateImplicitAccessTokenSession", _param0, _param1, _param2) - ret0, _ := ret[0].(error) - return ret0 -} - -func (_mr *_MockImplicitGrantStorageRecorder) CreateImplicitAccessTokenSession(arg0, arg1, arg2 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "CreateImplicitAccessTokenSession", arg0, arg1, arg2) -}