Repository navigation
Commit 9362fd9
Use local HF token in Workflow, gated behind a write-token auth model (#13520)
* Use local HF token in Workflow
* add changeset
* Gate Workflow editing and local HF token behind a write token
Locally, launch() prints a private edit link carrying a per-process
write_token (Jupyter-style); the frontend persists it as a cookie.
Sessions without it - share links, tunnels, LAN visitors - get a
read-only canvas, cannot save, and never receive the host's
huggingface_hub token. On Spaces, write access requires OAuth as the
Space owner or an org member with write access.
Co-Authored-By: Claude Fable 5 <[email protected]>
* Address review: simplify token helpers, use whoami cache, trim tests
- Move huggingface_hub imports to top of file; drop defensive try/except
in _get_locally_saved_hf_token
- Drop the GRADIO_WORKFLOW_WRITE_TOKEN env override
- Replace the hand-rolled TTL cache with whoami(cache=True) on a shared
HfApi instance
- Consolidate write-access tests and remove trivial/duplicated ones
Co-Authored-By: Claude Fable 5 <[email protected]>
* changes
* changes
* Remove changesets so CI regenerates one
Co-Authored-By: Claude Fable 5 <[email protected]>
* add changeset
* Address Copilot review: respect quiet, Secure cookie, defer autosave
- Gate the edit-link print behind quiet=True so the write token can't
leak into logs when silence was requested
- Mark the write-token cookie Secure when served over HTTPS
- Defer autosave until the write-access check answers, so guests in the
optimistic window don't fire saves the backend rejects
Co-Authored-By: Claude Fable 5 <[email protected]>
* Fix typecheck: use a real gr.Request in workflow tests
ty rejects SimpleNamespace where Request | None is expected; Request
supports kwargs-based construction for exactly this testing use.
Co-Authored-By: Claude Fable 5 <[email protected]>
* changes
* changes
* changes
* changes
* changes
---------
Co-authored-by: gradio-pr-bot <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>1 parent af4945f commit 9362fd9
13 files changed
Lines changed: 1196 additions & 221 deletions
File tree
- .changeset
- gradio
- js/workflowcanvas/workflow
- icons
- scripts
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
915 | 915 | | |
916 | 916 | | |
917 | 917 | | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
918 | 938 | | |
919 | 939 | | |
920 | 940 | | |
| |||
969 | 989 | | |
970 | 990 | | |
971 | 991 | | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
986 | | - | |
987 | | - | |
988 | | - | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
998 | 1000 | | |
999 | 1001 | | |
1000 | 1002 | | |
| |||
0 commit comments