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
Click to show internal directories.
Click to hide internal directories.