form

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package form enables interactive login without using a web browser.

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

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.

Jump to

Keyboard shortcuts

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