authelia/internal/duo/types.go
James Elliott b4e570358e
fix: include major in go.mod module directive (#2278)
* build: include major in go.mod module directive

* fix: xflags

* revert: cobra changes

* fix: mock doc
2021-08-11 11:16:46 +10:00

33 lines
776 B
Go

package duo
import (
"net/url"
duoapi "github.com/duosecurity/duo_api_golang"
"github.com/authelia/authelia/v4/internal/middlewares"
)
// API interface wrapping duo api library for testing purpose.
type API interface {
Call(values url.Values, ctx *middlewares.AutheliaCtx) (*Response, error)
}
// APIImpl implementation of DuoAPI interface.
type APIImpl struct {
*duoapi.DuoApi
}
// Response response coming from Duo API.
type Response struct {
Response struct {
Result string `json:"result"`
Status string `json:"status"`
StatusMessage string `json:"status_msg"`
} `json:"response"`
Code int `json:"code"`
Message string `json:"message"`
MessageDetail string `json:"message_detail"`
Stat string `json:"stat"`
}