Documentation
¶
Overview ¶
Package auth is a generated GoMock package.
Index ¶
- func New(ds store.IStore, authn authn.Authenticator, auth auth.AuthProvider) *authBiz
- type AuthBiz
- type MockAuthBiz
- func (m *MockAuthBiz) Authenticate(arg0 context.Context, arg1 string) (*v1.AuthenticateResponse, error)
- func (m *MockAuthBiz) Authorize(arg0 context.Context, arg1, arg2, arg3 string) (*v1.AuthorizeResponse, error)
- func (m *MockAuthBiz) EXPECT() *MockAuthBizMockRecorder
- func (m *MockAuthBiz) Login(arg0 context.Context, arg1 *v1.LoginRequest) (*v1.LoginReply, error)
- func (m *MockAuthBiz) Logout(arg0 context.Context, arg1 *v1.LogoutRequest) error
- func (m *MockAuthBiz) RefreshToken(arg0 context.Context, arg1 *v1.RefreshTokenRequest) (*v1.LoginReply, error)
- type MockAuthBizMockRecorder
- func (mr *MockAuthBizMockRecorder) Authenticate(arg0, arg1 any) *gomock.Call
- func (mr *MockAuthBizMockRecorder) Authorize(arg0, arg1, arg2, arg3 any) *gomock.Call
- func (mr *MockAuthBizMockRecorder) Login(arg0, arg1 any) *gomock.Call
- func (mr *MockAuthBizMockRecorder) Logout(arg0, arg1 any) *gomock.Call
- func (mr *MockAuthBizMockRecorder) RefreshToken(arg0, arg1 any) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(ds store.IStore, authn authn.Authenticator, auth auth.AuthProvider) *authBiz
New creates a new authBiz instance.
Types ¶
type AuthBiz ¶
type AuthBiz interface { // Login authenticates a user and returns a token. Login(ctx context.Context, rq *v1.LoginRequest) (*v1.LoginReply, error) // Logout invalidates a token. Logout(ctx context.Context, rq *v1.LogoutRequest) error // RefreshToken refreshes an existing token and returns a new one. RefreshToken(ctx context.Context, rq *v1.RefreshTokenRequest) (*v1.LoginReply, error) // Authenticate validates an access token and returns the associated user ID. Authenticate(ctx context.Context, accessToken string) (*v1.AuthenticateResponse, error) // Authorize checks if a user has the necessary permissions to perform an action on an object. Authorize(ctx context.Context, sub, obj, act string) (*v1.AuthorizeResponse, error) }
AuthBiz defines functions used for authentication and authorization.
type MockAuthBiz ¶
type MockAuthBiz struct {
// contains filtered or unexported fields
}
MockAuthBiz is a mock of AuthBiz interface.
func NewMockAuthBiz ¶
func NewMockAuthBiz(ctrl *gomock.Controller) *MockAuthBiz
NewMockAuthBiz creates a new mock instance.
func (*MockAuthBiz) Authenticate ¶
func (m *MockAuthBiz) Authenticate(arg0 context.Context, arg1 string) (*v1.AuthenticateResponse, error)
Authenticate mocks base method.
func (*MockAuthBiz) Authorize ¶
func (m *MockAuthBiz) Authorize(arg0 context.Context, arg1, arg2, arg3 string) (*v1.AuthorizeResponse, error)
Authorize mocks base method.
func (*MockAuthBiz) EXPECT ¶
func (m *MockAuthBiz) EXPECT() *MockAuthBizMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockAuthBiz) Login ¶
func (m *MockAuthBiz) Login(arg0 context.Context, arg1 *v1.LoginRequest) (*v1.LoginReply, error)
Login mocks base method.
func (*MockAuthBiz) Logout ¶
func (m *MockAuthBiz) Logout(arg0 context.Context, arg1 *v1.LogoutRequest) error
Logout mocks base method.
func (*MockAuthBiz) RefreshToken ¶
func (m *MockAuthBiz) RefreshToken(arg0 context.Context, arg1 *v1.RefreshTokenRequest) (*v1.LoginReply, error)
RefreshToken mocks base method.
type MockAuthBizMockRecorder ¶
type MockAuthBizMockRecorder struct {
// contains filtered or unexported fields
}
MockAuthBizMockRecorder is the mock recorder for MockAuthBiz.
func (*MockAuthBizMockRecorder) Authenticate ¶
func (mr *MockAuthBizMockRecorder) Authenticate(arg0, arg1 any) *gomock.Call
Authenticate indicates an expected call of Authenticate.
func (*MockAuthBizMockRecorder) Authorize ¶
func (mr *MockAuthBizMockRecorder) Authorize(arg0, arg1, arg2, arg3 any) *gomock.Call
Authorize indicates an expected call of Authorize.
func (*MockAuthBizMockRecorder) Login ¶
func (mr *MockAuthBizMockRecorder) Login(arg0, arg1 any) *gomock.Call
Login indicates an expected call of Login.
func (*MockAuthBizMockRecorder) Logout ¶
func (mr *MockAuthBizMockRecorder) Logout(arg0, arg1 any) *gomock.Call
Logout indicates an expected call of Logout.
func (*MockAuthBizMockRecorder) RefreshToken ¶
func (mr *MockAuthBizMockRecorder) RefreshToken(arg0, arg1 any) *gomock.Call
RefreshToken indicates an expected call of RefreshToken.