Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix oauth2 core storage interface and device flow session type assertion #7

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion handler/oauth2/flow_authorize_code_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func TestAuthorizeCode_PopulateTokenEndpointResponse(t *testing.T) {
var h GenericCodeTokenEndpointHandler

testCases := []struct {
areq *fosite.AccessRequest
description string
areq *fosite.AccessRequest
setup func(t *testing.T, areq *fosite.AccessRequest, config *fosite.Config)
check func(t *testing.T, aresp *fosite.AccessResponse)
expectErr error
Expand Down
1 change: 1 addition & 0 deletions handler/oauth2/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
)

type CoreStorage interface {
AuthorizeCodeStorage
AccessTokenStorage
RefreshTokenStorage
}
Expand Down
4 changes: 2 additions & 2 deletions handler/rfc8628/strategy_hmacsha.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (

// DeviceFlowSession is a fosite.Session container specific for the device flow.
type DeviceFlowSession interface {
// BrowserFlowCompleted returns the flag indicating whether user has completed the browser flow or not.
BrowserFlowCompleted() bool
// GetBrowserFlowCompleted returns the flag indicating whether user has completed the browser flow or not.
GetBrowserFlowCompleted() bool

// SetBrowserFlowCompleted allows client to mark user has completed the browser flow.
SetBrowserFlowCompleted(flag bool)
Expand Down
2 changes: 1 addition & 1 deletion handler/rfc8628/token_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (s DeviceSessionHandler) Session(ctx context.Context, requester fosite.Acce
return nil, errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebug(err.Error()))
}

session, ok := req.GetSession().(*DefaultDeviceFlowSession)
session, ok := req.GetSession().(DeviceFlowSession)
if !ok {
return nil, fosite.ErrServerError.WithHint("Wrong authorization request session.")
}
Expand Down
Loading