cadmus_core/view/github.rs
1use secrecy::SecretString;
2
3/// Events emitted by GitHub authentication and API interactions.
4#[derive(Debug, Clone)]
5pub enum GithubEvent {
6 /// Device flow completed successfully; carries the new access token.
7 DeviceAuthComplete(SecretString),
8 /// Device flow code expired before the user authorized.
9 DeviceAuthExpired,
10 /// Device flow failed with an error message.
11 DeviceAuthError(String),
12 /// A GitHub API call returned 401 or 403 — the saved token is invalid,
13 /// revoked, or missing required scopes.
14 ///
15 /// `OtaView` handles this by deleting the stale token, clearing its
16 /// in-memory token, and re-triggering device flow for the pending download.
17 TokenInvalid,
18}