mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-20 06:01:37 +00:00
Compare commits
1 Commits
20241009.2
...
20241010.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae67319975 |
@@ -41,6 +41,8 @@ In order for GAM to manage CAA access levels, you need to grant your service acc
|
||||
|
||||
## Definitions
|
||||
```
|
||||
<JSONData> ::= (json [charset <Charset>] <String>) | (json file <FileName> [charset <Charset>]) |
|
||||
|
||||
<QueryCEL> ::= <String>
|
||||
See: https://cloud.google.com/access-context-manager/docs/custom-access-level-spec
|
||||
|
||||
@@ -144,7 +146,7 @@ basic
|
||||
## Create an Access Level
|
||||
Create a new access level. CAA supports basic and custom conditions.
|
||||
```
|
||||
gam create caalevel <String> [description <String>] (basic <CAABasicAttribute>+)|(custom <QueryCEL>)
|
||||
gam create caalevel <String> [description <String>] (basic <CAABasicAttribute>+)|(custom <QueryCEL>)|<JSONData>
|
||||
```
|
||||
|
||||
## Example
|
||||
@@ -166,7 +168,7 @@ gam create caalevel CORP_IPS basic condition ipsubnetworks 1.2.3.0/24,4.5.6.0/24
|
||||
## Update an Access Level
|
||||
Updates an existing access level. CAA supports basic and custom conditions.
|
||||
```
|
||||
gam update caalevel <CAALevelName> [description <String>] (basic <CAABasicAttribute>+)|(custom <QueryCEL>)
|
||||
gam update caalevel <CAALevelName> [description <String>] (basic <CAABasicAttribute>+)|(custom <QueryCEL>)|<JSONData>
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -10,6 +10,13 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
|
||||
|
||||
See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation
|
||||
|
||||
### 7.00.16
|
||||
|
||||
Updated `gam <UserTypeEntity> claim|transfer ownership` to show `Got N Drive Files/Folders that matched query` messages
|
||||
as files/folders are being identified for processing.
|
||||
|
||||
Added option `<JSONData>` to `gam create|update caalevel`.
|
||||
|
||||
### 7.00.15
|
||||
|
||||
Added options `timestamp [<Boolean>]` and `timeformat <String>` to `gam <UserTypeEntity> create|update drivefile` that allow
|
||||
|
||||
@@ -251,9 +251,9 @@ writes the credentials into the file oauth2.txt.
|
||||
admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
||||
admin@server:/Users/admin$ gam version
|
||||
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
||||
GAM 7.00.15 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM 7.00.16 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.12.7 64-bit final
|
||||
Python 3.13.0 64-bit final
|
||||
MacOS Sonoma 14.5 x86_64
|
||||
Path: /Users/admin/bin/gam7
|
||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||
@@ -923,9 +923,9 @@ writes the credentials into the file oauth2.txt.
|
||||
C:\>del C:\GAMConfig\oauth2.txt
|
||||
C:\>gam version
|
||||
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
|
||||
GAM7 7.00.15 - https://github.com/GAM-team/GAM - pythonsource
|
||||
GAM7 7.00.16 - https://github.com/GAM-team/GAM - pythonsource
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.12.7 64-bit final
|
||||
Python 3.13.0 64-bit final
|
||||
Windows-10-10.0.17134 AMD64
|
||||
Path: C:\GAM7
|
||||
Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
Print the current version of Gam with details
|
||||
```
|
||||
gam version
|
||||
GAM 7.00.15 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM 7.00.16 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.12.7 64-bit final
|
||||
Python 3.13.0 64-bit final
|
||||
MacOS Sonoma 14.5 x86_64
|
||||
Path: /Users/Admin/bin/gam7
|
||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||
@@ -15,9 +15,9 @@ Time: 2023-06-02T21:10:00-07:00
|
||||
Print the current version of Gam with details and time offset information
|
||||
```
|
||||
gam version timeoffset
|
||||
GAM 7.00.15 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM 7.00.16 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.12.7 64-bit final
|
||||
Python 3.13.0 64-bit final
|
||||
MacOS Sonoma 14.5 x86_64
|
||||
Path: /Users/Admin/bin/gam7
|
||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||
@@ -27,9 +27,9 @@ Your system time differs from www.googleapis.com by less than 1 second
|
||||
Print the current version of Gam with extended details and SSL information
|
||||
```
|
||||
gam version extended
|
||||
GAM 7.00.15 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM 7.00.16 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.12.7 64-bit final
|
||||
Python 3.13.0 64-bit final
|
||||
MacOS Sonoma 14.5 x86_64
|
||||
Path: /Users/Admin/bin/gam7
|
||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||
@@ -37,7 +37,7 @@ Time: 2023-06-02T21:10:00-07:00
|
||||
Your system time differs from admin.googleapis.com by less than 1 second
|
||||
OpenSSL 3.1.1 30 May 2023
|
||||
cryptography 41.0.1
|
||||
filelock 3.12.7
|
||||
filelock 3.13.0
|
||||
google-api-python-client 2.88.0
|
||||
google-auth-httplib2 0.1.0
|
||||
google-auth-oauthlib 1.0.0
|
||||
@@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64
|
||||
Path: /Users/Admin/bin/gam7
|
||||
Version Check:
|
||||
Current: 5.35.08
|
||||
Latest: 7.00.15
|
||||
Latest: 7.00.16
|
||||
echo $?
|
||||
1
|
||||
```
|
||||
@@ -72,7 +72,7 @@ echo $?
|
||||
Print the current version number without details
|
||||
```
|
||||
gam version simple
|
||||
7.00.15
|
||||
7.00.16
|
||||
```
|
||||
In Linux/MacOS you can do:
|
||||
```
|
||||
@@ -82,9 +82,9 @@ echo $VER
|
||||
Print the current version of Gam and address of this Wiki
|
||||
```
|
||||
gam help
|
||||
GAM 7.00.15 - https://github.com/GAM-team/GAM
|
||||
GAM 7.00.16 - https://github.com/GAM-team/GAM
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.12.7 64-bit final
|
||||
Python 3.13.0 64-bit final
|
||||
MacOS Sonoma 14.5 x86_64
|
||||
Path: /Users/Admin/bin/gam7
|
||||
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
|
||||
|
||||
@@ -2770,8 +2770,8 @@ gam print chromesnvalidity [todrive <ToDriveAttribute>*]
|
||||
(combiningfunction <CAACombiningFunction>) |
|
||||
(condition <CAAConditionAttribute>+ endcondition)
|
||||
|
||||
gam create caalevel <String> [description <String>] (basic <CAABasicAttribute>+)|(custom <QueryCEL>)
|
||||
gam update caalevel <CAALevelName> [description <String>] (basic <CAABasicAttribute>+)|(custom <QueryCEL>)
|
||||
gam create caalevel <String> [description <String>] (basic <CAABasicAttribute>+)|(custom <QueryCEL>)|<JSONData>
|
||||
gam update caalevel <CAALevelName> [description <String>] (basic <CAABasicAttribute>+)|(custom <QueryCEL>)|<JSONData>
|
||||
gam delete caalevel <CAALevelName>
|
||||
gam show caalevels
|
||||
[formatjson]
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
7.00.16
|
||||
|
||||
Updated `gam <UserTypeEntity> claim|transfer ownership` to show `Got N Drive Files/Folders that matched query` messages
|
||||
as files/folders are being identified for processing.
|
||||
|
||||
Added option `<JSONData>` to `gam create|update caalevel`.
|
||||
|
||||
7.00.15
|
||||
|
||||
Added options `timestamp [<Boolean>]` and `timeformat <String>` to `gam <UserTypeEntity> create|update drivefile` that allow
|
||||
|
||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
||||
"""
|
||||
|
||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||
__version__ = '7.00.15'
|
||||
__version__ = '7.00.16'
|
||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||
|
||||
#pylint: disable=wrong-import-position
|
||||
@@ -61687,11 +61687,15 @@ def transferOwnership(users):
|
||||
_identifyFilesToTransfer(childEntry)
|
||||
|
||||
def _identifyChildrenToTransfer(fileEntry, user, i, count):
|
||||
q = WITH_PARENTS.format(fileEntry['id'])
|
||||
setGettingAllEntityItemsForWhom(Ent.DRIVE_FILE_OR_FOLDER, user, query=q)
|
||||
pageMessage = getPageMessageForWhom(clearLastGotMsgLen=False)
|
||||
try:
|
||||
children = callGAPIpages(drive.files(), 'list', 'files',
|
||||
pageMessage=pageMessage, noFinalize=True,
|
||||
throwReasons=GAPI.DRIVE_USER_THROW_REASONS,
|
||||
retryReasons=[GAPI.UNKNOWN_ERROR],
|
||||
orderBy=OBY.orderBy, q=WITH_PARENTS.format(fileEntry['id']),
|
||||
orderBy=OBY.orderBy, q=q,
|
||||
fields='nextPageToken,files(id,name,parents,mimeType,ownedByMe,trashed)',
|
||||
pageSize=GC.Values[GC.DRIVE_MAX_RESULTS])
|
||||
except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
|
||||
@@ -61972,11 +61976,15 @@ def claimOwnership(users):
|
||||
_identifyFilesToClaim(childEntry)
|
||||
|
||||
def _identifyChildrenToClaim(fileEntry, user, i, count):
|
||||
q = WITH_PARENTS.format(fileEntry['id'])
|
||||
setGettingAllEntityItemsForWhom(Ent.DRIVE_FILE_OR_FOLDER, user, query=q)
|
||||
pageMessage = getPageMessageForWhom(clearLastGotMsgLen=False)
|
||||
try:
|
||||
children = callGAPIpages(drive.files(), 'list', 'files',
|
||||
pageMessage=pageMessage, noFinalize=True,
|
||||
throwReasons=GAPI.DRIVE_USER_THROW_REASONS,
|
||||
retryReasons=[GAPI.UNKNOWN_ERROR],
|
||||
orderBy=OBY.orderBy, q=WITH_PARENTS.format(fileEntry['id']),
|
||||
orderBy=OBY.orderBy, q=q,
|
||||
fields='nextPageToken,files(id,name,parents,mimeType,ownedByMe,trashed,owners(emailAddress,permissionId))',
|
||||
pageSize=GC.Values[GC.DRIVE_MAX_RESULTS])
|
||||
except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
|
||||
@@ -74629,10 +74637,12 @@ def CAABuildLevel(body):
|
||||
body['custom'] = {'expr': {'expression': getString(Cmd.OB_STRING), 'title': 'expr'}}
|
||||
elif myarg == 'description':
|
||||
body['description'] = getString(Cmd.OB_STRING, minLen=0)
|
||||
elif myarg == 'json':
|
||||
body.update(getJSON(['name']))
|
||||
else:
|
||||
unknownArgumentExit()
|
||||
|
||||
# gam create caalevel <String> [description <String>] (basic <CAABasicAttribute>+)|(custom <String>)
|
||||
# gam create caalevel <String> [description <String>] (basic <CAABasicAttribute>+)|(custom <String>)|<JSONData>
|
||||
def doCreateCAALevel():
|
||||
caa = buildCAAServiceObject()
|
||||
ap_name = getAccessPolicy(caa)
|
||||
@@ -74652,7 +74662,7 @@ def doCreateCAALevel():
|
||||
except GAPI.permissionDenied:
|
||||
CAARoleErrorExit(caa)
|
||||
|
||||
# gam update caalevel <CAALevelName> [description <String>] (basic <CAABasicAttribute>+)|(custom <String>)
|
||||
# gam update caalevel <CAALevelName> [description <String>] (basic <CAABasicAttribute>+)|(custom <String>)|<JSONData>
|
||||
def doUpdateCAALevel():
|
||||
caa = buildCAAServiceObject()
|
||||
name = normalizeCAALevelName(caa, getString(Cmd.OB_ACCESS_LEVEL_NAME))
|
||||
|
||||
Reference in New Issue
Block a user