stripeauth

package
v1.53.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package stripeauth handles Stripe session authorization.

Index

Constants

View Source
const MorePermissionsRequiredErrorCode = "more_permissions_required"

MorePermissionsRequiredErrorCode is the Stripe API error code returned when the API key's role does not have permission to perform a request.

Variables

This section is empty.

Functions

func IsMorePermissionsRequiredError added in v1.51.0

func IsMorePermissionsRequiredError(err error) bool

IsMorePermissionsRequiredError returns true if the provided error was caused by a session authorization request returning a `more_permissions_required` error code.

Types

type AuthorizeHTTPError added in v1.38.0

type AuthorizeHTTPError struct {
	StatusCode    int
	Body          string
	ErrorCode     string
	Message       string // the human-readable "message" field from the error response body
	HasOAKContext bool   // true if the request was authenticated with an OAuth/UAT token rather than a plain API key
}

func IsAuthorizationClientError added in v1.31.1

func IsAuthorizationClientError(err error) (*AuthorizeHTTPError, bool)

func (*AuthorizeHTTPError) Error added in v1.38.0

func (e *AuthorizeHTTPError) Error() string

type Client

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

Client is the client used to initiate new CLI sessions with Stripe.

func NewClient

func NewClient(client stripe.RequestPerformer, cfg *Config) *Client

NewClient returns a new Client.

func (*Client) Authorize

func (c *Client) Authorize(ctx context.Context, req CreateSessionRequest) (*StripeCLISession, error)

Authorize sends a request to Stripe to initiate a new CLI session.

type Config

type Config struct {
	Log *log.Logger
}

Config contains the optional configuration parameters of a Client.

type CreateSessionRequest added in v1.15.0

type CreateSessionRequest struct {
	DeviceName        string
	WebSocketFeatures []string

	Filters      *string
	DeviceURLMap *DeviceURLMap
}

CreateSessionRequest defines the API input parameters for client.Authorize.

type DeviceURLMap added in v1.7.4

type DeviceURLMap struct {
	ForwardURL            string
	ForwardConnectURL     string
	ForwardThinURL        string
	ForwardThinConnectURL string
}

DeviceURLMap is a mapping of the urls that the device is listening for forwarded events on.

type StripeCLISession

type StripeCLISession struct {
	DisplayConnectFilterWarning bool   `json:"display_connect_filter_warning"`
	ReconnectDelay              int    `json:"reconnect_delay"`
	Secret                      string `json:"secret"`
	WebSocketAuthorizedFeature  string `json:"websocket_authorized_feature"`
	WebSocketID                 string `json:"websocket_id"`
	WebSocketURL                string `json:"websocket_url"`
	DefaultVersion              string `json:"default_version"`
	LatestVersion               string `json:"latest_version"`
	DeviceToken                 string `json:"device_token"`
}

StripeCLISession is the API resource returned by Stripe when initiating a new CLI session.

Jump to

Keyboard shortcuts

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