Documentation
¶
Overview ¶
Package sandbox provisions anonymous Stripe sandbox environments.
Index ¶
- Variables
- func SolveChallenge(ctx context.Context, algorithm, challenge, salt string) (int64, error)
- type ChallengeResponse
- type Client
- type CreateOptions
- type CreatedSandbox
- type DeletedSandbox
- type HTTPError
- type ManagedSandbox
- type ManagementClient
- type ProvisionRequest
- type ProvisionResponse
- func (r *ProvisionResponse) GetAccountID() string
- func (r *ProvisionResponse) GetClaimURL() string
- func (r *ProvisionResponse) GetExpiresAt() string
- func (r *ProvisionResponse) GetPublishableKey() string
- func (r *ProvisionResponse) GetSecretKey() string
- func (r *ProvisionResponse) UnmarshalJSON(data []byte) error
- type SandboxAccessLevel
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnsupportedAlgorithm = errorcategory.New(errorcategory.UserInput, "unsupported algorithm: only SHA-256 is supported") ErrMaxIterationsReached = errorcategory.New(errorcategory.Internal, "proof-of-work exceeded maximum iterations") )
var GitConfigFunc = defaultGitConfig
GitConfigFunc resolves git config values. Replaceable in tests.
Functions ¶
Types ¶
type ChallengeResponse ¶
type Client ¶
func (*Client) GetChallenge ¶
func (*Client) Provision ¶
func (c *Client) Provision(ctx context.Context, req ProvisionRequest) (*ProvisionResponse, error)
type CreateOptions ¶ added in v1.54.0
CreateOptions describes one authenticated sandbox creation request.
type CreatedSandbox ¶ added in v1.54.0
type CreatedSandbox struct {
AccountID string
}
CreatedSandbox is the public identifier returned after creation.
type DeletedSandbox ¶ added in v1.54.0
DeletedSandbox is the public result returned after deletion is confirmed.
type ManagedSandbox ¶ added in v1.54.0
type ManagedSandbox struct {
WorkspaceID string
AccountID string
Name string
AccessLevel SandboxAccessLevel
IsLegacyTestmode bool
}
ManagedSandbox is the normalized representation shared by sandbox list and delete. WorkspaceID is retained for later targeting but must not be shown to users.
type ManagementClient ¶ added in v1.54.0
ManagementClient discovers sandboxes authorized by the active live OAuth account.
func NewManagementClient ¶ added in v1.54.0
func NewManagementClient(apiBaseURL string, profile *config.Profile) *ManagementClient
NewManagementClient creates a sandbox management client using the supplied Stripe API base URL and CLI profile.
func (*ManagementClient) Create ¶ added in v1.54.0
func (c *ManagementClient) Create(ctx context.Context, options CreateOptions) (CreatedSandbox, error)
Create creates a sandbox beneath the active live OAuth account.
func (*ManagementClient) Delete ¶ added in v1.54.0
func (c *ManagementClient) Delete(ctx context.Context, accountID string) (DeletedSandbox, error)
Delete closes a sandbox beneath the active live OAuth account.
func (*ManagementClient) ListAccessible ¶ added in v1.54.0
func (c *ManagementClient) ListAccessible(ctx context.Context) ([]ManagedSandbox, error)
ListAccessible resolves the active live OAuth workspace and returns the sandboxes accessible beneath it.
type ProvisionRequest ¶
type ProvisionResponse ¶
type ProvisionResponse struct {
// contains filtered or unexported fields
}
ProvisionResponse wraps the server response loosely so field additions or type changes don't break the CLI.
func (*ProvisionResponse) GetAccountID ¶
func (r *ProvisionResponse) GetAccountID() string
func (*ProvisionResponse) GetClaimURL ¶
func (r *ProvisionResponse) GetClaimURL() string
func (*ProvisionResponse) GetExpiresAt ¶
func (r *ProvisionResponse) GetExpiresAt() string
func (*ProvisionResponse) GetPublishableKey ¶
func (r *ProvisionResponse) GetPublishableKey() string
func (*ProvisionResponse) GetSecretKey ¶
func (r *ProvisionResponse) GetSecretKey() string
func (*ProvisionResponse) UnmarshalJSON ¶
func (r *ProvisionResponse) UnmarshalJSON(data []byte) error
type SandboxAccessLevel ¶ added in v1.54.0
type SandboxAccessLevel int
SandboxAccessLevel describes the sandbox's default team access setting.
const ( SandboxAccessLevelPrivate SandboxAccessLevel = iota + 1 SandboxAccessLevelGlobal SandboxAccessLevelDeveloper )