mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-03 22:01:39 +00:00
Improve device query validation
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
7.43.07
|
||||||
|
|
||||||
|
Improved validation of `<QueryCrOS>`, `<QueryDevice>` and `<QueryMobile>`.
|
||||||
|
|
||||||
7.43.06
|
7.43.06
|
||||||
|
|
||||||
Updated commands that use `<QueryCrOS>`, `<QueryDevice>` or `<QueryMobile>` to validate
|
Updated commands that use `<QueryCrOS>`, `<QueryDevice>` or `<QueryMobile>` to validate
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
__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)'
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||||
|
|
||||||
# pylint: disable=wrong-import-position
|
# pylint: disable=wrong-import-position
|
||||||
@@ -6072,7 +6072,13 @@ def getQueries(myarg):
|
|||||||
return shlexSplitList(getString(Cmd.OB_QUERY_LIST))
|
return shlexSplitList(getString(Cmd.OB_QUERY_LIST))
|
||||||
|
|
||||||
def _validateDeviceQuery(entityType, query):
|
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()
|
Cmd.Backup()
|
||||||
usageErrorExit(Msg.INVALID_DEVICE_QUERY.format(Ent.Singular(entityType), query))
|
usageErrorExit(Msg.INVALID_DEVICE_QUERY.format(Ent.Singular(entityType), query))
|
||||||
|
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ INVALID_ALIAS = 'Invalid Alias'
|
|||||||
INVALID_ATTENDEE_CHANGE = 'Invalid attendee change "{0}"'
|
INVALID_ATTENDEE_CHANGE = 'Invalid attendee change "{0}"'
|
||||||
INVALID_CHARSET = 'Invalid charset "{0}"'
|
INVALID_CHARSET = 'Invalid charset "{0}"'
|
||||||
INVALID_DATE_TIME_RANGE = '{0} {1} must be greater than/equal to {2} {3}'
|
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_EMOJI_NAME = '{0} does not match pattern :[0-9a-z_-]:'
|
||||||
INVALID_ENTITY = 'Invalid {0}, {1}'
|
INVALID_ENTITY = 'Invalid {0}, {1}'
|
||||||
INVALID_EVENT_TIMERANGE = '{0} {1} must be less than {2}'
|
INVALID_EVENT_TIMERANGE = '{0} {1} must be less than {2}'
|
||||||
|
|||||||
Reference in New Issue
Block a user