im_old
Clone
https://git.tahinli.com/Tahinli/im_old.git
0 watching0 forksRustGPL-3.0755.6 KiB84318dcTahinli2 months ago77 commits
| 1 | //! im-client: the app-side SDK for im, in two halves. |
| 2 | //! |
| 3 | //! **The directory SDK** ([`directory`], always compiled): a consumer with |
| 4 | //! its own OIDC client crate takes this and nothing else — |
| 5 | //! [`directory::DirectoryClient`] pulls the roster and the photos and |
| 6 | //! follows [`directory::DirectoryEvent`]s off the live stream, and |
| 7 | //! [`directory::spawn_sync`] keeps a local mirror in step with backoff and |
| 8 | //! resync. Build it with `default-features = false`. |
| 9 | //! |
| 10 | //! **The drop-in OIDC client** (the `oidc` feature, on by default): |
| 11 | //! `im_client::mount(builder, config)` when it builds its router, |
| 12 | //! `.discover()` as usual (the `/auth/login`, `/auth/callback`, |
| 13 | //! `/auth/logout` routes register themselves), and |
| 14 | //! `im_client::current_user(cx)` wherever it needs the person. im holds the |
| 15 | //! central session; this half holds the app's side of it — an encrypted |
| 16 | //! cookie holding the opaque session token, introspected against im on |
| 17 | //! every request. |
| 18 | //! |
| 19 | //! The two halves share the crate's [`Error`]/[`Result`]. The OIDC half's |
| 20 | //! routes register through the grammar's inventory, so a binary that also |
| 21 | //! speaks OIDC through its own client crate must build this crate with |
| 22 | //! `default-features = false`, or the two route sets collide at router |
| 23 | //! build. |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | pub type Result<T, E = Error> = Result; |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | pub use ; |