grant

package
v1.3.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2016 License: Apache-2.0 Imports: 16 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
	ThenParam        string
	CSRF             string
	CSRFParam        string
	ClientID         string
	ClientIDParam    string
	UserName         string
	UserNameParam    string
	Scopes           string
	ScopesParam      string
	RedirectURI      string
	RedirectURIParam string
	ApproveParam     string
	DenyParam        string
}

type Grant

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

func NewGrant

func NewGrant(csrf csrf.CSRF, auth authenticator.Request, render FormRenderer, clientregistry oauthclient.Getter, authregistry oauthclientauthorization.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