oauthResponseHandler

package
v0.1.10-hotfix1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DISABLE_DEST                = "DISABLE_DESTINATION"
	REFRESH_TOKEN               = "REFRESH_TOKEN"
	INVALID_REFRESH_TOKEN_GRANT = "refresh_token_invalid_grant"
)

Variables

This section is empty.

Functions

func Init

func Init()

Types

type AccountSecret

type AccountSecret struct {
	ExpirationDate string          `json:"expirationDate"`
	Secret         json.RawMessage `json:"secret"`
}

type AuthResponse

type AuthResponse struct {
	Account AccountSecret
	Err     string
}

type Authorizer

type Authorizer interface {
	Setup()
	DisableDestination(destination backendconfig.DestinationT, workspaceId string, rudderAccountId string) (statusCode int, resBody string)
	RefreshToken(refTokenParams *RefreshTokenParams) (int, *AuthResponse)
	FetchToken(fetchTokenParams *RefreshTokenParams) (int, *AuthResponse)
}

type ControlPlaneRequestT

type ControlPlaneRequestT struct {
	Body        string
	ContentType string
	Url         string
	Method      string

	RequestType string // This is to add more refined stat tags
	// contains filtered or unexported fields
}

type DisableDestinationResponse

type DisableDestinationResponse struct {
	Enabled       bool   `json:"enabled"`
	DestinationId string `json:"id"`
}

type OAuthErrResHandler

type OAuthErrResHandler struct {
	TokenProvider tokenProvider
	// contains filtered or unexported fields
}

OAuthErrResHandler is the handle for this class

func NewOAuthErrorHandler

func NewOAuthErrorHandler(provider tokenProvider) *OAuthErrResHandler

This function creates a new OauthErrorResponseHandler

func (*OAuthErrResHandler) DisableDestination

func (authErrHandler *OAuthErrResHandler) DisableDestination(destination backendconfig.DestinationT, workspaceId string, rudderAccountId string) (statusCode int, respBody string)

func (*OAuthErrResHandler) FetchToken

func (authErrHandler *OAuthErrResHandler) FetchToken(fetchTokenParams *RefreshTokenParams) (int, *AuthResponse)

func (*OAuthErrResHandler) GetTokenInfo

func (authErrHandler *OAuthErrResHandler) GetTokenInfo(refTokenParams *RefreshTokenParams, logTypeName string, authStats *OAuthStats) (int, *AuthResponse)

func (*OAuthErrResHandler) RefreshToken

func (authErrHandler *OAuthErrResHandler) RefreshToken(refTokenParams *RefreshTokenParams) (int, *AuthResponse)

func (*OAuthErrResHandler) Setup

func (authErrHandler *OAuthErrResHandler) Setup()

type OAuthStats

type OAuthStats struct {
	// contains filtered or unexported fields
}

func (*OAuthStats) SendCountStat

func (refStats *OAuthStats) SendCountStat()

Send count type stats related to OAuth(Destination)

func (*OAuthStats) SendTimerStats

func (authStats *OAuthStats) SendTimerStats(startTime time.Time)

type RefreshTokenBodyParams

type RefreshTokenBodyParams struct {
	HasExpired    bool   `json:"hasExpired"`
	ExpiredSecret string `json:"expiredSecret"`
}

type RefreshTokenParams

type RefreshTokenParams struct {
	AccountId       string
	WorkspaceId     string
	DestDefName     string
	EventNamePrefix string
	WorkerId        int
	Secret          json.RawMessage
}

Jump to

Keyboard shortcuts

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