proxy

package
v0.0.0-...-1911835 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceAll StripeResource = 0

	// Core resources
	ResourceBalance           = 1
	ResourceCharges           = 2
	ResourceCustomers         = 3
	ResourceDisputes          = 4
	ResourceEvents            = 5
	ResourceFileUploads       = 6
	ResourceRefunds           = 7
	ResourceTokens            = 8
	ResourceTransfers         = 9
	ResourceTransferReversals = 10

	// Connect resources
	ResourceAccount              = 11
	ResourceApplicationFeeRefund = 12
	ResourceApplicationFee       = 13
	ResourceRecipient            = 14
	ResourceCountrySpec          = 15
	ResourceExternalAccount      = 16

	// Payment methods
	ResourceSource = 17

	// Relay resources
	ResourceOrder       = 18
	ResourceOrderReturn = 19
	ResourceProduct     = 20
	ResourceSKU         = 21

	// Subscription resources
	ResourceCoupon           = 22
	ResourceInvoice          = 23
	ResourceInvoiceItem      = 24
	ResourcePlan             = 25
	ResourceSubscription     = 26
	ResourceSubscriptionItem = 27

	// Radar resources
	ResourceRadarReview = 28
	ResourceRadarRule   = 29
)

Note: these do not use iota so that they are stable through modifications of the list.

View Source
const (
	None      = 0
	Read      = 1
	Write     = 2
	ReadWrite = 3
)

Note: these do not use iota so that they are stable through modifications of the list.

Variables

This section is empty.

Functions

func NewStripePermissionsProxy

func NewStripePermissionsProxy(stripeKey string, delegate http.Handler) http.Handler

func Sign

func Sign(p *Permission, stripeKey []byte) (string, error)

Types

type Access

type Access int

type ErrorResponse

type ErrorResponse struct {
	StripeError stripe.Error `json:"error"`
}

type Permission

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

func NewPermission

func NewPermission(initialValue uint64) *Permission

func Verify

func Verify(credentials string, stripeKey []byte) (*Permission, error)

func (*Permission) BinaryUnmarshaler

func (p *Permission) BinaryUnmarshaler(data []byte) error

func (*Permission) Can

func (p *Permission) Can(access Access, resources ...StripeResource) bool

func (*Permission) MarshalBinary

func (p *Permission) MarshalBinary() ([]byte, error)

func (*Permission) SetAccess

func (p *Permission) SetAccess(access Access, resources ...StripeResource)

type StripeResource

type StripeResource int

Jump to

Keyboard shortcuts

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