auth

package
v0.0.0-...-35ac193 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RootTrustClientValidationMiddleware

func RootTrustClientValidationMiddleware(next http.Handler) http.Handler

RootTrustClientValidationMiddleware validates if the root trust client is valid

func Route

func Route(r *mux.Router)

Route a auth request

func ScopeValidationMiddleware

func ScopeValidationMiddleware(scopes []string) func(next http.Handler) http.Handler

ScopeValidationMiddleware checks this token has the required scopes

func TokenValidationMiddleware

func TokenValidationMiddleware(next http.Handler) http.Handler

TokenValidationMiddleware validates the JWT

Types

type CheckOTPRequest

type CheckOTPRequest struct {
	UserID string `json:"user_id"`
	OTP    string `json:"otp"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL