grant

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFormRenderer = grantTemplateRenderer{}

DefaultFormRenderer displays a page prompting the user to approve an OAuth grant. The requesting client id, requested scopes, and redirect URI are displayed to the user.

Functions

This section is empty.

Types

type Form

type Form struct {
	Action string
	Error  string
	Values FormValues
}

type FormRenderer

type FormRenderer interface {
	Render(form Form, w http.ResponseWriter, req *http.Request)
}

FormRenderer is responsible for rendering a Form to prompt the user to approve or reject a requested OAuth scope grant.

type FormValues

type FormValues struct {
	Then        string
	CSRF        string
	ClientID    string
	UserName    string
	Scopes      string
	RedirectURI string
}

type Grant

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

func NewGrant

func NewGrant(csrf csrf.CSRF, auth authenticator.Request, render FormRenderer, clientregistry clientregistry.Registry, authregistry clientauthorization.Registry) *Grant

func (*Grant) Install

func (l *Grant) Install(mux Mux, paths ...string)

Install registers the grant handler into a mux. It is expected that the provided prefix will serve all operations. Path MUST NOT end in a slash.

func (*Grant) ServeHTTP

func (l *Grant) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Mux

type Mux interface {
	Handle(pattern string, handler http.Handler)
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
}

Mux is an object that can register http handlers.

Jump to

Keyboard shortcuts

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