Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/auth/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ pub struct ClientCredentials {

/// All known valid OAuth scopes for validation.
pub fn all_known_scopes() -> Vec<&'static str> {
default_scopes()
let mut scopes = default_scopes();
scopes.extend([
"apps_datastore_manage",
"apps_datastore_read",
"apps_datastore_write",
]);
scopes
}

/// Read-only OAuth scopes for use with --read-only flag.
Expand Down Expand Up @@ -323,7 +329,14 @@ mod tests {

#[test]
fn test_all_known_scopes_matches_default() {
assert_eq!(all_known_scopes(), default_scopes());
let known = all_known_scopes();
let default: std::collections::HashSet<&str> = default_scopes().into_iter().collect();
for scope in default {
assert!(known.contains(&scope));
}
assert!(known.contains(&"apps_datastore_manage"));
assert!(known.contains(&"apps_datastore_read"));
assert!(known.contains(&"apps_datastore_write"));
}

#[test]
Expand Down
Loading