def bootstrap_dev_server_acls(): """Adds localhost to IP whitelist and Swarming groups.""" assert utils.is_local_dev_server() if auth.is_replica(): return bots = auth.bootstrap_loopback_ips() auth_settings = config.settings().auth admins_group = auth_settings.admins_group users_group = auth_settings.users_group bot_bootstrap_group = auth_settings.bot_bootstrap_group auth.bootstrap_group(users_group, bots, 'Swarming users') auth.bootstrap_group(bot_bootstrap_group, bots, 'Bot bootstrap') # Add a swarming admin. [email protected] is used in # server_smoke_test.py admin = auth.Identity(auth.IDENTITY_USER, '*****@*****.**') auth.bootstrap_group(admins_group, [admin], 'Swarming administrators') # Add an instance admin (for easier manual testing when running dev server). auth.bootstrap_group( auth.ADMIN_GROUP, [auth.Identity(auth.IDENTITY_USER, '*****@*****.**')], 'Users that can manage groups')
def bootstrap(): """Adds 127.0.0.1 as a whitelisted IP when testing.""" if not utils.is_local_dev_server() or auth.is_replica(): return # Allow local bots full access. bots = auth.bootstrap_loopback_ips() auth.bootstrap_group(FULL_ACCESS_GROUP, bots, 'Can read and write from/to Isolate') # Add a fake admin for local dev server. auth.bootstrap_group( auth.ADMIN_GROUP, [auth.Identity(auth.IDENTITY_USER, '*****@*****.**')], 'Users that can manage groups')
def bootstrap(): """Adds 127.0.0.1 as a whitelisted IP when testing.""" if not utils.is_local_dev_server() or auth.is_replica(): return # Allow local bots full access. bots = auth.bootstrap_loopback_ips() auth.bootstrap_group( FULL_ACCESS_GROUP, bots, 'Can read and write from/to Isolate') # Add a fake admin for local dev server. auth.bootstrap_group( auth.ADMIN_GROUP, [auth.Identity(auth.IDENTITY_USER, '*****@*****.**')], 'Users that can manage groups')
def bootstrap_dev_server_acls(): """Adds localhost to IP whitelist and Swarming groups.""" assert utils.is_local_dev_server() if auth.is_replica(): return bots = auth.bootstrap_loopback_ips() auth.bootstrap_group(BOTS_GROUP, bots, 'Swarming bots') auth.bootstrap_group(USERS_GROUP, bots, 'Swarming users') # Add a swarming admin. [email protected] is used in # server_smoke_test.py admin = auth.Identity(auth.IDENTITY_USER, '*****@*****.**') auth.bootstrap_group(ADMINS_GROUP, [admin], 'Swarming administrators') # Add an instance admin (for easier manual testing when running dev server). auth.bootstrap_group( auth.ADMIN_GROUP, [auth.Identity(auth.IDENTITY_USER, '*****@*****.**')], 'Users that can manage groups')