diff --git a/paas2/VERSION b/paas2/VERSION index c38dd67f3..6ad4f1e46 100644 --- a/paas2/VERSION +++ b/paas2/VERSION @@ -1 +1 @@ -2.13.8 +2.13.9 diff --git a/paas2/login/bkaccount/migrations/0001_initial.py b/paas2/login/bkaccount/migrations/0001_initial.py index 25a0ebc2e..ec77cd1f8 100644 --- a/paas2/login/bkaccount/migrations/0001_initial.py +++ b/paas2/login/bkaccount/migrations/0001_initial.py @@ -20,38 +20,61 @@ class Migration(migrations.Migration): dependencies = [ - ('auth', '0006_require_contenttypes_0002'), + ("auth", "0006_require_contenttypes_0002"), ] operations = [ migrations.CreateModel( - name='BkToken', + name="BkToken", fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('token', models.CharField(unique=True, max_length=255, verbose_name='\u767b\u5f55\u7968\u636e', db_index=True)), - ('is_logout', models.BooleanField(default=False, verbose_name='\u7968\u636e\u662f\u5426\u5df2\u7ecf\u6267\u884c\u8fc7\u9000\u51fa\u767b\u5f55\u64cd\u4f5c')), + ("id", models.AutoField(verbose_name="ID", serialize=False, auto_created=True, primary_key=True)), + ( + "token", + models.CharField( + unique=True, max_length=255, verbose_name="\u767b\u5f55\u7968\u636e", db_index=True + ), + ), + ( + "is_logout", + models.BooleanField( + default=False, + verbose_name="\u7968\u636e\u662f\u5426\u5df2\u7ecf\u6267\u884c\u8fc7\u9000\u51fa\u767b\u5f55\u64cd\u4f5c", + ), + ), ], options={ - 'db_table': 'login_bktoken', - 'verbose_name': '\u767b\u5f55\u7968\u636e', - 'verbose_name_plural': '\u767b\u5f55\u7968\u636e', + "db_table": "login_bktoken", + "verbose_name": "\u767b\u5f55\u7968\u636e", + "verbose_name_plural": "\u767b\u5f55\u7968\u636e", }, ), migrations.CreateModel( - name='Loignlog', + name="Loignlog", fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('login_time', models.DateTimeField(verbose_name='\u767b\u5f55\u65f6\u95f4')), - ('login_browser', models.CharField(max_length=200, null=True, verbose_name='\u767b\u5f55\u6d4f\u89c8\u5668', blank=True)), - ('login_ip', models.CharField(max_length=50, null=True, verbose_name='\u7528\u6237\u767b\u5f55ip', blank=True)), - ('login_host', models.CharField(max_length=100, null=True, verbose_name='\u767b\u5f55HOST', blank=True)), - ('app_id', models.CharField(max_length=30, null=True, verbose_name=b'APP_ID', blank=True)), - ('user', models.ForeignKey(verbose_name='\u7528\u6237', to=settings.AUTH_USER_MODEL)), + ("id", models.AutoField(verbose_name="ID", serialize=False, auto_created=True, primary_key=True)), + ("login_time", models.DateTimeField(verbose_name="\u767b\u5f55\u65f6\u95f4")), + ( + "login_browser", + models.CharField( + max_length=200, null=True, verbose_name="\u767b\u5f55\u6d4f\u89c8\u5668", blank=True + ), + ), + ( + "login_ip", + models.CharField(max_length=50, null=True, verbose_name="\u7528\u6237\u767b\u5f55ip", blank=True), + ), + ( + "login_host", + models.CharField(max_length=100, null=True, verbose_name="\u767b\u5f55HOST", blank=True), + ), + ("app_id", models.CharField(max_length=30, null=True, verbose_name=b"APP_ID", blank=True)), + # ('user', models.ForeignKey(verbose_name='\u7528\u6237', to=settings.AUTH_USER_MODEL)), + ("user", models.CharField(max_length=128, null=True, blank=True)), ], options={ - 'db_table': 'login_bklog', - 'verbose_name': '\u7528\u6237\u767b\u5f55\u65e5\u5fd7', - 'verbose_name_plural': '\u7528\u6237\u767b\u5f55\u65e5\u5fd7', + "db_table": "login_bklog", + "verbose_name": "\u7528\u6237\u767b\u5f55\u65e5\u5fd7", + "verbose_name_plural": "\u7528\u6237\u767b\u5f55\u65e5\u5fd7", }, ), ] diff --git a/paas2/login/conf/default.py b/paas2/login/conf/default.py index e98e8cc96..cba6b4ff3 100644 --- a/paas2/login/conf/default.py +++ b/paas2/login/conf/default.py @@ -59,8 +59,8 @@ "bk_i18n", # oauth2 login "app", - "oauth2_provider", - "bk_oauth2", + # "oauth2_provider", + # "bk_oauth2", ) MIDDLEWARE_CLASSES = ( @@ -185,16 +185,16 @@ # OAUTH2 # ############ # reference: https://django-oauth-toolkit.readthedocs.io/en/latest/settings.html -OAUTH2_PROVIDER = { - "SCOPES": { - "get_user_profile": "获取用户信息", - }, - "APPLICATION_MODEL": "bk_oauth2.Application", - # 1 day - "ACCESS_TOKEN_EXPIRE_SECONDS": 86400, - # 10 mins - "AUTHORIZATION_CODE_EXPIRE_SECONDS": 600, -} +# OAUTH2_PROVIDER = { +# "SCOPES": { +# "get_user_profile": "获取用户信息", +# }, +# "APPLICATION_MODEL": "bk_oauth2.Application", +# # 1 day +# "ACCESS_TOKEN_EXPIRE_SECONDS": 86400, +# # 10 mins +# "AUTHORIZATION_CODE_EXPIRE_SECONDS": 600, +# } # Database diff --git a/paas2/login/requirements.txt b/paas2/login/requirements.txt index 787f41a14..b485b17d3 100644 --- a/paas2/login/requirements.txt +++ b/paas2/login/requirements.txt @@ -11,7 +11,7 @@ xlwt==1.1.2 gevent==1.5.0 pytz==2016.6.1 python-dateutil==2.8.1 -django_oauth_toolkit==0.12.0 +# django_oauth_toolkit==0.12.0 django-decorator-include==1.3 cachetools==3.1.1 diff --git a/paas2/login/urls.py b/paas2/login/urls.py index 50487b932..a29c0bac9 100644 --- a/paas2/login/urls.py +++ b/paas2/login/urls.py @@ -33,7 +33,7 @@ url(r"^plain/$", auth_views.LoginView.as_view(is_plain=True)), url(r"^logout/$", auth_views.LogoutView.as_view()), # oauth2 - url(r"^oauth/", decorator_include(login_exempt, "bk_oauth2.urls", namespace="oauth2_provider")), + # url(r"^oauth/", decorator_include(login_exempt, "bk_oauth2.urls", namespace="oauth2_provider")), # ========================= the apis ========================= # TODO: 所有get_all_user/get_batch_user api应该直接调用usermgr的esb接口或者后台接口, 不应该走login # please use api get_all_user/get_batch_user via esb, should not from login diff --git a/paas2/paas/app/migrations/0024_app__visiable_labels.py b/paas2/paas/app/migrations/0024_app__visiable_labels.py index cd06feed6..33320f521 100644 --- a/paas2/paas/app/migrations/0024_app__visiable_labels.py +++ b/paas2/paas/app/migrations/0024_app__visiable_labels.py @@ -18,13 +18,19 @@ class Migration(migrations.Migration): dependencies = [ - ('app', '0023_update_cc_job_en'), + ("app", "0023_update_cc_job_en"), ] operations = [ migrations.AddField( - model_name='app', - name='_visiable_labels', - field=models.CharField(max_length=1024, null=True, verbose_name='\u53ef\u89c1\u8303\u56f4\u6807\u7b7e', db_column=b'visiable_labels', blank=True), + model_name="app", + name="_visiable_labels", + field=models.CharField( + max_length=1024, + null=True, + verbose_name="\u53ef\u89c1\u8303\u56f4\u6807\u7b7e", + db_column="visiable_labels", + blank=True, + ), ), ] diff --git a/paas2/paas/app/migrations/0029_auto_20201106_1139.py b/paas2/paas/app/migrations/0029_auto_20201106_1139.py index 4a77cf824..d141de5d2 100644 --- a/paas2/paas/app/migrations/0029_auto_20201106_1139.py +++ b/paas2/paas/app/migrations/0029_auto_20201106_1139.py @@ -18,13 +18,20 @@ class Migration(migrations.Migration): dependencies = [ - ('app', '0028_merge'), + ("app", "0028_merge"), ] operations = [ migrations.AlterField( - model_name='app', - name='_visiable_labels', - field=models.CharField(db_column=b'visiable_labels', default=b'', max_length=1024, blank=True, null=True, verbose_name='\u53ef\u89c1\u8303\u56f4\u6807\u7b7e'), + model_name="app", + name="_visiable_labels", + field=models.CharField( + db_column="visiable_labels", + default=b"", + max_length=1024, + blank=True, + null=True, + verbose_name="\u53ef\u89c1\u8303\u56f4\u6807\u7b7e", + ), ), ] diff --git a/paas2/release.md b/paas2/release.md index b170c00ff..4db34161f 100644 --- a/paas2/release.md +++ b/paas2/release.md @@ -1,5 +1,9 @@ Release Log =============================== +# 2.13.9 + - bugfix: python3 install migration fail + - breaking changes: remve oauth2 from login + # 2.13.8 - bugfix: smart package size calcuate error in py3