我正在运行airflow v 1.9.0 . 我试图获得某种形式的身份验证工作,但迄今为止未能获得github身份验证和密码身份验证工作 . 密码认证感觉应该是非常直接的,我希望有人可以指出我正确的方向 . 我的airflow.cfg有以下内容
[webserver]
authenticate = True
auth_backend = airflow.contrib.auth.backends.password_auth
按照这里的说明https://airflow.incubator.apache.org/security.html#password我已登录到我的气流Web服务器并运行以下交互式python尝试创建一个给我一个错误的用户
airflow@airflow-web-66fbccc84c-vmqbp:~$ python3
Python 3.6.4 (default, Feb 15 2018, 13:07:07)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import airflow
>>> from airflow import models, settings
>>> from airflow.contrib.auth.backends.password_auth import PasswordUser
>>> user = PasswordUser(models.User())
>>> user.username = 'admin'
>>> user.password = 'airflowWTF'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/ext/hybrid.py", line 873, in __set__
raise AttributeError("can't set attribute")
AttributeError: can't set attribute
通过Web UI创建用户我只是得到一个例外 . 这是例外的结束 . https://www.dropbox.com/s/7cxwi6hdde61wnb/Screenshot%202018-02-21%2013.52.16.png?dl=0
任何提示赞赏 .
谢谢!
2 回答
您需要使用<1.2.0版本的sqlalchemy('sqlalchemy> = 1.1.15,<1.2.0')或使用“_password” .
更改sqlalchemy的版本更好 .
如上所述here,当我遇到同样的错误时,使用
_set_password
方法对我有用: