Skip to content

Build

Connections

Create a Connection to an external provider, call it from a Function without handling its secret, and test that it works.

A Connection lets your Workspace call an external provider, such as Stripe, GitHub or Microsoft Graph, without your code ever holding the provider's credential. Your code names the Connection, and LimiLake adds the credential on the way out to the provider.

Create a ConnectionLink to this section

Find the provider in the catalog and see what it needs:

bash
limilake connection provider list
limilake connection provider show stripe

Create the Connection. For a provider with static credentials, pass the values as one JSON object on standard input, so the secret never appears in your shell history:

bash
printf '%s' '{"username":"11810","password":"..."}' | \
  limilake connection create --provider wint --workspace finance --values-from -

For an OAuth provider, the same command opens your browser; approve access and return to the terminal:

bash
limilake connection create --provider stripe --workspace finance

Creating a Connection needs editor or owner on the Workspace. The new Connection gets a slug, such as stripe or github, that your code uses to name it.

Use it in a FunctionLink to this section

python
import limilake
from limilake import connections

fn = limilake.function(
    id="123e4567-e89b-42d3-a456-426614174005",  # keep the id the CLI generated
    name="recent-charges",
)


@fn.action
def run() -> dict[str, object]:
    resp = connections.get("stripe", "/v1/charges", params={"limit": 10})
    return {"charges": resp.json()["data"]}

connections also has post, request and paginate, which follows the provider's paging once you describe it (see the Connections reference). LimiLake checks the slug against the Connections your Workspace holds on every call, and refreshes OAuth tokens by itself.

Test itLink to this section

bash
limilake connection test stripe --workspace finance
limilake connection call stripe --workspace finance --method GET --path /v1/charges \
  --query limit=10 --fail

connection test sends a few read-only requests and reports whether authentication works. It exits 0 when healthy, 1 when a probe failed and 9 when health cannot be determined. connection call sends one request of your choice; with --fail it exits 1 on a non-2xx response.

Limits and gotchasLink to this section

  • Calling a Connection needs viewer or higher on the Workspace.
  • Pass secret values through standard input or a protected file (--values-from - or @file, at most 1 MiB), never as --field arguments.
  • Put query parameters in --query key=value, never in --path.
  • A request body sent with connection call is limited to 10 MiB by default (--max-bytes).
  • Code that needs raw material, such as a database password, uses a Secret and secrets.reveal() instead. Revealing needs editor or owner.
  • Rotate a static credential with limilake connection update <slug> --values-from -, and renew OAuth access with limilake connection reauthorize <slug>. Both keep the slug.

Next stepsLink to this section

  • Connections reference: every command and flag, Custom Connections, rotation, sending files and test reports.
  • Functions: write the code that calls a Connection.
  • Sandboxes: why provider credentials never enter the sandbox.