web

package
v0.0.0-...-de156ab Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

README

Implemented, Name, Access, Request Formats, Method, Path, Response Formats [ ] Dashboard Auth Required GET / HTML, JSON [o] Token List Permissioned GET /tokens HTML, JSON [x] Passphrase Form Public GET /tokens/new HTML, JSON Schema [ ] New Auth Token Public HTML Form, JSON POST /tokens HTML, JSON [o] Identity List Permissioned GET /identities HTML, JSON [x] New Identity Form Public GET /identities/new HTML, JSON Schema [ ] Create Identity Public HTML Form, JSON POST /identities HTML, JSON [ ] Identity Details Permissioned GET /identities/ HTML, JSON

HTTP API

Resources

Dashboard
GET /
Tokens
POST /tokens
New Token Form
GET /token/new
Identities
POST /identities
New Identity Form
GET /identities/new

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNotAuthenticated = fmt.Errorf("Token not found in request context")
)

Functions

func NewHandler

func NewHandler(c *Config) (http.Handler, error)

func RequireTokenAuth

func RequireTokenAuth(identity identity.PublicIdentity, h http.Handler) http.Handler

func TokenFromContext

func TokenFromContext(ctx context.Context) *jwt.Token

Types

type Config

type Config struct {
	Identity      identity.PrivateIdentity
	IdentityStore identity.Store
	TokenStore    token.Store
}

type DashboardPage

type DashboardPage struct {
	*Page
	AccessToken *jwt.Token
}

type NewIdentityPage

type NewIdentityPage struct {
	*Page
	ID string
}

type NewIdentityRequest

type NewIdentityRequest struct {
	Alias      string `json:"alias"`
	Passphrase string `json:"passphrase"`
}

type NewIdentityResponse

type NewIdentityResponse struct {
	ID string `json:"id"`
}

type NewTokenPage

type NewTokenPage struct {
	*Page
	Token string
}

type NewTokenResponse

type NewTokenResponse struct {
	Token string `json:"token"`
}

type Page

type Page struct {
	Encoding     string
	LanguageCode string
	Title        string
	CSRFToken    string
}

Jump to

Keyboard shortcuts

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