api

package
v0.0.0-...-a47b674 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRouter

func GetRouter(conf *Configuration) *mux.Router

GetRouter returns a router given an APIConfiguration

Types

type Configuration

type Configuration struct {
	DB       storage.Datastore
	Keystore keystore.Keystore
	OpenID   *openid.DiscoveryConfig
}

Configuration includes the datastore, the keystore, and the identity provider

func (*Configuration) GetTokenHandler

func (api *Configuration) GetTokenHandler(w http.ResponseWriter, r *http.Request)

GetTokenHandler is an HTTP handler that takes in basic auth, and gives the user a JWT

type GetTokenResponse

type GetTokenResponse struct {
	Token      string `json:"token"` //Spec recommends returning in the body to avoid header size limitations
	ValidUntil int64  `json:"valid_until"`
}

Jump to

Keyboard shortcuts

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