github_scopes_rs/
transform.rs

1//! Transform GitHub permission to structs
2
3/// All token scope data
4#[derive(Debug)]
5pub struct GithubTokenScope {
6    pub repo: GithubScopeRepo,
7    pub workflow: bool,
8    pub packages: GithubScopeLevel,
9    pub delete_packages: bool,
10    pub org: GithubScopeAdminLevel,
11    pub public_key: GithubScopeAdminLevel,
12    pub repo_hook: GithubScopeAdminLevel,
13    pub org_hook: bool,
14    pub gist: bool,
15    pub notifications: bool,
16    pub user: GithubScopeUser,
17    pub delete_repo: bool,
18    pub discussion: GithubScopeLevel,
19    pub enterprise: GithubScopeEnterprise,
20    pub gpg_key: GithubScopeAdminLevel,
21    pub ssh_signing_key: GithubScopeAdminLevel,
22}
23
24/// GitHub scope repo
25#[derive(Debug)]
26pub struct GithubScopeRepo {
27    pub all: bool,
28    pub status: bool,
29    pub deployment: bool,
30    pub public_repo: bool,
31    pub invite: bool,
32    pub security_events: bool,
33}
34
35/// GitHub admin scope with admin, write and read access
36#[derive(Debug)]
37pub struct GithubScopeAdminLevel {
38    pub admin: bool,
39    pub write: bool,
40    pub read: bool,
41}
42
43/// GitHub scope level with write and read access
44#[derive(Debug)]
45pub struct GithubScopeLevel {
46    pub write: bool,
47    pub read: bool,
48}
49
50/// Github user scope
51#[derive(Debug)]
52pub struct GithubScopeUser {
53    pub all: bool,
54    pub email: bool,
55    pub follow: bool,
56    pub read: bool,
57}
58
59/// GitHub enterprise scope
60#[derive(Debug)]
61pub struct GithubScopeEnterprise {
62    pub all: bool,
63    pub manage_runners: bool,
64    pub manage_billing: bool,
65    pub read: bool,
66}