Skip to content

Commit 98b786f

Browse files
committed
fix(auth): stop TUI from force-injecting cloud-platform scope
The interactive scope picker unconditionally appended cloud-platform after every selection, contradicting DEFAULT_SCOPES which explicitly excludes it. This broke org-restricted accounts with admin_policy_enforced. Closes #562
1 parent a3768d0 commit 98b786f

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@googleworkspace/cli": patch
3+
---
4+
5+
Stop TUI scope picker from unconditionally injecting cloud-platform scope

crates/google-workspace-cli/src/auth_commands.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ fn run_discovery_scope_picker(
930930
relevant_scopes: &[crate::setup::DiscoveredScope],
931931
services_filter: Option<&HashSet<String>>,
932932
) -> Option<Vec<String>> {
933-
use crate::setup::{ScopeClassification, PLATFORM_SCOPE};
933+
use crate::setup::ScopeClassification;
934934
use crate::setup_tui::{PickerResult, SelectItem};
935935

936936
let mut recommended_scopes = vec![];
@@ -1102,11 +1102,6 @@ fn run_discovery_scope_picker(
11021102
}
11031103
}
11041104

1105-
// Always include cloud-platform scope
1106-
if !selected.contains(&PLATFORM_SCOPE.to_string()) {
1107-
selected.push(PLATFORM_SCOPE.to_string());
1108-
}
1109-
11101105
// Hierarchical dedup: if we have both a broad scope (e.g. `.../auth/drive`)
11111106
// and a narrower scope (e.g. `.../auth/drive.metadata`, `.../auth/drive.readonly`),
11121107
// drop the narrower one since the broad scope subsumes it.

crates/google-workspace-cli/src/setup.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,6 @@ pub enum ScopeClassification {
235235
Restricted,
236236
}
237237

238-
pub const PLATFORM_SCOPE: &str = "https://www.googleapis.com/auth/cloud-platform";
239-
240238
/// A scope discovered from a Discovery Document.
241239
#[derive(Clone)]
242240
pub struct DiscoveredScope {

0 commit comments

Comments
 (0)