Skip to content

Avoid HF token leaks in static snapshots#535

Merged
abidlabs merged 7 commits into
mainfrom
static-secret
Apr 26, 2026
Merged

Avoid HF token leaks in static snapshots#535
abidlabs merged 7 commits into
mainfrom
static-secret

Conversation

@abidlabs
Copy link
Copy Markdown
Member

@abidlabs abidlabs commented Apr 26, 2026

Static Spaces canot safely pass in HF_TOKENs so now we just reject private static sync/freeze requests instead of exposing HF tokens

Fixes #534

@gradio-pr-bot
Copy link
Copy Markdown
Contributor

gradio-pr-bot commented Apr 26, 2026

🪼 branch checks and previews

Name Status URL
🦄 Changes detected! Details

@gradio-pr-bot
Copy link
Copy Markdown
Contributor

gradio-pr-bot commented Apr 26, 2026

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
trackio patch

  • Avoid HF token leaks in static snapshots

‼️ Changeset not approved. Ensure the version bump is appropriate for all packages before approving.

  • Maintainers can approve the changeset by checking this checkbox.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

HuggingFaceDocBuilderDev commented Apr 26, 2026

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview

Install Trackio from this PR (includes built frontend)

pip install "https://huggingface.co/buckets/trackio/trackio-wheels/resolve/b049f26908b8bee8dbc286ff1a2fdc89b75373c6/trackio-0.25.0-py3-none-any.whl"

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@abidlabs abidlabs marked this pull request as ready for review April 26, 2026 00:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Trackio’s static Space deployment flow to prevent Hugging Face access tokens from being embedded in static snapshot artifacts, aligning static dashboards with a “public snapshot data only” model.

Changes:

  • Remove HF token usage from the static frontend data-fetch path (no auth headers).
  • Force static sync/freeze outputs (Space + bucket/dataset) to be public and warn when private=True is requested.
  • Update user-facing docs to clarify that private=True is unsupported for sdk="static" and frozen static snapshots.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
trackio/frontend/src/lib/staticApi.js Removes Authorization header injection for static snapshot reads.
trackio/deploy.py Stops writing tokens into static config.json, forces static repos/buckets public, adds warnings for private=True.
docs/source/deploy_embed.md Documents that static dashboards require public snapshot data; removes/adjusts private=True guidance.
docs/source/cli_commands.md Clarifies CLI --private is unsupported with --sdk static and for frozen snapshots.
README.md Adds a short note that static spaces don’t support private=True.
.changeset/rich-queens-marry.md Records the behavior change as a minor release note.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread trackio/deploy.py
Comment thread trackio/deploy.py
Comment thread trackio/deploy.py Outdated
abidlabs and others added 2 commits April 25, 2026 17:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Convert private=True warning to ValueError in deploy_as_static_space, sync(sdk=static), and freeze
- Add unit test asserting static Space config.json never contains an HF token

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@abidlabs abidlabs merged commit d7f1b27 into main Apr 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

trackio.sync(sdk="static", private=True) embeds HF token in config.json → 400 from Hub push API

5 participants