Documentation ¶
Index ¶
- Constants
- func CreateCustomJWTToken(userId string, expirationTime int64, signKey *rsa.PrivateKey) string
- func CreateUser(id string, password string) int
- func CreateUserForFurtherTesting(t *testing.T) string
- func CreateUserId() (string, int)
- func DeleteUser(userId string, tokenString string) int
- func LoadPrivateKeyFile(fileName string) *rsa.PrivateKey
- func UpdatePassword(userId string, password string, tokenString string) int
- type Authenticate
- type Claims
- type TokenResponseDTO
Constants ¶
View Source
const ( PublicKeyFile = "./data/token/public/jwtRS256.key.pub" PrivateKeyFile = "./data/token/privat/jwtRS256.key" WrongPublicKeyFile = "./data/token/public/jwtRS256_wrong.key.pub" WrongPrivateKeyFile = "./data/token/privat/jwtRS256_wrong.key" )
View Source
const ( Url = "http://localhost:1203" CorrelationId = "X-Correlation-ID" )
View Source
const (
DefaultPassword = "SomeDefaultPassowrd"
)
Variables ¶
This section is empty.
Functions ¶
func CreateCustomJWTToken ¶
func CreateCustomJWTToken(userId string, expirationTime int64, signKey *rsa.PrivateKey) string
func CreateUser ¶
func CreateUserId ¶
func DeleteUser ¶
func LoadPrivateKeyFile ¶ added in v0.3.0
func LoadPrivateKeyFile(fileName string) *rsa.PrivateKey
Types ¶
type Authenticate ¶
type Authenticate struct {
Password string `json:"password" validate:"required"`
}
type Claims ¶
type Claims struct { UserId string `json:"user_id"` jwt.StandardClaims }
type TokenResponseDTO ¶
type TokenResponseDTO struct { AccessToken string `json:"access_token"` ExpiresIn int `json:"expires_in"` RefreshToken string `json:"refresh_token"` RefreshExpiresIn int `json:"refresh_expires_in"` }
func ObtainToken ¶
func ObtainToken(t *testing.T) (*TokenResponseDTO, string)
func RefreshToken ¶
func RefreshToken(userId string, token string, refreshToken string) (*TokenResponseDTO, int)
Click to show internal directories.
Click to hide internal directories.