Skip to content

Commit 3cb31ed

Browse files
committed
trusted publishers update
1 parent d2842de commit 3cb31ed

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

docs/hub/trusted-publishers.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ On `https://huggingface.co/acme/awesome-model/settings`, open **Trusted Publishe
2828
- `workflow` = `publish.yml`
2929

3030
> [!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.
3232
3333
### 2. Add the workflow to your GitHub repo
3434

@@ -186,15 +186,17 @@ No client authentication is needed — the OIDC ID token authenticates the reque
186186
| `invalid_request` | Missing/malformed parameter, or bad `resource` format. |
187187
| `invalid_grant` | Repo or user not found; no publisher matches this issuer; configured claims don't match; signature or audience check failed; account locked. |
188188

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+
189191
</details>
190192

191193
## Security model
192194

193195
- **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.
194196
- **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.
195197
- **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.
198200

199201
## See also
200202

0 commit comments

Comments
 (0)