You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/hub/trusted-publishers.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ On `https://huggingface.co/acme/awesome-model/settings`, open **Trusted Publishe
28
28
-`workflow` = `publish.yml`
29
29
30
30
> [!TIP]
31
-
> `repository` alone scopes the publisher to a GitHub repo. Add `ref` and/or `workflow` to also pin it to a branch or workflow file — recommended.
31
+
> `repository` alone scopes the publisher to a GitHub repo. Add `branch` and/or `workflow` to also pin it to a branch or workflow file — recommended.
32
32
33
33
### 2. Add the workflow to your GitHub repo
34
34
@@ -186,15 +186,17 @@ No client authentication is needed — the OIDC ID token authenticates the reque
186
186
|`invalid_request`| Missing/malformed parameter, or bad `resource` format. |
187
187
|`invalid_grant`| Repo or user not found; no publisher matches this issuer; configured claims don't match; signature or audience check failed; account locked. |
188
188
189
+
When the `hf` CLI performs the exchange, a failure surfaces the `error` code along with a `(Request ID: …)` — include that Request ID when reporting an issue so we can trace the exchange in our logs.
190
+
189
191
</details>
190
192
191
193
## Security model
192
194
193
195
-**Tokens are short-lived.** 60 minutes from the moment of exchange — the clock only starts when you call the endpoint, not when the workflow starts. There's no refresh token; long jobs should re-exchange.
194
196
-**Repo tokens are repo-scoped.** A token for `acme/awesome-model` cannot touch `acme/anything-else`. Pushes are attributed to a synthetic `[OIDC]` system user, with a reference to the originating issuer and subject.
195
197
-**User tokens are read-only.** Only the `gated-repos` scope — no writes, no private repos, no account management.
196
-
-**Claims are matched exactly.** No regex, no prefix matching. `ref = refs/heads/main` will reject `refs/heads/main-backup`.
197
-
-**Audit logs.** Adding or removing a publisher is logged, and successful exchanges update `lastUsedAt`. For security, error descriptions don't reveal which specific check failed.
198
+
--**Claims are matched exactly.** No regex, no prefix matching.
199
+
-**Audit logs.** Adding or removing a publisher is logged, and successful exchanges update last used time.
0 commit comments