Skip to content

Commit cb1a586

Browse files
committed
fix(auth): add 'profile' as a non-write scope alias
'profile' is a standard OpenID Connect alias for userinfo.profile and does not grant write access. Without this, --scopes=profile would incorrectly classify the session as having write access.
1 parent 39b43d4 commit cb1a586

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/auth_commands.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ fn is_non_write_scope(scope: &str) -> bool {
154154
|| scope == "openid"
155155
|| scope.starts_with("https://www.googleapis.com/auth/userinfo.")
156156
|| scope == "email"
157+
|| scope == "profile"
157158
}
158159

159160
/// Returns true if the saved scopes are all read-only.
@@ -2369,6 +2370,7 @@ mod tests {
23692370
assert!(is_non_write_scope("https://www.googleapis.com/auth/gmail.readonly"));
23702371
assert!(is_non_write_scope("openid"));
23712372
assert!(is_non_write_scope("email"));
2373+
assert!(is_non_write_scope("profile"));
23722374
assert!(is_non_write_scope("https://www.googleapis.com/auth/userinfo.email"));
23732375

23742376
// Write scopes are not non-write

0 commit comments

Comments
 (0)