csrf

package
v0.0.0-...-affaa53 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 3 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 interface {
	//Fetches data from CSRF Token Endpoint
	GetTokenEndpointResponse(csrfEndpointURL string, strategy authorization.Strategy) (*Response, apperrors.AppError)

	//Invalidates cached data
	InvalidateTokenCache(csrfEndpointURL string)
}

CSRF Client is an HTTP client responsible for fetching and caching CSRF Tokens.

type Response

type Response struct {
	CSRFToken string         //Opaque value
	Cookies   []*http.Cookie //Must be included in API requests along with the token for CSFR verification to succeed
}

CSFR Endpoint response data

type TokenStrategy

type TokenStrategy interface {
	//Sets CSRF Token into requests to external APIs
	AddCSRFToken(apiRequest *http.Request) apperrors.AppError

	//Invalidates cached CSRF Token
	Invalidate()
}

Augments upstream API requests with CSRF data.

type TokenStrategyFactory

type TokenStrategyFactory interface {
	Create(authorizationStrategy authorization.Strategy, csrfTokenEndpointURL string) TokenStrategy
}

Creates new instances of TokenStrategy

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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