forge-client: take the token as a string, drop TokenSource and StaticToken
This commit is contained in:
parent
a77131ca3f
commit
6d968c7fe6
1 changed files with 44 additions and 81 deletions
|
|
@ -7,7 +7,8 @@ schema change that `forgejo-api` does not yet model is fixed here once.
|
|||
|
||||
## When to use it
|
||||
|
||||
- Building a `forgejo_api` client from a base URL and a token: `async_client`,
|
||||
- Building a `forgejo_api` client from a base URL and a token string:
|
||||
`async_client`,
|
||||
and with the `sync` feature `sync_client`.
|
||||
- Building the raw `reqwest` client for Forgejo's web-router-only routes (the
|
||||
`sync` feature): `raw_blocking_client`.
|
||||
|
|
@ -16,11 +17,10 @@ schema change that `forgejo-api` does not yet model is fixed here once.
|
|||
- Parsing a notification thread from the forge: `NotificationThread`. Every
|
||||
field is optional and lenient, so an unknown or reshaped field cannot fail
|
||||
the page the way `forgejo_api::structs::NotificationThread` does.
|
||||
- Supplying the token: `TokenSource`. `StaticToken` is a fixed string; a
|
||||
caller whose token can change implements the trait and rebuilds its client
|
||||
when `current()` returns a different value.
|
||||
|
||||
## Not here
|
||||
|
||||
Anything that decides what a notification means (delivery, read-state,
|
||||
filtering): that stays in `hive-forge-notify` and `hive-forge`.
|
||||
|
||||
A token that changes (the controller re-reads it from the secret store after a 401) is the caller's to track: it calls `async_client` again with the new value.
|
||||
|
|
|
|||
Loading…
Reference in a new issue