我有一个设置,我有一个应用程序引擎 REST 应用程序和一个 Google 作曲家/气流 DAG,它的任务应该是从应用程序的一个端点获取数据。该应用程序受 IAP 保护。我已将运行 Airflow 的服务帐户添加到“受 IAP 保护的 Web 应用程序用户”列表中,但是每次该步骤执行对 http 调用的响应时都是 Google 登录页面。知道是否需要任何额外的步骤?
我的 DAG 步骤的代码:
def get_data():
r = requests.get(url="url-to-my-app-endpoint>")
print('stuff:')
print(r.status_code)
print(r.content)
return 1
# ...
python_fetch_data = PythonOperator(
task_id='python_fetch_data',
python_callable=get_data,
dag=dag,
depends_on_past=True,
priority_weight=2
)