FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit fb0fa5bc authored by Robin Goodall's avatar Robin Goodall :speech_balloon:
Browse files

set orgUnitPath when creating new users (default to '/')

parent 777d796e
No related branches found
No related tags found
1 merge request!6Set organization unit path when creating new users
Pipeline #10210 passed with warnings
......@@ -10,6 +10,9 @@ sync:
# completely outside of this script.
ignore_google_org_unit_path_regex: '^/Service Accounts$'
# The organization unit path in which new accounts are placed
new_user_org_unit_path: '/'
# Inter-batch delay in seconds. This is useful to avoid hitting Google rate
# limits. Default: 5.
inter_batch_delay: 5
......
......@@ -44,6 +44,9 @@ class Configuration(config.ConfigurationDataclassMixin):
# are managed completely outside of this script.
ignore_google_org_unit_path_regex: typing.Union[str, None] = None
# The organization unit path in which new accounts are placed
new_user_org_unit_path: str = '/'
# Inter-batch delay in seconds. This is useful to avoid hitting Google rate limits.
inter_batch_delay: numbers.Real = 5
......@@ -296,6 +299,7 @@ def sync(configuration, *, read_only=True):
new_user = {**{
'hashFunction': 'crypt',
'password': crypt.crypt(secrets.token_urlsafe(), crypt.METHOD_SHA512),
'orgUnitPath': sync_config.new_user_org_unit_path,
}, **google_user_creations[uid]}
redacted_user = {**new_user, **{'password': 'REDACTED'}}
LOG.info('Adding user "%s": %s', uid, redacted_user)
......
......@@ -17,7 +17,7 @@ def load_requirements():
setup(
name='gsuitesync',
version='0.9.0',
version='0.9.1',
packages=find_packages(),
install_requires=load_requirements(),
entry_points={
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment