tokens

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

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