Compare commits

...

2 Commits

Author SHA1 Message Date
Ross Scroggs
84175ba80d Improve device query validation 2026-05-18 19:01:57 -07:00
Ross Scroggs
56c2b77f25 Improve device query validation 2026-05-18 17:38:49 -07:00
6 changed files with 25 additions and 11 deletions

View File

@@ -1,3 +1,7 @@
7.43.07
Improved validation of `<QueryCrOS>`, `<QueryDevice>` and `<QueryMobile>`.
7.43.06
Updated commands that use `<QueryCrOS>`, `<QueryDevice>` or `<QueryMobile>` to validate

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.43.06'
__version__ = '7.43.07'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
# pylint: disable=wrong-import-position
@@ -6072,7 +6072,13 @@ def getQueries(myarg):
return shlexSplitList(getString(Cmd.OB_QUERY_LIST))
def _validateDeviceQuery(entityType, query):
if (':' not in query) or ('?' in query):
if ':' in query:
qfield, qvalue = query.split(':', 1)
qfield = qfield.strip()
else:
qfield = ''
qvalue = query
if (not qfield) or (not qvalue) or ('?' in query):
Cmd.Backup()
usageErrorExit(Msg.INVALID_DEVICE_QUERY.format(Ent.Singular(entityType), query))

View File

@@ -312,7 +312,7 @@ INVALID_ALIAS = 'Invalid Alias'
INVALID_ATTENDEE_CHANGE = 'Invalid attendee change "{0}"'
INVALID_CHARSET = 'Invalid charset "{0}"'
INVALID_DATE_TIME_RANGE = '{0} {1} must be greater than/equal to {2} {3}'
INVALID_DEVICE_QUERY = 'Invalid {0} query "{1}"; it must contain a ":" and must not contain a "?"'
INVALID_DEVICE_QUERY = 'Invalid {0} query "{1}"; it must be if the form "field:value" and must not contain a "?"'
INVALID_EMOJI_NAME = '{0} does not match pattern :[0-9a-z_-]:'
INVALID_ENTITY = 'Invalid {0}, {1}'
INVALID_EVENT_TIMERANGE = '{0} {1} must be less than {2}'

View File

@@ -10,6 +10,10 @@ 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.43.07
Improved validation of `<QueryCrOS>`, `<QueryDevice>` and `<QueryMobile>`.
### 7.43.06
Updated commands that use `<QueryCrOS>`, `<QueryDevice>` or `<QueryMobile>` to validate

View File

@@ -251,7 +251,7 @@ writes the credentials into the file oauth2.txt.
```
gamteam@server:/Users/gamteam$ rm -f /Users/gamteam/GAMConfig/oauth2.txt
gamteam@server:/Users/gamteam$ gam version
GAM 7.43.06 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.43.07 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.4 64-bit final
macOS Tahoe 26.4.1 arm64
@@ -1034,7 +1034,7 @@ writes the credentials into the file oauth2.txt.
```
C:\>del C:\GAMConfig\oauth2.txt
C:\>gam version
GAM 7.43.06 - https://github.com/GAM-team/GAM - pythonsource
GAM 7.43.07 - https://github.com/GAM-team/GAM - pythonsource
GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.4 64-bit final
Windows 11 10.0.26200 AMD64

View File

@@ -3,7 +3,7 @@
Print the current version of Gam with details
```
gam version
GAM 7.43.06 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.43.07 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.4 64-bit final
macOS Tahoe 26.4.1 arm64
@@ -15,7 +15,7 @@ Time: 2026-02-15T07:51:00-08:00
Print the current version of Gam with details and time offset information
```
gam version timeoffset
GAM 7.43.06 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.43.07 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.4 64-bit final
macOS Tahoe 26.4.1 arm64
@@ -27,7 +27,7 @@ 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.43.06 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.43.07 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.4 64-bit final
macOS Tahoe 26.4.1 arm64
@@ -68,7 +68,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/gamteam/bin/gam7
Version Check:
Current: 5.35.08
Latest: 7.43.06
Latest: 7.43.07
echo $?
1
```
@@ -76,7 +76,7 @@ echo $?
Print the current version number without details
```
gam version simple
7.43.06
7.43.07
```
In Linux/MacOS you can do:
```
@@ -86,7 +86,7 @@ echo $VER
Print the current version of Gam and address of this Wiki
```
gam help
GAM 7.43.06 - https://github.com/GAM-team/GAM
GAM 7.43.07 - https://github.com/GAM-team/GAM
GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.4 64-bit final
macOS Tahoe 26.4.1 arm64