Back to godoc.org
gopkg.in/macaroon-bakery.v2-unstable/httpbakery/form

package form

v2.0.0 (38b77b8)
Latest Go to latest
Published: Oct 26, 2017 | License: LGPL-3.0 | Module: gopkg.in/macaroon-bakery.v2-unstable

Overview

Package form enables interactive login without using a web browser.

Index

Constants

const (
	// InteractionMethod is the methodURLs key
	// used for a URL that can be used for form-based
	// interaction.
	InteractionMethod = "form"
)

type InteractionInfo

type InteractionInfo struct {
	URL string `json:"url"`
}

InteractionInfo holds the information expected in the form interaction entry in an interaction-required error.

type Interactor

type Interactor struct {
	// Filler holds the form filler that will be used when
	// form-based interaction is required.
	Filler form.Filler
}

Interactor implements httpbakery.Interactor by providing form-based interaction.

func (Interactor) Interact

func (i Interactor) Interact(ctx context.Context, client *httpbakery.Client, location string, interactionRequiredErr *httpbakery.Error) (*httpbakery.DischargeToken, error)

Interact implements httpbakery.Interactor.Interact.

func (Interactor) Kind

func (i Interactor) Kind() string

Kind implements httpbakery.Interactor.Kind.

type LoginBody

type LoginBody struct {
	Form map[string]interface{} `json:"form"`
}

LoginBody holds the body of a form login request.

type LoginRequest

type LoginRequest struct {
	httprequest.Route `httprequest:"POST"`
	Body              LoginBody `httprequest:",body"`
}

LoginRequest is a request to perform a login using the provided form.

type LoginResponse

type LoginResponse struct {
	Token *httpbakery.DischargeToken `json:"token"`
}

type SchemaResponse

type SchemaResponse struct {
	Schema environschema.Fields `json:"schema"`
}

SchemaResponse contains the message expected in response to the schema request.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier