Documentation ¶
Index ¶
- type Claims
- type GatewayService
- func (k *GatewayService) ActivateUser(userId string) error
- func (k *GatewayService) Authorize(resource string, method string, tokenString string) bool
- func (k *GatewayService) AuthorizeWithoutToken(resource string, method string) bool
- func (k *GatewayService) RegisterUser(userData models.UserRegistration) (int, error)
- func (k *GatewayService) RenewToken(refreshToken string) string
- func (k *GatewayService) ValidateToken(tokenString string) (jwt.Claims, error)
- func (k *GatewayService) VerifyUser(tokenString string) (bool, error)
- type IGatewayService
- type VerificationClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GatewayService ¶
type GatewayService struct {
// contains filtered or unexported fields
}
func (*GatewayService) ActivateUser ¶
func (k *GatewayService) ActivateUser(userId string) error
This wrapper is almost too thin
func (*GatewayService) Authorize ¶
func (k *GatewayService) Authorize(resource string, method string, tokenString string) bool
func (*GatewayService) AuthorizeWithoutToken ¶
func (k *GatewayService) AuthorizeWithoutToken(resource string, method string) bool
func (*GatewayService) RegisterUser ¶
func (k *GatewayService) RegisterUser(userData models.UserRegistration) (int, error)
RegisterUser Deprecated
func (*GatewayService) RenewToken ¶
func (k *GatewayService) RenewToken(refreshToken string) string
func (*GatewayService) ValidateToken ¶
func (k *GatewayService) ValidateToken(tokenString string) (jwt.Claims, error)
func (*GatewayService) VerifyUser ¶
func (k *GatewayService) VerifyUser(tokenString string) (bool, error)
type IGatewayService ¶
type IGatewayService interface { // Validate a user-token ValidateToken(token string) (jwt.Claims, error) // Authorize a user to a certain resource Authorize(resource string, method string, token string) bool // AuthorizeWithoutToken is for guest users AuthorizeWithoutToken(resource string, method string) bool // Activate a user. This is done by the url given on Email ActivateUser(userId string) error // If a user does not exist in the database, make it VerifyUser(tokenString string) (bool, error) }
func NewGatewayService ¶
func NewGatewayService( storageAdapter persist.Adapter, userRepository repository.IUserServiceRepository, authenticationProvider string, ) IGatewayService
type VerificationClaims ¶
type VerificationClaims struct { jwt.StandardClaims UserID string }
Click to show internal directories.
Click to hide internal directories.