router

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gate

func Gate(db *sqlx.DB) web.Gate

Gate returns a web.Gate that checks if the current authenticated user has the access permissions to the current token. If the current user can access the current token, then it is set in the request's context.

Types

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router is what registers the routes to handling the management of OAuth tokens, and applications. It implements the server.Router interface.

func New

func New(cfg *config.Server, h web.Handler, mw web.Middleware) *Router

func (*Router) RegisterAPI

func (r *Router) RegisterAPI(_ string, _ *mux.Router, _ ...web.Gate)

RegisterAPI is a stub method to implement the server.Router interface.

func (*Router) RegisterUI

func (r *Router) RegisterUI(mux *mux.Router, csrf func(http.Handler) http.Handler, gates ...web.Gate)

RegisterUI registers the UI routes for handling the OAuth web flow, managing OAuth apps, and personal access tokens. No CSRF protection is applied to the OAuth web flow routes.

Jump to

Keyboard shortcuts

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