Documentation ¶
Index ¶
- func RootTrustClientValidationMiddleware(next http.Handler) http.Handler
- func Route(r *mux.Router)
- func ScopeValidationMiddleware(scopes []string) func(next http.Handler) http.Handler
- func TokenValidationMiddleware(next http.Handler) http.Handler
- type CheckOTPRequest
- type CheckResponse
- type EnableOTPRequest
- type EnableOTPResponse
- type GenerateTokenRequest
- type GenerateTokenResponse
- type SigninEmailPasswordRequest
- type SigninResponse
- type UpdatePasswordRequest
- type VerifyOTPRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RootTrustClientValidationMiddleware ¶
RootTrustClientValidationMiddleware validates if the root trust client is valid
func ScopeValidationMiddleware ¶
ScopeValidationMiddleware checks this token has the required scopes
Types ¶
type CheckOTPRequest ¶
CheckOTPRequest is a request to check otp credentials for a user
type CheckResponse ¶
type CheckResponse struct {
Valid bool `json:"valid"`
}
CheckResponse is the response to a check request
type EnableOTPRequest ¶
type EnableOTPRequest struct {
CurrentPassword string `json:"current_password"`
}
EnableOTPRequest is the request for enabling otp
type EnableOTPResponse ¶
type EnableOTPResponse struct {
URL string `json:"url"`
}
EnableOTPResponse is the response for enabling otp
type GenerateTokenRequest ¶
type GenerateTokenRequest struct { ClientID string `json:"client_id"` UserID string `json:"user_id"` Scopes []string `json:"scopes"` }
GenerateTokenRequest is a request to generate a token
type GenerateTokenResponse ¶
type GenerateTokenResponse struct {
Token string `json:"token"`
}
GenerateTokenResponse is the response for generating a token
type SigninEmailPasswordRequest ¶
type SigninEmailPasswordRequest struct { Email string `json:"email"` Password string `json:"password"` }
SigninEmailPasswordRequest is a request that gets a user and checks their credentials by email and password
type SigninResponse ¶
type SigninResponse struct { UserID string `json:"user_id"` Requires2FA bool `json:"requires_2fa"` }
SigninResponse the response to a signin request
type UpdatePasswordRequest ¶
type UpdatePasswordRequest struct { CurrentPassword string `json:"current_password"` NewPassword string `json:"new_password"` }
UpdatePasswordRequest is the request for updating a password
type VerifyOTPRequest ¶
type VerifyOTPRequest struct {
OTP string `json:"otp"`
}
VerifyOTPRequest is the request for verifying otp