Airflow基本身份验证-无法创建用户 [英] Airflow basic auth - cannot create user
问题描述
我正在运行气流v 1.9.0。我正在尝试某种形式的身份验证工作,但到目前为止未能使github auth和密码auth工作。密码auth感觉应该很简单,我希望有人可以指出正确的方向。我的airflow.cfg具有以下内容
I'm running airflow v 1.9.0. I am trying to get some form of authentication working but have so far failed to get github auth and password auth working. The password auth feels like it should be pretty straight forward and I'm hoping someone can point me in the right direction. My airflow.cfg has the following
[webserver]
authenticate = True
auth_backend = airflow.contrib.auth.backends.password_auth
按照此处的说明 https://airflow.incubator.apache.org/security.html#password 我已经登录到气流Web服务器,并且运行以下交互式python尝试创建一个给我错误的用户
Following the instructions here https://airflow.incubator.apache.org/security.html#password I've logged into my airflow web server and run the following interactive python to try to create a user which gives me an error
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
通过网络UI创建用户I只是一个例外。异常结束了。 https:// www。 dropbox.com/s/7cxwi6hdde61wnb/Screenshot%202018-02-21%2013.52.16.png?dl=0
Going through the web UI to create a user I just get an exception. Here is the end of the exception. https://www.dropbox.com/s/7cxwi6hdde61wnb/Screenshot%202018-02-21%2013.52.16.png?dl=0
任何提示都值得赞赏。
谢谢!
Any tips appreciated.
Thanks!
推荐答案
您需要使用< 1.2.0版本的sqlalchemy('sqlalchemy> = 1.1 .15,<1.2.0',或使用 _password。
You need to use <1.2.0 version of sqlalchemy ('sqlalchemy>=1.1.15, <1.2.0',) or use "_password".
更改sqlalchemy的版本更好。
Changing version of sqlalchemy is better.
这篇关于Airflow基本身份验证-无法创建用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!