mocks

package
v1.0.0-10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceInterface

type ServiceInterface struct {
	mock.Mock
}

func (*ServiceInterface) AuthClient

func (_m *ServiceInterface) AuthClient(clientID uuid.UUID, secret string) (*model.Client, error)

func (*ServiceInterface) AuthUser

func (_m *ServiceInterface) AuthUser(username string, thePassword string) (*model.User, error)

func (*ServiceInterface) Authenticate

func (_m *ServiceInterface) Authenticate(token string) (*model.AccessToken, error)

func (*ServiceInterface) ClientExists

func (_m *ServiceInterface) ClientExists(clientID uuid.UUID) bool

func (*ServiceInterface) CreateClient

func (_m *ServiceInterface) CreateClient(clientID uuid.UUID, secret string, redirectURI string) (*model.Client, error)

func (*ServiceInterface) CreateClientTx

func (_m *ServiceInterface) CreateClientTx(tx *bun.DB, clientID uuid.UUID, secret string, redirectURI string) (*model.Client, error)

func (*ServiceInterface) CreateUser

func (_m *ServiceInterface) CreateUser(roleID int32, username string, password string) (*model.User, error)

func (*ServiceInterface) CreateUserTx

func (_m *ServiceInterface) CreateUserTx(tx *bun.DB, roleID int32, username string, password string) (*model.User, error)

func (*ServiceInterface) FindClientByClientID

func (_m *ServiceInterface) FindClientByClientID(clientID uuid.UUID) (*model.Client, error)

func (*ServiceInterface) FindUserByUsername

func (_m *ServiceInterface) FindUserByUsername(username string) (*model.User, error)

func (*ServiceInterface) GetConfig

func (_m *ServiceInterface) GetConfig() *config.Config

func (*ServiceInterface) GetOrCreateRefreshToken

func (_m *ServiceInterface) GetOrCreateRefreshToken(client *model.Client, user *model.User, expiresIn int, scope string) (*model.RefreshToken, error)

func (*ServiceInterface) GetRoutes

func (_m *ServiceInterface) GetRoutes() []routes.Route

func (*ServiceInterface) GetScope

func (_m *ServiceInterface) GetScope(requestedScope string) (string, error)

func (*ServiceInterface) GetValidRefreshToken

func (_m *ServiceInterface) GetValidRefreshToken(token string, client *model.Client) (*model.RefreshToken, error)

func (*ServiceInterface) GrantAccessToken

func (_m *ServiceInterface) GrantAccessToken(client *model.Client, user *model.User, expiresIn int, scope string) (*model.AccessToken, error)

func (*ServiceInterface) GrantAuthorizationCode

func (_m *ServiceInterface) GrantAuthorizationCode(client *model.Client, user *model.User, expiresIn int, redirectURI string, scope string) (*model.AuthorizationCode, error)

func (*ServiceInterface) IsRoleAllowed

func (_m *ServiceInterface) IsRoleAllowed(role model.AccessRole) bool

func (*ServiceInterface) Login

func (_m *ServiceInterface) Login(client *model.Client, user *model.User, scope string) (*model.AccessToken, *model.RefreshToken, error)

func (*ServiceInterface) NewIntrospectResponseFromAccessToken

func (_m *ServiceInterface) NewIntrospectResponseFromAccessToken(accessToken *model.AccessToken) (*oauth.IntrospectResponse, error)

func (*ServiceInterface) NewIntrospectResponseFromRefreshToken

func (_m *ServiceInterface) NewIntrospectResponseFromRefreshToken(refreshToken *model.RefreshToken) (*oauth.IntrospectResponse, error)

func (*ServiceInterface) RegisterRoutes

func (_m *ServiceInterface) RegisterRoutes(router *mux.Router, prefix string)

func (*ServiceInterface) RestrictToRoles

func (_m *ServiceInterface) RestrictToRoles(allowedRoles ...int32)

func (*ServiceInterface) SetPassword

func (_m *ServiceInterface) SetPassword(user *model.User, password string) error

func (*ServiceInterface) SetPasswordTx

func (_m *ServiceInterface) SetPasswordTx(tx *bun.DB, user *model.User, password string) error

func (*ServiceInterface) UpdateUsername

func (_m *ServiceInterface) UpdateUsername(user *model.User, username string) error

func (*ServiceInterface) UpdateUsernameTx

func (_m *ServiceInterface) UpdateUsernameTx(db *bun.DB, user *model.User, username string) error

func (*ServiceInterface) UserExists

func (_m *ServiceInterface) UserExists(username string) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL