GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add secrets management API (list/set/remove) to TinybirdClient by sandshoes · Pull Request #33 · tinybirdco/tinybird-sdk-python

Conversation

@sandshoes

@sandshoes sandshoes commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The SDK's secret() helper only emits a {{ tb_secret(...) }} placeholder reference in datafiles — it can't manage the underlying secret value, so even an all-Python-SDK project needed tb secret set on the side.
  • Adds a client.secrets namespace (list() / set(name, value) / remove(name)) wrapping Tinybird's /v0/variables endpoint, matching tb secret ls/set/rm.
  • set() checks whether the secret exists first (GET /v0/variables/{name}) and creates (POST /v0/variables) or updates (PUT /v0/variables/{name}) accordingly — mirroring the create-or-update logic in the Forward CLI's own secret set command.
  • Verified the real endpoint contract (/v0/variables, form-encoded name/value body, variables list key) against the vendored tinybird CLI package's TinyB client (tinybird/tb/client.py) rather than guessing.

Secret-value sensitivity: list() only ever returns name/created_at/updated_at (the API itself never returns values), and the error-raising path only ever surfaces the server's error body — the value passed to set() is never interpolated into an exception message. Covered by a dedicated regression test (test_set_secret_value_never_leaks_into_error_message).

Closes https://linear.app/tinybird/issue/PROTM-2265/python-sdk-add-secrets-management-api-lssetrm

Checklist

  • CI is green (lint, typecheck, test) — secrets/gitleaks fails in this sandbox only on an unrelated SSL cert error fetching its pre-commit env
  • pre-commit run --all-files passes locally (blocked by the same sandbox SSL/network limitation, not by this change)
  • Tests were added or updated when behavior changed
  • Public API / typing changes were reviewed
  • Documentation was updated (README.md) with a "Secrets Management" section
  • Breaking changes are clearly documented (none — purely additive)
  • CHANGELOG.md was updated when user-facing behavior changed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Tommy Healy @claude
Add secrets management API (list/set/remove) to TinybirdClient
1bbc1d9
Wraps /v0/variables so the SDK can manage the values behind the
secret() placeholder helper, matching tb secret ls/set/rm. set()
creates the secret if it doesn't exist yet, otherwise updates its
value. Secret values are never returned by list() or surfaced in
error messages.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@sandshoes
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.