Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

router

v1.1.1
djinn-ci.com/oauth2/router

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

7 matches

Top ↑

Functions

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

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.

New

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

Router.RegisterAPI

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

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

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.

Dependency graph