Documentation ¶
Index ¶
- Variables
- func LoadConfig(env string) error
- func LoadProviderStore() error
- func PushToConvoy(ctx context.Context, m pubSubMessage) error
- func WebhookEndpoint(w http.ResponseWriter, r *http.Request)
- func WebhooksHandler(w http.ResponseWriter, r *http.Request)
- type APIKeyConfig
- type APIKeyVerifier
- type BasicAuthConfig
- type BasicAuthVerifier
- type Configuration
- type HmacConfig
- type HmacVerifier
- type IPAddressConfig
- type IPAddressVerifier
- type Provider
- type ProviderConfig
- type ProviderStore
- type Verifier
- type VerifierConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// Configuration Environment Variable
CONFIG_ENV = "CONVOY_INGESTER_CONFIG"
)
View Source
var ErrAlgoNotFound = errors.New("Algorithm not found")
View Source
var ErrAuthHeader = errors.New("Invalid Authorization header")
View Source
var ErrAuthHeaderCannotBeEmpty = errors.New("Auth header cannot be empty")
View Source
var ErrCannotDecodeMACHeader = errors.New("Cannot decode MAC header")
View Source
var ErrCannotReadRequestBody = errors.New("Failed to read request body")
View Source
var ErrHashDoesNotMatch = errors.New("Invalid Signature - Hash does not match")
View Source
var ErrInvalidAuthLength = errors.New("Invalid Basic Auth Length")
View Source
var ErrInvalidHeaderStructure = errors.New("Invalid header structure")
View Source
var ErrInvalidIP = errors.New("Source IP not supported")
View Source
var ErrSignatureCannotBeEmpty = errors.New("Signature cannot be empty")
Functions ¶
func LoadConfig ¶
func LoadProviderStore ¶
func LoadProviderStore() error
func PushToConvoy ¶
PushToConvoy is a Pub/Sub Triggered Function to push events to Convoy.
func WebhookEndpoint ¶
func WebhookEndpoint(w http.ResponseWriter, r *http.Request)
WebhookEndpoint is a HTTP Function to receive events from the world.
Types ¶
type APIKeyConfig ¶
type APIKeyVerifier ¶
type APIKeyVerifier struct {
// contains filtered or unexported fields
}
func (*APIKeyVerifier) VerifyRequest ¶
func (aV *APIKeyVerifier) VerifyRequest(r *http.Request, payload []byte) error
type BasicAuthConfig ¶
type BasicAuthVerifier ¶
type BasicAuthVerifier struct {
// contains filtered or unexported fields
}
func (*BasicAuthVerifier) VerifyRequest ¶
func (baV *BasicAuthVerifier) VerifyRequest(r *http.Request, payload []byte) error
type Configuration ¶
type Configuration []ProviderConfig
type HmacConfig ¶
type HmacVerifier ¶
type HmacVerifier struct {
// contains filtered or unexported fields
}
func (*HmacVerifier) VerifyRequest ¶
func (hV *HmacVerifier) VerifyRequest(r *http.Request, payload []byte) error
type IPAddressConfig ¶
type IPAddressConfig struct {
IPSafelist []string `json:"ip_safelist"`
}
type IPAddressVerifier ¶
type IPAddressVerifier struct {
// contains filtered or unexported fields
}
func (*IPAddressVerifier) VerifyRequest ¶
func (ipV *IPAddressVerifier) VerifyRequest(r *http.Request, payload []byte) error
type ProviderConfig ¶
type ProviderConfig struct { Name string `json:"name"` AppID string `json:"app_id"` VerifierConfig VerifierConfig `json:"verifier_config"` }
type VerifierConfig ¶
type VerifierConfig struct { *HmacConfig *BasicAuthConfig *APIKeyConfig *IPAddressConfig }
func (*VerifierConfig) UnmarshalJSON ¶
func (vC *VerifierConfig) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.