Documentation
¶
Overview ¶
Package tokens manages the API tokens and OAuth connections: refused to a token, a login only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(db bun.IDB) http.HandlerFunc
Create makes an API token, shown once. @Summary Create an API token @Tags tokens @Accept json @Produce json @Param body body createapitoken.Input true "body" @Success 201 {object} createapitoken.Result @Failure 400 {object} respond.Failure @Failure 401 {object} respond.Failure @Failure 403 {object} respond.Failure @Router /api/tokens [post]
func Delete ¶
func Delete(db bun.IDB) http.HandlerFunc
Delete revokes an API token or an OAuth connection. @Summary Revoke a token @Tags tokens @Param id path string true "Token id" @Success 204 @Failure 401 {object} respond.Failure @Failure 403 {object} respond.Failure @Failure 404 {object} respond.Failure @Router /api/tokens/{id} [delete]
func List ¶
func List(db bun.IDB) http.HandlerFunc
List gives the API tokens and OAuth connections, newest first. @Summary List the tokens @Tags tokens @Produce json @Success 200 {array} domain.Token @Failure 401 {object} respond.Failure @Failure 403 {object} respond.Failure @Router /api/tokens [get]
Types ¶
This section is empty.