Documentation ¶
Overview ¶
Package codes defines a web controller for the code status page of the verification server. This view allows users to view the status of previously-issued OTP codes.
Index ¶
- type Code
- type Controller
- func (c *Controller) HandleBulkIssue() http.Handler
- func (c *Controller) HandleCheckCodeStatus() http.Handler
- func (c *Controller) HandleExpireAPI() http.Handler
- func (c *Controller) HandleExpirePage() http.Handler
- func (c *Controller) HandleIndex() http.Handler
- func (c *Controller) HandleIssue() http.Handler
- func (c *Controller) HandleShow() http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code struct { UUID string `json:"uuid"` Claimed bool `json:"claimed"` Status string `json:"status"` TestType string `json:"testType"` IssuerType string `json:"issuerType"` Issuer string `json:"issuer"` Expires int64 `json:"expires"` LongExpires int64 `json:"longExpires"` HasLongExpires bool `json:"hasLongExpires"` }
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewAPI ¶
func NewAPI(cfg *config.AdminAPIServerConfig, db *database.Database, h *render.Renderer) *Controller
NewAPI creates a new controller serving API requests.
func NewServer ¶
func NewServer(cfg *config.ServerConfig, db *database.Database, h *render.Renderer) *Controller
NewServer creates a new controller for serving admin server requests.
func (*Controller) HandleBulkIssue ¶ added in v0.18.0
func (c *Controller) HandleBulkIssue() http.Handler
HandleBulkIssue shows the page for bulk-issuing codes.
func (*Controller) HandleCheckCodeStatus ¶
func (c *Controller) HandleCheckCodeStatus() http.Handler
func (*Controller) HandleExpireAPI ¶
func (c *Controller) HandleExpireAPI() http.Handler
HandleExpireAPI handles the verification code expiry API via JSON
func (*Controller) HandleExpirePage ¶
func (c *Controller) HandleExpirePage() http.Handler
HandleExpirePage handles the verification code expire PATCH request made from the show page.
func (*Controller) HandleIndex ¶
func (c *Controller) HandleIndex() http.Handler
HandleIndex renders the html to show a list of recent codes and form to query code status.
func (*Controller) HandleIssue ¶
func (c *Controller) HandleIssue() http.Handler
func (*Controller) HandleShow ¶
func (c *Controller) HandleShow() http.Handler
HandleShow renders html for the status of an issued verification code