Documentation ¶
Index ¶
- Constants
- Variables
- type API
- type APIImpl
- func (d *APIImpl) AuthCall(ctx *middlewares.AutheliaCtx, values url.Values) (*AuthResponse, error)
- func (d *APIImpl) Call(ctx *middlewares.AutheliaCtx, values url.Values, method string, path string) (*Response, error)
- func (d *APIImpl) PreAuthCall(ctx *middlewares.AutheliaCtx, values url.Values) (*PreAuthResponse, error)
- type AuthResponse
- type Device
- type PreAuthResponse
- type Response
Constants ¶
View Source
const ( // Push Method - The device is activated for Duo Push. Push = "push" // OTP Method - The device is capable of generating passcodes with the Duo Mobile app. OTP = "mobile_otp" // Phone Method - The device can receive phone calls. Phone = "phone" // SMS Method - The device can receive batches of SMS passcodes. SMS = "sms" )
Duo Methods.
Variables ¶
View Source
var PossibleMethods = []string{Push} // OTP, Phone, SMS.
PossibleMethods is the set of all possible Duo 2FA methods.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { Call(ctx *middlewares.AutheliaCtx, values url.Values, method string, path string) (*Response, error) PreAuthCall(ctx *middlewares.AutheliaCtx, values url.Values) (*PreAuthResponse, error) AuthCall(ctx *middlewares.AutheliaCtx, values url.Values) (*AuthResponse, error) }
API interface wrapping duo api library for testing purpose.
type APIImpl ¶
APIImpl implementation of DuoAPI interface.
func (*APIImpl) AuthCall ¶ added in v4.33.0
func (d *APIImpl) AuthCall(ctx *middlewares.AutheliaCtx, values url.Values) (*AuthResponse, error)
AuthCall call to the DuoAPI.
func (*APIImpl) Call ¶
func (d *APIImpl) Call(ctx *middlewares.AutheliaCtx, values url.Values, method string, path string) (*Response, error)
Call call to the DuoAPI.
func (*APIImpl) PreAuthCall ¶ added in v4.33.0
func (d *APIImpl) PreAuthCall(ctx *middlewares.AutheliaCtx, values url.Values) (*PreAuthResponse, error)
PreAuthCall call to the DuoAPI.
type AuthResponse ¶ added in v4.33.0
type AuthResponse struct { Result string `json:"result"` Status string `json:"status"` StatusMessage string `json:"status_msg"` TrustedDeviceToken string `json:"trusted_device_token"` }
AuthResponse is a response for a authorization request.
type Device ¶ added in v4.33.0
type Device struct { Capabilities []string `json:"capabilities"` Device string `json:"device"` DisplayName string `json:"display_name"` Name string `json:"name"` SmsNextcode string `json:"sms_nextcode"` Number string `json:"number"` Type string `json:"type"` }
Device holds all necessary info for frontend.
Click to show internal directories.
Click to hide internal directories.