Documentation ¶
Index ¶
- func ExtractHostName(ctx context.Context) (string, error)
- func ExtractToken(ctx context.Context) (string, error)
- func ExtractUser(ctx context.Context) (*auth.User, error)
- func InitMiddleware(userService users.Service)
- func InitRbac(ctx context.Context, rulesSrv rules.Service, usersSrv users.Service, ...) (*rbacService, error)
- func ValidateLoginRequest(c *auth.LoginRequest) error
- func ValidateRegisterRequest(c *auth.RegisterRequest) error
- type API
- type Group
- type Headers
- type Middleware
- type Policy
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractHostName ¶
ExtractHostName try to extract hostname from context
func ExtractToken ¶
ExtractToken try to extract token from context
func ExtractUser ¶
ExtractUser try to extract the current user from the context
func InitMiddleware ¶
func ValidateLoginRequest ¶
func ValidateLoginRequest(c *auth.LoginRequest) error
ValidateLoginRequest validates the LoginRequest fields.
func ValidateRegisterRequest ¶
func ValidateRegisterRequest(c *auth.RegisterRequest) error
ValidateRegisterRequest validates the RegisterRequest fields.
Types ¶
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
type Service ¶
type Service interface { Login(ctx context.Context, req *auth.LoginRequest) (*auth.LoginResponse, error) Register(ctx context.Context, req *auth.RegisterRequest) (*auth.RegisterResponse, error) Logout(ctx context.Context, req *auth.LogoutRequest) (*auth.LogoutResponse, error) VerifyToken(ctx context.Context, req *auth.VerifyTokenRequest) (*auth.VerifyTokenResponse, error) RefreshToken(ctx context.Context, req *auth.RefreshTokenRequest) (*auth.RefreshTokenResponse, error) Validate(ctx context.Context, req *auth.ValidateRequest) (*empty.Empty, error) }
Service encapsulates use case logic for auth.
func NewService ¶
NewService creates a new auth service.
Click to show internal directories.
Click to hide internal directories.