Repository navigation
Conversation
…gam whatis`, failed with "There are no scopes authorized" when the only Cloud Identity scope authorized was User Invitations. GAM-team#1934
Contributor
|
Thank you! Do you want credit in the GamUpdates Wiki entry? |
Contributor
|
I added your updates by hand, they're in 7.48.14. Thank you very much for the work you did to fix the problem,. Ross |
Author
|
Yes please, thank you Ross! @askalf is fine for the credit. Glad it made 7.48.14. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gam whatis <email>on an address that does not exist exits 15 (NO_SCOPES_FOR_API_RC) and printsERROR: There are no scopes authorized for the API(s): Cloud Identity API - User Invitations, even though the admin has authorized the User Invitations scope. Expected: exit 59 (ENTITY_IS_UKNOWN_RC). Issue 'gam whatis' exit status is incorrect for non-existent entries #1934.buildGAPIObject(src/gam/__init__.py:5756-5768) accepts a client's scopes for an API only if they appear in the discovery document'sauth.oauth2.scopesor inAPI.EXTRA_SCOPES[api]. The Cloud Identity v1 discovery document (checked at revisions 20260826 and 20260920) does not listcloud-identity.userinvitationsorcloud-identity.userinvitations.readonly, andEXTRA_SCOPEShas no entry forCLOUDIDENTITY_USERINVITATIONS. So the scope GAM's owngam oauth createmenu offers for this API (glapi.py:422-425) never counts, and GAM exits before calling the API.EXTRA_SCOPES, the dict whose comment reads "Scopes not in the discovery doc that are still valid for the API". Google's REST reference forcustomers.userinvitations.isInvitableUserlists exactly these two scopes. The diff is 2 lines insrc/gam/gamlib/glapi.py.gam print|show|info userinvitation(s)andgam send|cancel userinvitation, which build the same API object and failed the same way (case C6 below).Decisions
The change uses the project’s existing implementation path and adds a focused regression test; broader unrelated behavior remains out of scope.
Not run: no checks beyond the staged PR evidence were run during submission.
AI assistance: this bug was found and the fix and tests were drafted with AI tooling in my workflow; the tests and checks above were executed as pasted. I'm responsible for the change and will handle review feedback.