mirror of https://github.com/zulip/zulip.git
api: Add is_remote_server().
This function abstracts the logic to ascertain the source of API auth request.
This commit is contained in:
parent
2c64626e7a
commit
252fa53816
|
@ -223,3 +223,12 @@ def split_by(array, group_size, filler):
|
||||||
"""
|
"""
|
||||||
args = [iter(array)] * group_size
|
args = [iter(array)] * group_size
|
||||||
return list(map(list, zip_longest(*args, fillvalue=filler)))
|
return list(map(list, zip_longest(*args, fillvalue=filler)))
|
||||||
|
|
||||||
|
def is_remote_server(identifier):
|
||||||
|
# type: (Text) -> bool
|
||||||
|
"""
|
||||||
|
This function can be used to identify the source of API auth
|
||||||
|
request. We can have two types of sources, Remote Zulip Servers
|
||||||
|
and UserProfiles.
|
||||||
|
"""
|
||||||
|
return "@" not in identifier
|
||||||
|
|
Loading…
Reference in New Issue