async def async_main(args): deploy_config = get_deploy_config() if args.namespace: deploy_config = deploy_config.with_default_namespace(args.namespace) headers = namespace_auth_headers(deploy_config, deploy_config.default_namespace(), authorize_target=False) async with client_session(headers=headers) as session: await auth_flow(deploy_config, deploy_config.default_namespace(), session)
async def async_main(args): deploy_config = get_deploy_config() if args.namespace: auth_ns = args.namespace deploy_config = deploy_config.with_service('auth', auth_ns) else: auth_ns = deploy_config.service_ns('auth') headers = namespace_auth_headers(deploy_config, auth_ns, authorize_target=False) async with ssl_client_session( raise_for_status=True, timeout=aiohttp.ClientTimeout(total=60), headers=headers) as session: await auth_flow(deploy_config, auth_ns, session)
async def async_main(args): deploy_config = get_deploy_config() if args.namespace: deploy_config = deploy_config.with_default_namespace(args.namespace) headers = namespace_auth_headers(deploy_config, deploy_config.default_namespace(), authorize_target=False) async with client_session(raise_for_status=True, timeout=aiohttp.ClientTimeout(total=60), headers=headers) as session: await auth_flow(deploy_config, deploy_config.default_namespace(), session)
def main(args): if len(args) < 3: print('hailctl curl NAMESPACE SERVICE PATH [args] ...', file=sys.stderr) sys.exit(1) ns = args[0] svc = args[1] path = args[2] deploy_config = get_deploy_config() headers = namespace_auth_headers(deploy_config, ns) headers = [x for k, v in headers.items() for x in ['-H', f'{k}: {v}']] path = deploy_config.with_service(svc, ns).url(svc, path) os.execvp('curl', ['curl', *headers, *args[3:], path])
def main(args): if len(args) < 3: print('hailctl curl NAMESPACE SERVICE PATH [args] ...', file=sys.stderr) sys.exit(1) ns = args[0] svc = args[1] path = args[2] deploy_config = get_deploy_config() headers = namespace_auth_headers(deploy_config, ns) headers = [x for k, v in headers.items() for x in ['-H', f'{k}: {v}']] path = deploy_config.with_service(svc, ns).external_url(svc, path) print('curl ' + ' '.join(headers) + ' ' + ' '.join(args[3:]) + ' ' + path) subprocess.check_call(['curl', *headers, *args[3:], path])