Documentation ¶
Index ¶
- Constants
- type Controller
- type Service
- func (s *Service) AddPermission(ctx *gin.Context, grpcCtx context.Context, ...) (*pbauth.AddPermissionResponse, error)
- func (s *Service) AddRole(ctx *gin.Context, grpcCtx context.Context, request *pbauth.AddRoleRequest) (*pbauth.AddRoleResponse, error)
- func (s *Service) AddRolePermission(ctx *gin.Context, grpcCtx context.Context, ...) (*pbauth.AddRolePermissionResponse, error)
- func (s *Service) AddUserRole(ctx *gin.Context, grpcCtx context.Context, request *pbauth.AddUserRoleRequest) (*pbauth.AddUserRoleResponse, error)
- func (s *Service) CloseSession(ctx *gin.Context, grpcCtx context.Context, request *pbauth.CloseSessionRequest) (*pbauth.CloseSessionResponse, error)
- func (s *Service) CloseSessions(ctx *gin.Context, grpcCtx context.Context, ...) (*pbauth.CloseSessionsResponse, error)
- func (s *Service) GetPermission(ctx *gin.Context, grpcCtx context.Context, ...) (*pbauth.GetPermissionResponse, error)
- func (s *Service) GetPermissions(ctx *gin.Context, grpcCtx context.Context, ...) (*pbauth.GetPermissionsResponse, error)
- func (s *Service) GetRolePermissions(ctx *gin.Context, grpcCtx context.Context, ...) (*pbauth.GetRolePermissionsResponse, error)
- func (s *Service) GetRoles(ctx *gin.Context, grpcCtx context.Context, request *pbauth.GetRolesRequest) (*pbauth.GetRolesResponse, error)
- func (s *Service) GetSessions(ctx *gin.Context, grpcCtx context.Context, request *pbauth.GetSessionsRequest) (*pbauth.GetSessionsResponse, error)
- func (s *Service) GetUserRoles(ctx *gin.Context, grpcCtx context.Context, request *pbauth.GetUserRolesRequest) (*pbauth.GetUserRolesResponse, error)
- func (s *Service) IsAccessTokenValid(ctx *gin.Context, grpcCtx context.Context, ...) (*pbauth.IsAccessTokenValidResponse, error)
- func (s *Service) IsRefreshTokenValid(ctx *gin.Context, grpcCtx context.Context, ...) (*pbauth.IsRefreshTokenValidResponse, error)
- func (s *Service) LogIn(ctx *gin.Context, grpcCtx context.Context, request *pbauth.LogInRequest) (*pbauth.LogInResponse, error)
- func (s *Service) LogOut(ctx *gin.Context, grpcCtx context.Context, request *pbauth.LogOutRequest) (*pbauth.LogOutResponse, error)
- func (s *Service) RefreshToken(ctx *gin.Context, grpcCtx context.Context, request *pbauth.RefreshTokenRequest) (*pbauth.RefreshTokenResponse, error)
- func (s *Service) RevokePermission(ctx *gin.Context, grpcCtx context.Context, ...) (*pbauth.RevokePermissionResponse, error)
- func (s *Service) RevokeRole(ctx *gin.Context, grpcCtx context.Context, request *pbauth.RevokeRoleRequest) (*pbauth.RevokeRoleResponse, error)
- func (s *Service) RevokeRolePermission(ctx *gin.Context, grpcCtx context.Context, ...) (*pbauth.RevokeRolePermissionResponse, error)
- func (s *Service) RevokeUserRole(ctx *gin.Context, grpcCtx context.Context, ...) (*pbauth.RevokeUserRoleResponse, error)
Constants ¶
const (
// RelativeUri is the relative URI of the API Gateway auth service router
RelativeUri = "/auth"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController( apiRoute *gin.RouterGroup, service *Service, jwtValidator commonjwtvalidator.Validator, restMap *map[string]map[pbtypes.RESTMethod]pbtypes. GRPCMethod, grpcInterceptions *map[pbtypes.GRPCMethod]pbtypes.Interception, authLogger authmiddleware.Logger, ) (*Controller, error)
NewController creates a new controller
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the service for auth
func NewService ¶
func NewService(flag *commonflag.ModeFlag, client pbauth.AuthClient) *Service
NewService creates a new service
func (*Service) AddPermission ¶
func (s *Service) AddPermission( ctx *gin.Context, grpcCtx context.Context, request *pbauth.AddPermissionRequest, ) ( *pbauth.AddPermissionResponse, error, )
AddPermission adds a permission
func (*Service) AddRole ¶
func (s *Service) AddRole( ctx *gin.Context, grpcCtx context.Context, request *pbauth.AddRoleRequest, ) (*pbauth.AddRoleResponse, error)
AddRole adds a role
func (*Service) AddRolePermission ¶
func (s *Service) AddRolePermission( ctx *gin.Context, grpcCtx context.Context, request *pbauth.AddRolePermissionRequest, ) ( *pbauth.AddRolePermissionResponse, error, )
AddRolePermission adds a permission to a role
func (*Service) AddUserRole ¶
func (s *Service) AddUserRole( ctx *gin.Context, grpcCtx context.Context, request *pbauth.AddUserRoleRequest, ) ( *pbauth.AddUserRoleResponse, error, )
AddUserRole adds a role to a user
func (*Service) CloseSession ¶ added in v0.1.0
func (s *Service) CloseSession( ctx *gin.Context, grpcCtx context.Context, request *pbauth.CloseSessionRequest, ) ( *pbauth.CloseSessionResponse, error, )
CloseSession closes the user' session
func (*Service) CloseSessions ¶
func (s *Service) CloseSessions( ctx *gin.Context, grpcCtx context.Context, request *pbauth.CloseSessionsRequest, ) ( *pbauth.CloseSessionsResponse, error, )
CloseSessions closes all the user' sessions
func (*Service) GetPermission ¶
func (s *Service) GetPermission( ctx *gin.Context, grpcCtx context.Context, request *pbauth.GetPermissionRequest, ) ( *pbauth.GetPermissionResponse, error, )
GetPermission gets all the permissions
func (*Service) GetPermissions ¶
func (s *Service) GetPermissions( ctx *gin.Context, grpcCtx context.Context, request *pbauth.GetPermissionsRequest, ) ( *pbauth.GetPermissionsResponse, error, )
GetPermissions gets all the permissions
func (*Service) GetRolePermissions ¶
func (s *Service) GetRolePermissions( ctx *gin.Context, grpcCtx context.Context, request *pbauth.GetRolePermissionsRequest, ) ( *pbauth.GetRolePermissionsResponse, error, )
GetRolePermissions gets all the role's permissions
func (*Service) GetRoles ¶
func (s *Service) GetRoles( ctx *gin.Context, grpcCtx context.Context, request *pbauth.GetRolesRequest, ) (*pbauth.GetRolesResponse, error)
GetRoles gets all the roles
func (*Service) GetSessions ¶
func (s *Service) GetSessions( ctx *gin.Context, grpcCtx context.Context, request *pbauth.GetSessionsRequest, ) ( *pbauth.GetSessionsResponse, error, )
GetSessions gets all the user' sessions
func (*Service) GetUserRoles ¶
func (s *Service) GetUserRoles( ctx *gin.Context, grpcCtx context.Context, request *pbauth.GetUserRolesRequest, ) ( *pbauth.GetUserRolesResponse, error, )
GetUserRoles gets all the user's roles
func (*Service) IsAccessTokenValid ¶ added in v0.1.0
func (s *Service) IsAccessTokenValid( ctx *gin.Context, grpcCtx context.Context, request *pbauth.IsAccessTokenValidRequest, ) ( *pbauth.IsAccessTokenValidResponse, error, )
IsAccessTokenValid checks if the access token is valid
func (*Service) IsRefreshTokenValid ¶ added in v0.1.0
func (s *Service) IsRefreshTokenValid( ctx *gin.Context, grpcCtx context.Context, request *pbauth.IsRefreshTokenValidRequest, ) ( *pbauth.IsRefreshTokenValidResponse, error, )
IsRefreshTokenValid checks if the refresh token is valid
func (*Service) LogIn ¶
func (s *Service) LogIn( ctx *gin.Context, grpcCtx context.Context, request *pbauth.LogInRequest, ) (*pbauth.LogInResponse, error)
LogIn logs in q user
func (*Service) LogOut ¶
func (s *Service) LogOut( ctx *gin.Context, grpcCtx context.Context, request *pbauth.LogOutRequest, ) (*pbauth.LogOutResponse, error)
LogOut logs out the user
func (*Service) RefreshToken ¶
func (s *Service) RefreshToken( ctx *gin.Context, grpcCtx context.Context, request *pbauth.RefreshTokenRequest, ) ( *pbauth.RefreshTokenResponse, error, )
RefreshToken refreshes the user's token
func (*Service) RevokePermission ¶
func (s *Service) RevokePermission( ctx *gin.Context, grpcCtx context.Context, request *pbauth.RevokePermissionRequest, ) ( *pbauth.RevokePermissionResponse, error, )
RevokePermission revokes a permission
func (*Service) RevokeRole ¶
func (s *Service) RevokeRole( ctx *gin.Context, grpcCtx context.Context, request *pbauth.RevokeRoleRequest, ) ( *pbauth.RevokeRoleResponse, error, )
RevokeRole revokes a role
func (*Service) RevokeRolePermission ¶
func (s *Service) RevokeRolePermission( ctx *gin.Context, grpcCtx context.Context, request *pbauth.RevokeRolePermissionRequest, ) ( *pbauth.RevokeRolePermissionResponse, error, )
RevokeRolePermission revokes a permission from a role
func (*Service) RevokeUserRole ¶
func (s *Service) RevokeUserRole( ctx *gin.Context, grpcCtx context.Context, request *pbauth.RevokeUserRoleRequest, ) ( *pbauth.RevokeUserRoleResponse, error, )
RevokeUserRole revokes a role from a user