Miosa.Sandbox.Share (Miosa v1.1.0)

Copy Markdown View Source

Public share URLs for a sandbox (read-only, no API key required at the proxy).

Wraps:

  • POST /sandboxes/:id/shares — create/3
  • GET /sandboxes/:id/shares — list/2
  • DELETE /sandboxes/:id/shares/:share_id — revoke/3

The proxy accepts the query param ?ms=<token> to authenticate share access.

Summary

Functions

Create a share URL for a sandbox.

List share URLs for a sandbox.

Functions

create(client, sandbox_id, opts \\ [])

@spec create(Miosa.Client.t(), String.t(), keyword()) :: Miosa.Client.result(map())

Create a share URL for a sandbox.

POST /sandboxes/:sandbox_id/shares

Options

  • :expires_in — lifetime in seconds. Omit for no expiry.
  • :scope — always "read" (only supported value). Defaults to "read".

Returns {:ok, %{"share_id" => _, "share_url" => _, "expires_at" => _, "scope" => _}}.

list(client, sandbox_id)

List share URLs for a sandbox.

GET /sandboxes/:sandbox_id/shares

revoke(client, sandbox_id, share_id)

Revoke a share URL.

DELETE /sandboxes/:sandbox_id/shares/:share_id