Skip to content

Commit

Permalink
Updated gam <UserTypeEntity> update serviceaccount
Browse files Browse the repository at this point in the history
to properly set the readonly scope
for `[R] 35)  Meet API (supports readonly)` as it is a special case.
  • Loading branch information
taers232c committed Nov 20, 2024
1 parent 8f7eeae commit 1870b25
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/GamUpdate.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
7.00.40

Updated `gam <UserTypeEntity> update serviceaccount` to properly set the readonly scope
for `[R] 35) Meet API (supports readonly)` as it is a special case.

7.00.39

Supported MacOS versions are now in the download filename.
Expand Down
12 changes: 8 additions & 4 deletions src/gam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"""

__author__ = 'GAM Team <[email protected]>'
__version__ = '7.00.39'
__version__ = '7.00.40'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'

#pylint: disable=wrong-import-position
Expand Down Expand Up @@ -10550,7 +10550,7 @@ def getScopesFromUser(scopesList, clientAccess, currentScopes=None):
selectedScopes[i] = '*'
break
if 'readonly' in a_scope['subscopes']:
if scope == possibleScope+'.readonly':
if (scope == possibleScope+'.readonly') or (scope == a_scope.get('roscope')):
selectedScopes[i] = 'R'
break
i += 1
Expand Down Expand Up @@ -12140,8 +12140,12 @@ def authorizeScopes(message):
checkScopesSet.add(scope['scope'])
elif selectedScopes[i] == 'R':
saScopes.setdefault(scope['api'], [])
saScopes[scope['api']].append(f'{scope["scope"]}.readonly')
checkScopesSet.add(f'{scope["scope"]}.readonly')
if 'roscope' not in scope:
saScopes[scope['api']].append(f'{scope["scope"]}.readonly')
checkScopesSet.add(f'{scope["scope"]}.readonly')
else:
saScopes[scope['api']].append(scope['roscope'])
checkScopesSet.add(scope['roscope'])
i += 1
if API.DRIVEACTIVITY in saScopes and API.DRIVE3 in saScopes:
saScopes[API.DRIVEACTIVITY].append(API.DRIVE_SCOPE)
Expand Down
4 changes: 2 additions & 2 deletions src/gam/gamlib/glaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class GamAction():
CLAIM_OWNERSHIP = 'clow'
CLEAR = 'clea'
CLOSE = 'clos'
COLLECT = 'collect'
COMMENT = 'comment'
COLLECT = 'coll'
COMMENT = 'comm'
COPY = 'copy'
COPY_MERGE = 'copm'
CREATE = 'crea'
Expand Down
3 changes: 2 additions & 1 deletion src/gam/gamlib/glapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,8 @@
{'name': 'Meet API',
'api': MEET,
'subscopes': READONLY,
'scope': 'https://www.googleapis.com/auth/meetings.space.created'},
'scope': 'https://www.googleapis.com/auth/meetings.space.created',
'roscope': 'https://www.googleapis.com/auth/meetings.space.readonly'},
{'name': 'OAuth2 API',
'api': OAUTH2,
'subscopes': [],
Expand Down

0 comments on commit 1870b25

Please sign in to comment.