uberhook

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID       string `json:"event_id"`
	TimeUnix int64  `json:"event_time"`
	Type     string `json:"event_type"`

	Meta *Meta `json:"meta"`

	URL string `json:"resource_href"`
}

func FparseEvent

func FparseEvent(r io.Reader) (*Event, error)

type Meta

type Meta struct {
	UserID     string      `json:"user_id"`
	ResourceID string      `json:"resource_id"`
	Status     uber.Status `json:"status"`
}

type Status

type Status string

type Webhook

type Webhook struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New() (*Webhook, error)

func (*Webhook) ExcludeMethodAndPath

func (w *Webhook) ExcludeMethodAndPath() bool

Uber's webhook signature verification only consists of (clientSecret, webhookBody)

func (*Webhook) HeaderValues

func (v *Webhook) HeaderValues(hdr http.Header) ([]string, []string, error)

func (*Webhook) LookupAPIKey

func (v *Webhook) LookupAPIKey(hdr http.Header) (string, error)

func (*Webhook) LookupSecret

func (v *Webhook) LookupSecret(apiKey string) ([]byte, error)

func (*Webhook) Middleware

func (w *Webhook) Middleware(next http.Handler) http.Handler

func (*Webhook) Signature

func (v *Webhook) Signature(hdr http.Header) (string, error)

Jump to

Keyboard shortcuts

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