1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Scope action and resource enums for AT Protocol OAuth.
//!
//! These types are used in both OAuth scope parsing and permission set
//! lexicon definitions, allowing consistent validation and serialization.
use serde::{Deserialize, Serialize};
/// Account resource types for AT Protocol OAuth scopes.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum AccountResource {
/// Email access.
Email,
/// Repository access.
Repo,
/// Status access.
Status,
}
/// Account action permissions for AT Protocol OAuth scopes.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum AccountAction {
/// Read-only access.
Read,
/// Management access (includes read).
Manage,
}
/// Repository action permissions for AT Protocol OAuth scopes.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum RepoAction {
/// Create records.
Create,
/// Update records.
Update,
/// Delete records.
Delete,
}