e2eclient

package
v0.0.0-...-04ccfb0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Context       context.Context
	HTTPClient    *http.Client
	OAuthClient   *http.Client
	LocalEndpoint *url.URL
	HTTPHost      httputil.HTTPHost
}

func NewClient

func NewClient(ctx context.Context, mainListenAddr string, httpHost httputil.HTTPHost) *Client

func (*Client) Create

func (c *Client) Create(flowReference FlowReference, urlQuery string) (*FlowResponse, error)

Create creates a new authentication flow.

func (*Client) Get

func (c *Client) Get(stateToken string) (*FlowResponse, error)

Get retrieves the flow state.

func (*Client) Input

func (c *Client) Input(w http.ResponseWriter, r *http.Request, stateToken string, input map[string]interface{}) (*FlowResponse, error)

Input submits the input to the flow.

func (*Client) OAuthRedirect

func (c *Client) OAuthRedirect(url string, redirectUntil string) (finalURL string, err error)

OAuthRedirect follows the OAuth redirect until the URL matches the given prefix.

type FlowAction

type FlowAction struct {
	Type           string                 `json:"type"`
	Identification string                 `json:"identification,omitempty"`
	Authentication string                 `json:"authentication,omitempty"`
	Data           map[string]interface{} `json:"data,omitempty"`
}

type FlowReference

type FlowReference struct {
	Type     string `json:"type"`
	Name     string `json:"name"`
	URLQuery string `json:"url_query,omitempty"`
}

type FlowResponse

type FlowResponse struct {
	StateToken string      `json:"state_token"`
	Type       string      `json:"type,omitempty"`
	Name       string      `json:"name,omitempty"`
	Action     *FlowAction `json:"action,omitempty"`
}

type HTTPResponse

type HTTPResponse struct {
	Result *FlowResponse       `json:"result,omitempty"`
	Error  *apierrors.APIError `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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