Documentation
¶
Index ¶
- Variables
- func CheckPassword(password string, hashedPassword string) error
- func HashPassword(password string) (string, error)
- type AuthServer
- func (s *AuthServer) DeleteUser(ctx context.Context, id *pb.EntityID) (*pb.DeleteResponse, error)
- func (s *AuthServer) GetUser(ctx context.Context, req *pb.EntityID) (*pb.UserResponse, error)
- func (s *AuthServer) Login(ctx context.Context, req *pb.LoginRequest) (*pb.LoginResponse, error)
- func (s *AuthServer) Register(ctx context.Context, req *pb.RegisterRequest) (*pb.RegisterResponse, error)
- func (s *AuthServer) Validate(ctx context.Context, req *pb.ValidateRequest) (*pb.ValidateResponse, error)
- type JwtWrapper
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CheckPassword ¶
func HashPassword ¶
Types ¶
type AuthServer ¶
type AuthServer struct { Handler db.Handler Jwt JwtWrapper Config config.Config // used to test circuit breakers }
func (*AuthServer) DeleteUser ¶
func (s *AuthServer) DeleteUser(ctx context.Context, id *pb.EntityID) (*pb.DeleteResponse, error)
func (*AuthServer) GetUser ¶
func (s *AuthServer) GetUser(ctx context.Context, req *pb.EntityID) (*pb.UserResponse, error)
func (*AuthServer) Login ¶
func (s *AuthServer) Login(ctx context.Context, req *pb.LoginRequest) (*pb.LoginResponse, error)
func (*AuthServer) Register ¶
func (s *AuthServer) Register(ctx context.Context, req *pb.RegisterRequest) (*pb.RegisterResponse, error)
TODO SHULD CHECK ROLE FOR ENUM
func (*AuthServer) Validate ¶
func (s *AuthServer) Validate(ctx context.Context, req *pb.ValidateRequest) (*pb.ValidateResponse, error)
type JwtWrapper ¶
func (*JwtWrapper) GenerateToken ¶
func (w *JwtWrapper) GenerateToken(user models.User) (signedToken string, err error)
func (*JwtWrapper) ValidateToken ¶
func (w *JwtWrapper) ValidateToken(signedToken string) (claims *jwtClaims, err error)
Click to show internal directories.
Click to hide internal directories.