|
|
|
@ -27,7 +27,7 @@ type MockOAuthDatastore struct { |
|
|
|
|
DoGetIDForRemoteUser func(context.Context, string, string, string) (int64, error) |
|
|
|
|
DoCreateUser func(*config.Config, *User, string) error |
|
|
|
|
DoRecordRemoteUserID func(context.Context, int64, string, string, string, string) error |
|
|
|
|
DoGetUserForAuthByID func(int64) (*User, error) |
|
|
|
|
DoGetUserByID func(int64) (*User, error) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var _ OAuthDatastore = &MockOAuthDatastore{} |
|
|
|
@ -115,9 +115,9 @@ func (m *MockOAuthDatastore) RecordRemoteUserID(ctx context.Context, localUserID |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (m *MockOAuthDatastore) GetUserForAuthByID(userID int64) (*User, error) { |
|
|
|
|
if m.DoGetUserForAuthByID != nil { |
|
|
|
|
return m.DoGetUserForAuthByID(userID) |
|
|
|
|
func (m *MockOAuthDatastore) GetUserByID(userID int64) (*User, error) { |
|
|
|
|
if m.DoGetUserByID != nil { |
|
|
|
|
return m.DoGetUserByID(userID) |
|
|
|
|
} |
|
|
|
|
user := &User{ |
|
|
|
|
|
|
|
|
|