grant

package
v3.8.21-1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2017 License: Apache-2.0 Imports: 20 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

	ServiceAccountName      string
	ServiceAccountNamespace string

	GrantedScopes interface{}

	Names  GrantFormFields
	Values GrantFormFields
}

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 Grant

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

func NewGrant

func NewGrant(csrf csrf.CSRF, auth authenticator.Request, render FormRenderer, clientregistry oauthclientregistry.Getter, authregistry oauthclient.OAuthClientAuthorizationInterface) *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 GrantFormFields added in v1.3.0

type GrantFormFields struct {
	Then        string
	CSRF        string
	ClientID    string
	UserName    string
	Scopes      interface{}
	RedirectURI string
	Approve     string
	Deny        string
}

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.

type Scope added in v1.3.0

type Scope struct {
	// Name is the string included in the OAuth scope parameter
	Name string
	// Description is a human-readable description of the scope. May be empty.
	Description string
	// Warning is a human-readable warning about the scope. Typically used to scare the user about escalating permissions. May be empty.
	Warning string
	// Error is a human-readable error, typically around the validity of the scope. May be empty.
	Error string
	// Granted indicates whether the user has already granted this scope.
	Granted bool
}

Jump to

Keyboard shortcuts

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