From c0a153d13ab94c9ce419d0e2a1f501b132dfe2d5 Mon Sep 17 00:00:00 2001 From: Bai Date: Wed, 24 Jun 2020 10:52:05 +0800 Subject: [PATCH 01/19] =?UTF-8?q?[Update]=20UserProfileAPI=20=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=98=AF=E5=90=A6=E8=AE=BE=E7=BD=AEsession=E8=BF=87?= =?UTF-8?q?=E6=9C=9F=E6=97=B6=E9=97=B4=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E5=85=B3=E9=97=AD=E6=B5=8F=E8=A7=88=E5=99=A8session?= =?UTF-8?q?=E6=9C=AA=E5=A4=B1=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/api/profile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/users/api/profile.py b/apps/users/api/profile.py index e9631b5b7..b7ba0bbff 100644 --- a/apps/users/api/profile.py +++ b/apps/users/api/profile.py @@ -3,6 +3,7 @@ import uuid from rest_framework import generics from rest_framework.permissions import IsAuthenticated +from django.conf import settings from common.permissions import ( IsCurrentUserOrReadOnly @@ -64,8 +65,9 @@ class UserProfileApi(generics.RetrieveUpdateAPIView): return self.request.user def retrieve(self, request, *args, **kwargs): - age = request.session.get_expiry_age() - request.session.set_expiry(age) + if not settings.SESSION_EXPIRE_AT_BROWSER_CLOSE: + age = request.session.get_expiry_age() + request.session.set_expiry(age) return super().retrieve(request, *args, **kwargs) From 6e3369c9445c7b0c54cdd0df2a67f7bc26cb9685 Mon Sep 17 00:00:00 2001 From: xinwen Date: Wed, 24 Jun 2020 16:17:58 +0800 Subject: [PATCH 02/19] =?UTF-8?q?[Update]=20sftp=20log=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0009_auto_20200624_1654.py | 18 + apps/audits/models.py | 20 +- apps/audits/serializers.py | 3 +- apps/locale/zh/LC_MESSAGES/django.mo | Bin 53928 -> 54151 bytes apps/locale/zh/LC_MESSAGES/django.po | 307 ++++++++++-------- 5 files changed, 206 insertions(+), 142 deletions(-) create mode 100644 apps/audits/migrations/0009_auto_20200624_1654.py diff --git a/apps/audits/migrations/0009_auto_20200624_1654.py b/apps/audits/migrations/0009_auto_20200624_1654.py new file mode 100644 index 000000000..6630558cf --- /dev/null +++ b/apps/audits/migrations/0009_auto_20200624_1654.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.10 on 2020-06-24 08:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('audits', '0008_auto_20200508_2105'), + ] + + operations = [ + migrations.AlterField( + model_name='ftplog', + name='operate', + field=models.CharField(choices=[('Delete', 'Delete'), ('Upload', 'Upload'), ('Download', 'Download'), ('Rmdir', 'Rmdir'), ('Rename', 'Rename'), ('Mkdir', 'Mkdir'), ('Symlink', 'Symlink')], max_length=16, verbose_name='Operate'), + ), + ] diff --git a/apps/audits/models.py b/apps/audits/models.py index 406d0aa44..38a41554f 100644 --- a/apps/audits/models.py +++ b/apps/audits/models.py @@ -14,12 +14,30 @@ __all__ = [ class FTPLog(OrgModelMixin): + OPERATE_DELETE = 'Delete' + OPERATE_UPLOAD = 'Upload' + OPERATE_DOWNLOAD = 'Download' + OPERATE_RMDIR = 'Rmdir' + OPERATE_RENAME = 'Rename' + OPERATE_MKDIR = 'Mkdir' + OPERATE_SYMLINK = 'Symlink' + + OPERATE_CHOICES = ( + (OPERATE_DELETE, _('Delete')), + (OPERATE_UPLOAD, _('Upload')), + (OPERATE_DOWNLOAD, _('Download')), + (OPERATE_RMDIR, _('Rmdir')), + (OPERATE_RENAME, _('Rename')), + (OPERATE_MKDIR, _('Mkdir')), + (OPERATE_SYMLINK, _('Symlink')) + ) + id = models.UUIDField(default=uuid.uuid4, primary_key=True) user = models.CharField(max_length=128, verbose_name=_('User')) remote_addr = models.CharField(max_length=128, verbose_name=_("Remote addr"), blank=True, null=True) asset = models.CharField(max_length=1024, verbose_name=_("Asset")) system_user = models.CharField(max_length=128, verbose_name=_("System user")) - operate = models.CharField(max_length=16, verbose_name=_("Operate")) + operate = models.CharField(max_length=16, verbose_name=_("Operate"), choices=OPERATE_CHOICES) filename = models.CharField(max_length=1024, verbose_name=_("Filename")) is_success = models.BooleanField(default=True, verbose_name=_("Success")) date_start = models.DateTimeField(auto_now_add=True, verbose_name=_('Date start')) diff --git a/apps/audits/serializers.py b/apps/audits/serializers.py index d4213f243..23d562c8d 100644 --- a/apps/audits/serializers.py +++ b/apps/audits/serializers.py @@ -12,12 +12,13 @@ from . import models class FTPLogSerializer(serializers.ModelSerializer): + operate_display = serializers.ReadOnlyField(source='get_operate_display') class Meta: model = models.FTPLog fields = ( 'id', 'user', 'remote_addr', 'asset', 'system_user', - 'operate', 'filename', 'is_success', 'date_start' + 'operate', 'filename', 'is_success', 'date_start', 'operate_display' ) diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 1fa128c6a49cb95568a8074b96bb6c24e150b1f2..23c9e90439ea278a96a5a632560b0e49fddf96f9 100644 GIT binary patch delta 16194 zcmZA71#}fx*T(S)5fYpP3xSeAa0?ElxVuZy;_hyp;I2W7yK90McZx%SqQ#|e1*_0P zzyFijtkw0+TBpCW_c?QH=H8pPZ`ZB%9lzGsy%+2^$KiUDz;QBQTw2F@#^DFB( zDats`mzWZ#VmBO$e_>

0j1yz9;^!yyG^SFX ze~78LZ(CKzx#T#mbE3NAq^85%8g#-sL_!<6%xiDQV$H~Y1P6aAiN%X~=I3Mp}pW2R-9P8F`oJ9B)Cc$pzU~?>L zp|daqmtZQ~feG;x>b{HS9aO&;7{L6_2P*35SJyj%B$$*q1e0R~@>HAxsDY{>PsnME zf!GX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t_1jh z-qLNSWp`8WYC{~SM``jYa3#5D>J@CHkF5VN@?TMoT3)x7rd|!FD4^djlIy1RxsD&( z{Y}vqP2(6U87x@_2U5PEbfWC1eKzVk#m$GPC$e~>skZ7?uZu(flb=c39!ePHC-UPc z{j5Es-jJL$w4|)3{6on`(e({w0TXVe?4i^r&Pe%~x~^q5NN4I1k~u!PXW9k2Wdz|IZYxf7N(q}gb{~Z=Q}vr>TSsDI*;whRi!*5&P*I> zZ4o$>d^q`e7)Q~S!`fS5W^yl>-;1Smw}#o&chazcIG(b^@}&LO3X5Zix>2`r{cRz{ zYe`(PKD(^(b1X?YMZN$f38gos1v%d~{a`mYnzSJS___1#W=v9+znPbfaxCb*pT&u>(8N{gv%qE^)3QU8#Rn{1#fJkN$7GMMxpHPe{NvT%2gmQ*78(?Pd0&?V@wLBQkTCx3 Np^HKB*G_H-{68o0c%c9Q diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index d2612f98a..66df40408 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: JumpServer 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-16 11:02+0800\n" +"POT-Creation-Date: 2020-06-24 16:46+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -28,7 +28,7 @@ msgstr "自定义" #: assets/models/label.py:18 ops/mixin.py:24 orgs/models.py:12 #: perms/models/base.py:48 settings/models.py:27 terminal/models.py:26 #: terminal/models.py:342 terminal/models.py:374 terminal/models.py:411 -#: users/forms/profile.py:20 users/models/group.py:15 users/models/user.py:466 +#: users/forms/profile.py:20 users/models/group.py:15 users/models/user.py:467 #: users/templates/users/_select_user_modal.html:13 #: users/templates/users/user_asset_permission.html:37 #: users/templates/users/user_asset_permission.html:154 @@ -77,14 +77,14 @@ msgstr "数据库" #: assets/models/group.py:23 assets/models/label.py:23 ops/models/adhoc.py:37 #: orgs/models.py:18 perms/models/base.py:56 settings/models.py:32 #: terminal/models.py:36 terminal/models.py:381 terminal/models.py:418 -#: users/models/group.py:16 users/models/user.py:499 +#: users/models/group.py:16 users/models/user.py:500 #: users/templates/users/user_detail.html:115 #: users/templates/users/user_granted_database_app.html:38 #: users/templates/users/user_granted_remote_app.html:37 #: users/templates/users/user_group_detail.html:62 #: users/templates/users/user_group_list.html:16 #: users/templates/users/user_profile.html:138 -#: xpack/plugins/change_auth_plan/models.py:76 xpack/plugins/cloud/models.py:53 +#: xpack/plugins/change_auth_plan/models.py:77 xpack/plugins/cloud/models.py:53 #: xpack/plugins/cloud/models.py:139 xpack/plugins/gathered_user/models.py:26 msgid "Comment" msgstr "备注" @@ -103,13 +103,14 @@ msgstr "数据库应用" #: assets/models/authbook.py:27 assets/models/gathered_user.py:14 #: assets/serializers/admin_user.py:32 assets/serializers/asset_user.py:47 #: assets/serializers/asset_user.py:84 assets/serializers/system_user.py:44 -#: assets/serializers/system_user.py:176 audits/models.py:20 +#: assets/serializers/system_user.py:176 audits/models.py:38 #: perms/forms/asset_permission.py:89 perms/models/asset_permission.py:80 #: templates/index.html:82 terminal/backends/command/models.py:19 -#: terminal/models.py:187 users/templates/users/user_asset_permission.html:40 +#: terminal/backends/command/serializers.py:13 terminal/models.py:187 +#: users/templates/users/user_asset_permission.html:40 #: users/templates/users/user_asset_permission.html:70 #: users/templates/users/user_granted_remote_app.html:36 -#: xpack/plugins/change_auth_plan/models.py:282 +#: xpack/plugins/change_auth_plan/models.py:283 #: xpack/plugins/cloud/models.py:269 msgid "Asset" msgstr "资产" @@ -131,9 +132,9 @@ msgstr "参数" #: assets/models/base.py:240 assets/models/cluster.py:28 #: assets/models/cmd_filter.py:26 assets/models/cmd_filter.py:59 #: assets/models/group.py:21 common/mixins/models.py:49 orgs/models.py:16 -#: perms/models/base.py:54 users/models/user.py:507 +#: perms/models/base.py:54 users/models/user.py:508 #: users/serializers/group.py:35 users/templates/users/user_detail.html:97 -#: xpack/plugins/change_auth_plan/models.py:80 xpack/plugins/cloud/models.py:56 +#: xpack/plugins/change_auth_plan/models.py:81 xpack/plugins/cloud/models.py:56 #: xpack/plugins/cloud/models.py:145 xpack/plugins/gathered_user/models.py:30 msgid "Created by" msgstr "创建者" @@ -232,7 +233,7 @@ msgstr "网域" #: assets/models/asset.py:195 assets/models/user.py:109 #: perms/models/asset_permission.py:81 -#: xpack/plugins/change_auth_plan/models.py:55 +#: xpack/plugins/change_auth_plan/models.py:56 #: xpack/plugins/gathered_user/models.py:24 msgid "Nodes" msgstr "节点" @@ -334,16 +335,16 @@ msgid "AuthBook" msgstr "" #: assets/models/base.py:233 assets/models/gathered_user.py:15 -#: audits/models.py:81 authentication/forms.py:10 +#: audits/models.py:99 authentication/forms.py:10 #: authentication/templates/authentication/login.html:21 #: authentication/templates/authentication/xpack_login.html:93 -#: ops/models/adhoc.py:148 users/forms/profile.py:19 users/models/user.py:464 +#: ops/models/adhoc.py:148 users/forms/profile.py:19 users/models/user.py:465 #: users/templates/users/_select_user_modal.html:14 #: users/templates/users/user_detail.html:53 #: users/templates/users/user_list.html:15 #: users/templates/users/user_profile.html:47 -#: xpack/plugins/change_auth_plan/models.py:46 -#: xpack/plugins/change_auth_plan/models.py:278 +#: xpack/plugins/change_auth_plan/models.py:47 +#: xpack/plugins/change_auth_plan/models.py:279 msgid "Username" msgstr "用户名" @@ -358,21 +359,21 @@ msgstr "用户名" #: users/templates/users/user_profile_update.html:41 #: users/templates/users/user_pubkey_update.html:41 #: users/templates/users/user_update.html:20 -#: xpack/plugins/change_auth_plan/models.py:67 -#: xpack/plugins/change_auth_plan/models.py:190 -#: xpack/plugins/change_auth_plan/models.py:285 +#: xpack/plugins/change_auth_plan/models.py:68 +#: xpack/plugins/change_auth_plan/models.py:191 +#: xpack/plugins/change_auth_plan/models.py:286 msgid "Password" msgstr "密码" -#: assets/models/base.py:235 xpack/plugins/change_auth_plan/models.py:71 -#: xpack/plugins/change_auth_plan/models.py:197 -#: xpack/plugins/change_auth_plan/models.py:292 +#: assets/models/base.py:235 xpack/plugins/change_auth_plan/models.py:72 +#: xpack/plugins/change_auth_plan/models.py:198 +#: xpack/plugins/change_auth_plan/models.py:293 msgid "SSH private key" msgstr "SSH密钥" -#: assets/models/base.py:236 xpack/plugins/change_auth_plan/models.py:74 -#: xpack/plugins/change_auth_plan/models.py:193 -#: xpack/plugins/change_auth_plan/models.py:288 +#: assets/models/base.py:236 xpack/plugins/change_auth_plan/models.py:75 +#: xpack/plugins/change_auth_plan/models.py:194 +#: xpack/plugins/change_auth_plan/models.py:289 msgid "SSH public key" msgstr "SSH公钥" @@ -389,7 +390,7 @@ msgstr "带宽" msgid "Contact" msgstr "联系人" -#: assets/models/cluster.py:22 users/models/user.py:485 +#: assets/models/cluster.py:22 users/models/user.py:486 #: users/templates/users/user_detail.html:62 msgid "Phone" msgstr "手机" @@ -415,7 +416,7 @@ msgid "Default" msgstr "默认" #: assets/models/cluster.py:36 assets/models/label.py:14 -#: users/models/user.py:626 +#: users/models/user.py:627 msgid "System" msgstr "系统" @@ -448,7 +449,7 @@ msgid "Regex" msgstr "正则表达式" #: assets/models/cmd_filter.py:40 ops/models/command.py:23 -#: terminal/models.py:196 +#: terminal/backends/command/serializers.py:15 terminal/models.py:196 msgid "Command" msgstr "命令" @@ -480,7 +481,7 @@ msgstr "内容" msgid "One line one command" msgstr "每行一个命令" -#: assets/models/cmd_filter.py:55 audits/models.py:39 +#: assets/models/cmd_filter.py:55 audits/models.py:57 #: authentication/templates/authentication/_access_key_modal.html:34 #: perms/forms/asset_permission.py:20 tickets/serializers/ticket.py:26 #: users/templates/users/_granted_assets.html:29 @@ -529,14 +530,15 @@ msgstr "资产组" msgid "Default asset group" msgstr "默认资产组" -#: assets/models/label.py:15 audits/models.py:18 audits/models.py:38 -#: audits/models.py:51 audits/serializers.py:76 authentication/models.py:43 +#: assets/models/label.py:15 audits/models.py:36 audits/models.py:56 +#: audits/models.py:69 audits/serializers.py:77 authentication/models.py:43 #: perms/forms/asset_permission.py:83 perms/forms/database_app_permission.py:38 #: perms/forms/remote_app_permission.py:40 perms/models/base.py:49 #: templates/index.html:78 terminal/backends/command/models.py:18 -#: terminal/models.py:185 tickets/models/ticket.py:33 -#: tickets/models/ticket.py:128 users/forms/group.py:15 -#: users/models/user.py:159 users/models/user.py:175 users/models/user.py:614 +#: terminal/backends/command/serializers.py:12 terminal/models.py:185 +#: tickets/models/ticket.py:33 tickets/models/ticket.py:128 +#: tickets/serializers/ticket.py:27 users/forms/group.py:15 +#: users/models/user.py:160 users/models/user.py:176 users/models/user.py:615 #: users/serializers/group.py:20 #: users/templates/users/user_asset_permission.html:38 #: users/templates/users/user_asset_permission.html:64 @@ -601,12 +603,12 @@ msgid "Username same with user" msgstr "用户名与用户相同" #: assets/models/user.py:110 templates/_nav.html:39 -#: xpack/plugins/change_auth_plan/models.py:51 +#: xpack/plugins/change_auth_plan/models.py:52 msgid "Assets" msgstr "资产管理" #: assets/models/user.py:111 templates/_nav.html:17 -#: users/views/profile/password.py:40 users/views/profile/pubkey.py:36 +#: users/views/profile/password.py:42 users/views/profile/pubkey.py:36 msgid "Users" msgstr "用户管理" @@ -635,12 +637,13 @@ msgstr "登录模式" msgid "SFTP Root" msgstr "SFTP根路径" -#: assets/models/user.py:195 audits/models.py:21 +#: assets/models/user.py:195 audits/models.py:39 #: perms/forms/asset_permission.py:95 perms/forms/remote_app_permission.py:49 #: perms/models/asset_permission.py:82 #: perms/models/database_app_permission.py:22 #: perms/models/remote_app_permission.py:16 templates/_nav.html:45 -#: terminal/backends/command/models.py:20 terminal/models.py:189 +#: terminal/backends/command/models.py:20 +#: terminal/backends/command/serializers.py:14 terminal/models.py:189 #: users/templates/users/_granted_assets.html:27 #: users/templates/users/user_asset_permission.html:42 #: users/templates/users/user_asset_permission.html:76 @@ -685,7 +688,7 @@ msgstr "硬件信息" msgid "Org name" msgstr "组织名称" -#: assets/serializers/asset.py:144 assets/serializers/asset.py:181 +#: assets/serializers/asset.py:144 assets/serializers/asset.py:175 msgid "Connectivity" msgstr "连接" @@ -699,14 +702,14 @@ msgid "Backend" msgstr "后端" #: assets/serializers/asset_user.py:75 users/forms/profile.py:148 -#: users/models/user.py:496 users/templates/users/user_password_update.html:48 +#: users/models/user.py:497 users/templates/users/user_password_update.html:48 #: users/templates/users/user_profile.html:69 #: users/templates/users/user_profile_update.html:46 #: users/templates/users/user_pubkey_update.html:46 msgid "Public key" msgstr "SSH公钥" -#: assets/serializers/asset_user.py:79 users/models/user.py:493 +#: assets/serializers/asset_user.py:79 users/models/user.py:494 msgid "Private key" msgstr "ssh私钥" @@ -855,37 +858,74 @@ msgstr "为了安全,禁止推送用户 {}" msgid "No assets matched, stop task" msgstr "没有匹配到资产,结束任务" -#: audits/models.py:19 audits/models.py:42 audits/models.py:53 +#: audits/models.py:26 audits/models.py:53 +#: authentication/templates/authentication/_access_key_modal.html:65 +#: users/templates/users/user_asset_permission.html:128 +#: users/templates/users/user_database_app_permission.html:111 +#: users/templates/users/user_detail.html:16 +#: users/templates/users/user_group_detail.html:27 +#: users/templates/users/user_group_list.html:53 +#: users/templates/users/user_list.html:94 +#: users/templates/users/user_list.html:98 +#: users/templates/users/user_remote_app_permission.html:111 +msgid "Delete" +msgstr "删除文件" + +#: audits/models.py:27 +msgid "Upload" +msgstr "上传文件" + +#: audits/models.py:28 +msgid "Download" +msgstr "下载文件" + +#: audits/models.py:29 +msgid "Rmdir" +msgstr "删除目录" + +#: audits/models.py:30 +msgid "Rename" +msgstr "重命名" + +#: audits/models.py:31 +msgid "Mkdir" +msgstr "创建目录" + +#: audits/models.py:32 +msgid "Symlink" +msgstr "建立软链接" + +#: audits/models.py:37 audits/models.py:60 audits/models.py:71 #: terminal/models.py:192 msgid "Remote addr" msgstr "远端地址" -#: audits/models.py:22 +#: audits/models.py:40 msgid "Operate" msgstr "操作" -#: audits/models.py:23 +#: audits/models.py:41 msgid "Filename" msgstr "文件名" -#: audits/models.py:24 audits/models.py:77 +#: audits/models.py:42 audits/models.py:95 #: users/templates/users/user_detail.html:487 msgid "Success" msgstr "成功" -#: audits/models.py:25 ops/models/command.py:28 perms/models/base.py:52 -#: terminal/models.py:199 xpack/plugins/change_auth_plan/models.py:176 -#: xpack/plugins/change_auth_plan/models.py:307 +#: audits/models.py:43 ops/models/command.py:28 perms/models/base.py:52 +#: terminal/models.py:199 xpack/plugins/change_auth_plan/models.py:177 +#: xpack/plugins/change_auth_plan/models.py:308 #: xpack/plugins/gathered_user/models.py:76 msgid "Date start" msgstr "开始日期" -#: audits/models.py:33 +#: audits/models.py:51 #: authentication/templates/authentication/_access_key_modal.html:22 msgid "Create" msgstr "创建" -#: audits/models.py:34 templates/_csv_import_export.html:18 +#: audits/models.py:52 templates/_csv_import_export.html:18 #: templates/_csv_update_modal.html:6 #: users/templates/users/user_asset_permission.html:127 #: users/templates/users/user_database_app_permission.html:110 @@ -901,105 +941,92 @@ msgstr "创建" msgid "Update" msgstr "更新" -#: audits/models.py:35 -#: authentication/templates/authentication/_access_key_modal.html:65 -#: users/templates/users/user_asset_permission.html:128 -#: users/templates/users/user_database_app_permission.html:111 -#: users/templates/users/user_detail.html:16 -#: users/templates/users/user_group_detail.html:27 -#: users/templates/users/user_group_list.html:53 -#: users/templates/users/user_list.html:94 -#: users/templates/users/user_list.html:98 -#: users/templates/users/user_remote_app_permission.html:111 -msgid "Delete" -msgstr "删除" - -#: audits/models.py:40 +#: audits/models.py:58 msgid "Resource Type" msgstr "资源类型" -#: audits/models.py:41 +#: audits/models.py:59 msgid "Resource" msgstr "资源" -#: audits/models.py:43 audits/models.py:54 +#: audits/models.py:61 audits/models.py:72 msgid "Datetime" msgstr "日期" -#: audits/models.py:52 +#: audits/models.py:70 msgid "Change by" msgstr "修改者" -#: audits/models.py:71 users/templates/users/user_detail.html:84 +#: audits/models.py:89 users/templates/users/user_detail.html:84 msgid "Disabled" msgstr "禁用" -#: audits/models.py:72 settings/models.py:31 +#: audits/models.py:90 settings/models.py:31 #: users/templates/users/user_detail.html:82 msgid "Enabled" msgstr "启用" -#: audits/models.py:73 +#: audits/models.py:91 msgid "-" msgstr "" -#: audits/models.py:78 xpack/plugins/cloud/models.py:204 +#: audits/models.py:96 xpack/plugins/cloud/models.py:204 msgid "Failed" msgstr "失败" -#: audits/models.py:82 +#: audits/models.py:100 msgid "Login type" msgstr "登录方式" -#: audits/models.py:83 +#: audits/models.py:101 msgid "Login ip" msgstr "登录IP" -#: audits/models.py:84 +#: audits/models.py:102 msgid "Login city" msgstr "登录城市" -#: audits/models.py:85 +#: audits/models.py:103 msgid "User agent" msgstr "Agent" -#: audits/models.py:86 +#: audits/models.py:104 #: authentication/templates/authentication/_mfa_confirm_modal.html:14 #: authentication/templates/authentication/login_otp.html:6 -#: users/forms/profile.py:52 users/models/user.py:488 +#: users/forms/profile.py:52 users/models/user.py:489 #: users/serializers/user.py:216 users/templates/users/user_detail.html:77 #: users/templates/users/user_profile.html:87 msgid "MFA" msgstr "多因子认证" -#: audits/models.py:87 xpack/plugins/change_auth_plan/models.py:303 +#: audits/models.py:105 xpack/plugins/change_auth_plan/models.py:304 #: xpack/plugins/cloud/models.py:217 msgid "Reason" msgstr "原因" -#: audits/models.py:88 tickets/serializers/ticket.py:25 +#: audits/models.py:106 tickets/serializers/ticket.py:25 #: xpack/plugins/cloud/models.py:214 xpack/plugins/cloud/models.py:272 msgid "Status" msgstr "状态" -#: audits/models.py:89 +#: audits/models.py:107 msgid "Date login" msgstr "登录日期" -#: audits/serializers.py:61 audits/serializers.py:73 ops/models/adhoc.py:244 +#: audits/serializers.py:62 audits/serializers.py:74 ops/models/adhoc.py:244 msgid "Is success" msgstr "是否成功" -#: audits/serializers.py:72 ops/models/command.py:24 +#: audits/serializers.py:73 ops/models/command.py:24 #: xpack/plugins/cloud/models.py:212 msgid "Result" msgstr "结果" -#: audits/serializers.py:74 +#: audits/serializers.py:75 msgid "Hosts" msgstr "主机" -#: audits/serializers.py:75 +#: audits/serializers.py:76 msgid "Run as" msgstr "运行用户" @@ -1106,8 +1133,8 @@ msgid "" "after {} minutes)" msgstr "账号已被锁定(请联系管理员解锁 或 {}分钟后重试)" -#: authentication/errors.py:48 users/views/profile/otp.py:63 -#: users/views/profile/otp.py:102 users/views/profile/otp.py:121 +#: authentication/errors.py:48 users/views/profile/otp.py:107 +#: users/views/profile/otp.py:146 users/views/profile/otp.py:166 msgid "MFA code invalid, or ntp sync server time" msgstr "MFA验证码不正确,或者服务器端时间不对" @@ -1186,7 +1213,7 @@ msgid "Show" msgstr "显示" #: authentication/templates/authentication/_access_key_modal.html:66 -#: users/models/user.py:386 users/serializers/user.py:213 +#: users/models/user.py:387 users/serializers/user.py:213 #: users/templates/users/user_profile.html:94 #: users/templates/users/user_profile.html:163 #: users/templates/users/user_profile.html:166 @@ -1195,7 +1222,7 @@ msgid "Disable" msgstr "禁用" #: authentication/templates/authentication/_access_key_modal.html:67 -#: users/models/user.py:387 users/serializers/user.py:214 +#: users/models/user.py:388 users/serializers/user.py:214 #: users/templates/users/user_profile.html:92 #: users/templates/users/user_profile.html:170 msgid "Enable" @@ -1520,8 +1547,8 @@ msgstr "开始时间" msgid "End time" msgstr "完成时间" -#: ops/models/adhoc.py:242 xpack/plugins/change_auth_plan/models.py:179 -#: xpack/plugins/change_auth_plan/models.py:310 +#: ops/models/adhoc.py:242 xpack/plugins/change_auth_plan/models.py:180 +#: xpack/plugins/change_auth_plan/models.py:311 #: xpack/plugins/gathered_user/models.py:79 msgid "Time" msgstr "时间" @@ -1604,7 +1631,7 @@ msgstr "提示:RDP 协议不支持单独控制上传或下载文件" #: perms/forms/asset_permission.py:86 perms/forms/database_app_permission.py:41 #: perms/forms/remote_app_permission.py:43 perms/models/base.py:50 #: templates/_nav.html:21 users/forms/user.py:168 users/models/group.py:31 -#: users/models/user.py:472 users/templates/users/_select_user_modal.html:16 +#: users/models/user.py:473 users/templates/users/_select_user_modal.html:16 #: users/templates/users/user_asset_permission.html:39 #: users/templates/users/user_asset_permission.html:67 #: users/templates/users/user_database_app_permission.html:38 @@ -1657,7 +1684,7 @@ msgstr "动作" msgid "Asset permission" msgstr "资产授权" -#: perms/models/base.py:53 users/models/user.py:504 +#: perms/models/base.py:53 users/models/user.py:505 #: users/templates/users/user_detail.html:93 #: users/templates/users/user_profile.html:120 msgid "Date expired" @@ -2320,14 +2347,17 @@ msgid "Input" msgstr "输入" #: terminal/backends/command/models.py:22 +#: terminal/backends/command/serializers.py:16 msgid "Output" msgstr "输出" #: terminal/backends/command/models.py:23 +#: terminal/backends/command/serializers.py:17 msgid "Session" msgstr "会话" #: terminal/backends/command/models.py:24 +#: terminal/backends/command/serializers.py:18 msgid "Risk level" msgstr "风险等级" @@ -2553,7 +2583,7 @@ msgstr "确认密码" msgid "Password does not match" msgstr "密码不一致" -#: users/forms/profile.py:89 users/models/user.py:468 +#: users/forms/profile.py:89 users/models/user.py:469 #: users/templates/users/user_detail.html:57 #: users/templates/users/user_profile.html:59 msgid "Email" @@ -2594,7 +2624,7 @@ msgstr "不能和原来的密钥相同" msgid "Not a valid ssh public key" msgstr "SSH密钥不合法" -#: users/forms/user.py:27 users/models/user.py:476 +#: users/forms/user.py:27 users/models/user.py:477 #: users/templates/users/_select_user_modal.html:15 #: users/templates/users/user_detail.html:73 #: users/templates/users/user_list.html:16 @@ -2602,7 +2632,7 @@ msgstr "SSH密钥不合法" msgid "Role" msgstr "角色" -#: users/forms/user.py:31 users/models/user.py:511 +#: users/forms/user.py:31 users/models/user.py:512 #: users/templates/users/user_detail.html:89 #: users/templates/users/user_list.html:18 #: users/templates/users/user_profile.html:102 @@ -2617,7 +2647,7 @@ msgstr "复制用户公钥到这里" msgid "Join user groups" msgstr "添加到用户组" -#: users/forms/user.py:103 users/views/profile/password.py:57 +#: users/forms/user.py:103 users/views/profile/password.py:59 #: users/views/profile/reset.py:123 msgid "* Your password does not meet the requirements" msgstr "* 您的密码不符合要求" @@ -2631,52 +2661,52 @@ msgid "Set password" msgstr "设置密码" #: users/forms/user.py:132 users/serializers/user.py:38 -#: xpack/plugins/change_auth_plan/models.py:60 +#: xpack/plugins/change_auth_plan/models.py:61 #: xpack/plugins/change_auth_plan/serializers.py:30 msgid "Password strategy" msgstr "密码策略" -#: users/models/user.py:158 users/models/user.py:622 +#: users/models/user.py:159 users/models/user.py:623 msgid "Administrator" msgstr "管理员" -#: users/models/user.py:160 +#: users/models/user.py:161 msgid "Application" msgstr "应用程序" -#: users/models/user.py:161 +#: users/models/user.py:162 msgid "Auditor" msgstr "审计员" -#: users/models/user.py:171 +#: users/models/user.py:172 msgid "Org admin" msgstr "组织管理员" -#: users/models/user.py:173 +#: users/models/user.py:174 msgid "Org auditor" msgstr "组织审计员" -#: users/models/user.py:388 users/templates/users/user_profile.html:90 +#: users/models/user.py:389 users/templates/users/user_profile.html:90 msgid "Force enable" msgstr "强制启用" -#: users/models/user.py:455 +#: users/models/user.py:456 msgid "Local" msgstr "数据库" -#: users/models/user.py:479 +#: users/models/user.py:480 msgid "Avatar" msgstr "头像" -#: users/models/user.py:482 users/templates/users/user_detail.html:68 +#: users/models/user.py:483 users/templates/users/user_detail.html:68 msgid "Wechat" msgstr "微信" -#: users/models/user.py:515 +#: users/models/user.py:516 msgid "Date password last updated" msgstr "最后更新密码日期" -#: users/models/user.py:625 +#: users/models/user.py:626 msgid "Administrator is the super user of system" msgstr "Administrator是初始的超级管理员" @@ -2902,7 +2932,7 @@ msgstr "很强" #: users/templates/users/user_database_app_permission.html:41 #: users/templates/users/user_list.html:19 #: users/templates/users/user_remote_app_permission.html:41 -#: xpack/plugins/cloud/models.py:50 xpack/plugins/cloud/serializers.py:32 +#: xpack/plugins/cloud/models.py:50 msgid "Validity" msgstr "有效" @@ -3453,27 +3483,27 @@ msgstr "" "
\n" " " -#: users/views/profile/otp.py:145 +#: users/views/profile/otp.py:190 msgid "MFA enable success" msgstr "多因子认证启用成功" -#: users/views/profile/otp.py:146 +#: users/views/profile/otp.py:191 msgid "MFA enable success, return login page" msgstr "多因子认证启用成功,返回到登录页面" -#: users/views/profile/otp.py:148 +#: users/views/profile/otp.py:193 msgid "MFA disable success" msgstr "多因子认证禁用成功" -#: users/views/profile/otp.py:149 +#: users/views/profile/otp.py:194 msgid "MFA disable success, return login page" msgstr "多因子认证禁用成功,返回登录页面" -#: users/views/profile/password.py:41 +#: users/views/profile/password.py:43 msgid "Password update" msgstr "密码更新" -#: users/views/profile/password.py:72 +#: users/views/profile/password.py:74 msgid "Password invalid" msgstr "用户名或密码无效" @@ -3507,65 +3537,65 @@ msgid "Token invalid or expired" msgstr "Token错误或失效" #: xpack/plugins/change_auth_plan/meta.py:9 -#: xpack/plugins/change_auth_plan/models.py:88 -#: xpack/plugins/change_auth_plan/models.py:183 +#: xpack/plugins/change_auth_plan/models.py:89 +#: xpack/plugins/change_auth_plan/models.py:184 msgid "Change auth plan" msgstr "改密计划" -#: xpack/plugins/change_auth_plan/models.py:40 +#: xpack/plugins/change_auth_plan/models.py:41 msgid "Custom password" msgstr "自定义密码" -#: xpack/plugins/change_auth_plan/models.py:41 +#: xpack/plugins/change_auth_plan/models.py:42 msgid "All assets use the same random password" msgstr "所有资产使用相同的随机密码" -#: xpack/plugins/change_auth_plan/models.py:42 +#: xpack/plugins/change_auth_plan/models.py:43 msgid "All assets use different random password" msgstr "所有资产使用不同的随机密码" -#: xpack/plugins/change_auth_plan/models.py:64 +#: xpack/plugins/change_auth_plan/models.py:65 msgid "Password rules" msgstr "密码规则" -#: xpack/plugins/change_auth_plan/models.py:187 +#: xpack/plugins/change_auth_plan/models.py:188 msgid "Change auth plan snapshot" msgstr "改密计划快照" -#: xpack/plugins/change_auth_plan/models.py:202 -#: xpack/plugins/change_auth_plan/models.py:296 +#: xpack/plugins/change_auth_plan/models.py:203 +#: xpack/plugins/change_auth_plan/models.py:297 msgid "Change auth plan execution" msgstr "改密计划执行" -#: xpack/plugins/change_auth_plan/models.py:269 +#: xpack/plugins/change_auth_plan/models.py:270 msgid "Ready" msgstr "" -#: xpack/plugins/change_auth_plan/models.py:270 +#: xpack/plugins/change_auth_plan/models.py:271 msgid "Preflight check" msgstr "" -#: xpack/plugins/change_auth_plan/models.py:271 +#: xpack/plugins/change_auth_plan/models.py:272 msgid "Change auth" msgstr "" -#: xpack/plugins/change_auth_plan/models.py:272 +#: xpack/plugins/change_auth_plan/models.py:273 msgid "Verify auth" msgstr "" -#: xpack/plugins/change_auth_plan/models.py:273 +#: xpack/plugins/change_auth_plan/models.py:274 msgid "Keep auth" msgstr "" -#: xpack/plugins/change_auth_plan/models.py:274 +#: xpack/plugins/change_auth_plan/models.py:275 msgid "Finished" msgstr "结束" -#: xpack/plugins/change_auth_plan/models.py:300 +#: xpack/plugins/change_auth_plan/models.py:301 msgid "Step" msgstr "步骤" -#: xpack/plugins/change_auth_plan/models.py:317 +#: xpack/plugins/change_auth_plan/models.py:318 msgid "Change auth plan task" msgstr "改密计划任务" @@ -3609,7 +3639,7 @@ msgstr "有效" msgid "Unavailable" msgstr "无效" -#: xpack/plugins/cloud/models.py:39 xpack/plugins/cloud/serializers.py:31 +#: xpack/plugins/cloud/models.py:39 msgid "Provider" msgstr "云服务商" @@ -3625,7 +3655,7 @@ msgstr "" msgid "Cloud account" msgstr "云账号" -#: xpack/plugins/cloud/models.py:122 xpack/plugins/cloud/serializers.py:55 +#: xpack/plugins/cloud/models.py:122 xpack/plugins/cloud/serializers.py:58 msgid "Regions" msgstr "地域" @@ -3633,7 +3663,7 @@ msgstr "地域" msgid "Instances" msgstr "实例" -#: xpack/plugins/cloud/models.py:136 xpack/plugins/cloud/serializers.py:77 +#: xpack/plugins/cloud/models.py:136 xpack/plugins/cloud/serializers.py:80 msgid "Covered always" msgstr "总是被覆盖" @@ -3753,19 +3783,19 @@ msgstr "拉美-圣地亚哥" msgid "Tencent Cloud" msgstr "腾讯云" -#: xpack/plugins/cloud/serializers.py:53 +#: xpack/plugins/cloud/serializers.py:56 msgid "History count" msgstr "用户数量" -#: xpack/plugins/cloud/serializers.py:54 +#: xpack/plugins/cloud/serializers.py:57 msgid "Instance count" msgstr "实例个数" -#: xpack/plugins/cloud/serializers.py:75 +#: xpack/plugins/cloud/serializers.py:78 msgid "Account name" msgstr "账户名称" -#: xpack/plugins/cloud/serializers.py:76 +#: xpack/plugins/cloud/serializers.py:79 #: xpack/plugins/gathered_user/serializers.py:20 msgid "Periodic display" msgstr "定时执行" @@ -5020,9 +5050,6 @@ msgstr "旗舰版" #~ msgid "Download replay" #~ msgstr "下载录像" -#~ msgid "Download" -#~ msgstr "下载" - #~ msgid "Monitor session" #~ msgstr "监控" From 2b6e81894328ccd17a5ce9e01953e03bbb3aa10f Mon Sep 17 00:00:00 2001 From: xinwen Date: Sun, 28 Jun 2020 19:02:20 +0800 Subject: [PATCH 03/19] =?UTF-8?q?[Update]=20=E9=99=90=E5=88=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0CSV=E6=96=87=E4=BB=B6=E7=9A=84=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/drf/parsers/csv.py | 47 ++++++++++++++++++++------- apps/locale/zh/LC_MESSAGES/django.mo | Bin 54151 -> 54229 bytes apps/locale/zh/LC_MESSAGES/django.po | 27 ++++++++------- 3 files changed, 52 insertions(+), 22 deletions(-) diff --git a/apps/common/drf/parsers/csv.py b/apps/common/drf/parsers/csv.py index 95a9ec732..58b3f7bc2 100644 --- a/apps/common/drf/parsers/csv.py +++ b/apps/common/drf/parsers/csv.py @@ -6,18 +6,27 @@ import chardet import codecs import unicodecsv +from django.utils.translation import ugettext as _ from rest_framework.parsers import BaseParser -from rest_framework.exceptions import ParseError +from rest_framework.exceptions import ParseError, APIException +from rest_framework import status from common.utils import get_logger logger = get_logger(__file__) +class CsvDataTooBig(APIException): + status_code = status.HTTP_400_BAD_REQUEST + default_code = 'csv_data_too_big' + default_detail = _('The max size of CSV is %d bytes') + + class JMSCSVParser(BaseParser): """ Parses CSV file to serializer data """ + CSV_UPLOAD_MAX_SIZE = 1024 * 1024 * 10 media_type = 'text/csv' @@ -46,23 +55,31 @@ class JMSCSVParser(BaseParser): return fields_map @staticmethod - def _process_row(row): + def _replace_chinese_quot(str_): + trans_table = str.maketrans({ + '“': '"', + '”': '"', + '‘': '"', + '’': '"', + '\'': '"' + }) + return str_.translate(trans_table) + + @classmethod + def _process_row(cls, row): """ 构建json数据前的行处理 """ _row = [] + for col in row: # 列表转换 - if isinstance(col, str) and col.find("[") != -1 and col.find("]") != -1: - # 替换中文格式引号 - col = col.replace("“", '"').replace("”", '"').\ - replace("‘", '"').replace('’', '"').replace("'", '"') + if isinstance(col, str) and col.startswith('[') and col.endswith(']'): + col = cls._replace_chinese_quot(col) col = json.loads(col) # 字典转换 - if isinstance(col, str) and col.find("{") != -1 and col.find("}") != -1: - # 替换中文格式引号 - col = col.replace("“", '"').replace("”", '"'). \ - replace("‘", '"').replace('’', '"').replace("'", '"') + if isinstance(col, str) and col.startswith("{") and col.endswith("}"): + col = cls._replace_chinese_quot(col) col = json.loads(col) _row.append(col) return _row @@ -82,11 +99,19 @@ class JMSCSVParser(BaseParser): def parse(self, stream, media_type=None, parser_context=None): parser_context = parser_context or {} try: - serializer = parser_context["view"].get_serializer() + view = parser_context['view'] + meta = view.request.META + serializer = view.get_serializer() except Exception as e: logger.debug(e, exc_info=True) raise ParseError('The resource does not support imports!') + content_length = int(meta.get('CONTENT_LENGTH', meta.get('HTTP_CONTENT_LENGTH', 0))) + if content_length > self.CSV_UPLOAD_MAX_SIZE: + msg = CsvDataTooBig.default_detail % self.CSV_UPLOAD_MAX_SIZE + logger.error(msg) + raise CsvDataTooBig(msg) + try: stream_data = stream.read() stream_data = stream_data.strip(codecs.BOM_UTF8) diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 23c9e90439ea278a96a5a632560b0e49fddf96f9..5854d565a426a859fd8fe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5mgQ5`nJ{MZUZu^Xzxq3#=+`N*A`ST$rV*`|CRlRfHYBqsPyyMHH!`_{N&72@+Apr$w< z{p7??-PRRG`-Zz271~COBG%uv>v5#@xrp)tw_3$|zRm8~iU|=P5-;OZo_1HT1)rXj z=esAVy-M`IpK6r%)5{1xJKT^;&wMvrU**_xGsp*9@4wKvGw}m^t||FCbKLh1)-=ly8MQKdDmKNb39XDJ*HHpJDDTT8(x8PAV1n3Hifr=_)OK z-?<~JB*c79JcW;bl5jU8^VhU9nevZ(zI4x4=@fE?QdgVPYPUkwqP}Nt>#F%fz9xT{ z&vWWFx`V5Rm!3ydkI!~8Iq0V$pU)}JCa0fIDDxMbv&7w5wUTeU`+e1VzIATtcO*ZG`vA0{^pJV)l9n^bMM@1eW3TDb1AlbzfpH=|mqkW-Xe zkh#z2d)HSz(znTtsvh3^5&5I^p`YP=Lip?^*OQNaMxg%BB>GwFk@;UreMN2%&y^+j z3*`w`w})~n<-62%vwqK$8{;mm9vOIz(qs2<^_D)@4M~YCF^TvmKJBb!9OY?zZt~IB zm3~IM%~K*vJ|XjfC>Y=8qn|jQ+F?&_AUECT&PmDdu1pE{U2qSk#QQSb?^9xfzqRJy zxOr=&_%6H6YYYrtN$wDzWA4csO+%(zi!yX}-;JtSD)0v~bKJ%?6GHry^qMcnh3=%9 z@xCMO&YCG>_(-w^j&oOr^fmwx^q(Fef!+QsR_Ob?&H*O g-{ReYwN}^6I-vV-_unRAyT2LpYvbL|Pu\n" "Language-Team: JumpServer team\n" @@ -608,7 +608,7 @@ msgid "Assets" msgstr "资产管理" #: assets/models/user.py:111 templates/_nav.html:17 -#: users/views/profile/password.py:42 users/views/profile/pubkey.py:36 +#: users/views/profile/password.py:40 users/views/profile/pubkey.py:36 msgid "Users" msgstr "用户管理" @@ -1133,8 +1133,8 @@ msgid "" "after {} minutes)" msgstr "账号已被锁定(请联系管理员解锁 或 {}分钟后重试)" -#: authentication/errors.py:48 users/views/profile/otp.py:107 -#: users/views/profile/otp.py:146 users/views/profile/otp.py:166 +#: authentication/errors.py:48 users/views/profile/otp.py:63 +#: users/views/profile/otp.py:102 users/views/profile/otp.py:121 msgid "MFA code invalid, or ntp sync server time" msgstr "MFA验证码不正确,或者服务器端时间不对" @@ -1364,6 +1364,11 @@ msgstr "%(name)s 创建成功" msgid "%(name)s was updated successfully" msgstr "%(name)s 更新成功" +#: common/drf/parsers/csv.py:22 +#, python-format +msgid "The max size of CSV is %d bytes" +msgstr "CSV 文件最大为 %d 字节" + #: common/fields/form.py:33 msgid "Not a valid json" msgstr "不是合法json" @@ -2647,7 +2652,7 @@ msgstr "复制用户公钥到这里" msgid "Join user groups" msgstr "添加到用户组" -#: users/forms/user.py:103 users/views/profile/password.py:59 +#: users/forms/user.py:103 users/views/profile/password.py:57 #: users/views/profile/reset.py:123 msgid "* Your password does not meet the requirements" msgstr "* 您的密码不符合要求" @@ -3483,27 +3488,27 @@ msgstr "" "
\n" " " -#: users/views/profile/otp.py:190 +#: users/views/profile/otp.py:145 msgid "MFA enable success" msgstr "多因子认证启用成功" -#: users/views/profile/otp.py:191 +#: users/views/profile/otp.py:146 msgid "MFA enable success, return login page" msgstr "多因子认证启用成功,返回到登录页面" -#: users/views/profile/otp.py:193 +#: users/views/profile/otp.py:148 msgid "MFA disable success" msgstr "多因子认证禁用成功" -#: users/views/profile/otp.py:194 +#: users/views/profile/otp.py:149 msgid "MFA disable success, return login page" msgstr "多因子认证禁用成功,返回登录页面" -#: users/views/profile/password.py:43 +#: users/views/profile/password.py:41 msgid "Password update" msgstr "密码更新" -#: users/views/profile/password.py:74 +#: users/views/profile/password.py:72 msgid "Password invalid" msgstr "用户名或密码无效" From 71ee33e3be2743549a4f924ac11ba5d1fe93146c Mon Sep 17 00:00:00 2001 From: Bai Date: Tue, 30 Jun 2020 17:12:38 +0800 Subject: [PATCH 04/19] =?UTF-8?q?feat(login=20password=20ecrypt):=20?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=AF=86=E7=A0=81=E5=8A=A0=E5=AF=86=E4=BC=A0?= =?UTF-8?q?=E8=BE=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/errors.py | 2 + apps/authentication/forms.py | 2 +- .../templates/authentication/login.html | 19 ++++- .../templates/authentication/xpack_login.html | 18 ++++- apps/authentication/utils.py | 39 ++++++++++ apps/authentication/views/login.py | 6 +- .../js/plugins/jsencrypt/jsencrypt.min.js | 73 +++++++++++++++++++ 7 files changed, 152 insertions(+), 7 deletions(-) create mode 100644 apps/static/js/plugins/jsencrypt/jsencrypt.min.js diff --git a/apps/authentication/errors.py b/apps/authentication/errors.py index d782a05fc..20ec0aedf 100644 --- a/apps/authentication/errors.py +++ b/apps/authentication/errors.py @@ -10,6 +10,7 @@ from users.utils import ( ) reason_password_failed = 'password_failed' +reason_password_decrypt_failed = 'password_decrypt_failed' reason_mfa_failed = 'mfa_failed' reason_mfa_unset = 'mfa_unset' reason_user_not_exist = 'user_not_exist' @@ -19,6 +20,7 @@ reason_user_inactive = 'user_inactive' reason_choices = { reason_password_failed: _('Username/password check failed'), + reason_password_decrypt_failed: _('Password decrypt failed'), reason_mfa_failed: _('MFA failed'), reason_mfa_unset: _('MFA unset'), reason_user_not_exist: _("Username does not exist"), diff --git a/apps/authentication/forms.py b/apps/authentication/forms.py index d14cde515..84e923a8e 100644 --- a/apps/authentication/forms.py +++ b/apps/authentication/forms.py @@ -10,7 +10,7 @@ class UserLoginForm(forms.Form): username = forms.CharField(label=_('Username'), max_length=100) password = forms.CharField( label=_('Password'), widget=forms.PasswordInput, - max_length=128, strip=False + max_length=1024, strip=False ) def confirm_login_allowed(self, user): diff --git a/apps/authentication/templates/authentication/login.html b/apps/authentication/templates/authentication/login.html index 8812f582b..60b365d9e 100644 --- a/apps/authentication/templates/authentication/login.html +++ b/apps/authentication/templates/authentication/login.html @@ -7,7 +7,7 @@ {% endblock %} {% block content %} -

+ {% csrf_token %} {% if form.non_field_errors %}
@@ -26,7 +26,7 @@ {% endif %}
- + {% if form.errors.password %}

{{ form.errors.password.as_text }}

@@ -36,7 +36,7 @@
{{ form.captcha }}
- + {% if demo_mode %}

@@ -64,4 +64,17 @@ {% endif %}

+ + {% endblock %} diff --git a/apps/authentication/templates/authentication/xpack_login.html b/apps/authentication/templates/authentication/xpack_login.html index 8c1cb24f8..c6a919c60 100644 --- a/apps/authentication/templates/authentication/xpack_login.html +++ b/apps/authentication/templates/authentication/xpack_login.html @@ -98,7 +98,7 @@ {% endif %}
- + {% if form.errors.password %}

{{ form.errors.password.as_text }}

@@ -109,7 +109,7 @@ {{ form.captcha }}
- +
+ + + diff --git a/apps/authentication/utils.py b/apps/authentication/utils.py index 197aa113a..3bc9455d3 100644 --- a/apps/authentication/utils.py +++ b/apps/authentication/utils.py @@ -1,9 +1,39 @@ # -*- coding: utf-8 -*- # +import base64 +from Crypto.PublicKey import RSA +from Crypto.Cipher import PKCS1_v1_5 +from Crypto import Random from django.contrib.auth import authenticate +from common.utils import get_logger + from . import errors +logger = get_logger(__file__) + + +def gen_key_pair(): + """ 生成加密key + 用于登录页面提交用户名/密码时,对密码进行加密(前端)/解密(后端) + """ + random_generator = Random.new().read + rsa = RSA.generate(1024, random_generator) + rsa_private_key = rsa.exportKey().decode() + rsa_public_key = rsa.publickey().exportKey().decode() + return rsa_private_key, rsa_public_key + + +def rsa_decrypt(cipher_text, rsa_private_key=None): + """ 解密登录密码 """ + if rsa_private_key is None: + # rsa_private_key 为 None,可以能是API请求认证,不需要解密 + return cipher_text + key = RSA.importKey(rsa_private_key) + cipher = PKCS1_v1_5.new(key) + message = cipher.decrypt(base64.b64decode(cipher_text.encode()), 'error').decode() + return message + def check_user_valid(**kwargs): password = kwargs.pop('password', None) @@ -11,6 +41,15 @@ def check_user_valid(**kwargs): username = kwargs.pop('username', None) request = kwargs.get('request') + # 获取解密密钥,对密码进行解密 + rsa_private_key = request.session.get('rsa_private_key') + if rsa_private_key is not None: + try: + password = rsa_decrypt(password, rsa_private_key) + except Exception as e: + logger.error(e, exc_info=True) + return None, errors.reason_password_decrypt_failed + user = authenticate(request, username=username, password=password, public_key=public_key) if not user: diff --git a/apps/authentication/views/login.py b/apps/authentication/views/login.py index c67cf2090..7ef72235b 100644 --- a/apps/authentication/views/login.py +++ b/apps/authentication/views/login.py @@ -22,7 +22,7 @@ from common.utils import get_request_ip, get_object_or_none from users.utils import ( redirect_user_first_login_or_index ) -from .. import forms, mixins, errors +from .. import forms, mixins, errors, utils __all__ = [ @@ -108,9 +108,13 @@ class UserLoginView(mixins.AuthMixin, FormView): return self.form_class def get_context_data(self, **kwargs): + # 生成加解密密钥对,public_key传递给前端,private_key存入session中供解密使用 + rsa_private_key, rsa_public_key = utils.gen_key_pair() + self.request.session['rsa_private_key'] = rsa_private_key context = { 'demo_mode': os.environ.get("DEMO_MODE"), 'AUTH_OPENID': settings.AUTH_OPENID, + 'rsa_public_key': rsa_public_key.replace('\n', '\\n') } kwargs.update(context) return super().get_context_data(**kwargs) diff --git a/apps/static/js/plugins/jsencrypt/jsencrypt.min.js b/apps/static/js/plugins/jsencrypt/jsencrypt.min.js new file mode 100644 index 000000000..1bacc3963 --- /dev/null +++ b/apps/static/js/plugins/jsencrypt/jsencrypt.min.js @@ -0,0 +1,73 @@ +/*! JSEncrypt v2.3.1 | https://npmcdn.com/jsencrypt@2.3.1/LICENSE.txt */ +!function(t,e){"function"==typeof define&&define.amd?define(["exports"],e):e("object"==typeof exports&&"string"!=typeof exports.nodeName?module.exports:t)}(this,function(t){function e(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function i(){return new e(null)}function r(t,e,i,r,s,n){for(;--n>=0;){var o=e*this[t++]+i[r]+s;s=Math.floor(o/67108864),i[r++]=67108863&o}return s}function s(t,e,i,r,s,n){for(var o=32767&e,h=e>>15;--n>=0;){var a=32767&this[t],u=this[t++]>>15,c=h*a+u*o;a=o*a+((32767&c)<<15)+i[r]+(1073741823&s),s=(a>>>30)+(c>>>15)+h*u+(s>>>30),i[r++]=1073741823&a}return s}function n(t,e,i,r,s,n){for(var o=16383&e,h=e>>14;--n>=0;){var a=16383&this[t],u=this[t++]>>14,c=h*a+u*o;a=o*a+((16383&c)<<14)+i[r]+s,s=(a>>28)+(c>>14)+h*u,i[r++]=268435455&a}return s}function o(t){return Be.charAt(t)}function h(t,e){var i=Ke[t.charCodeAt(e)];return null==i?-1:i}function a(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function u(t){this.t=1,this.s=0>t?-1:0,t>0?this[0]=t:-1>t?this[0]=t+this.DV:this.t=0}function c(t){var e=i();return e.fromInt(t),e}function f(t,i){var r;if(16==i)r=4;else if(8==i)r=3;else if(256==i)r=8;else if(2==i)r=1;else if(32==i)r=5;else{if(4!=i)return void this.fromRadix(t,i);r=2}this.t=0,this.s=0;for(var s=t.length,n=!1,o=0;--s>=0;){var a=8==r?255&t[s]:h(t,s);0>a?"-"==t.charAt(s)&&(n=!0):(n=!1,0==o?this[this.t++]=a:o+r>this.DB?(this[this.t-1]|=(a&(1<>this.DB-o):this[this.t-1]|=a<=this.DB&&(o-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t}function l(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var i,r=(1<0)for(a>a)>0&&(s=!0,n=o(i));h>=0;)e>a?(i=(this[h]&(1<>(a+=this.DB-e)):(i=this[h]>>(a-=e)&r,0>=a&&(a+=this.DB,--h)),i>0&&(s=!0),s&&(n+=o(i));return s?n:"0"}function d(){var t=i();return e.ZERO.subTo(this,t),t}function g(){return this.s<0?this.negate():this}function m(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(e=i-t.t,0!=e)return this.s<0?-e:e;for(;--i>=0;)if(0!=(e=this[i]-t[i]))return e;return 0}function y(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function b(){return this.t<=0?0:this.DB*(this.t-1)+y(this[this.t-1]^this.s&this.DM)}function T(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s}function S(t,e){for(var i=t;i=0;--i)e[i+o+1]=this[i]>>s|h,h=(this[i]&n)<=0;--i)e[i]=0;e[o]=h,e.t=this.t+o+1,e.s=this.s,e.clamp()}function E(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)return void(e.t=0);var r=t%this.DB,s=this.DB-r,n=(1<>r;for(var o=i+1;o>r;r>0&&(e[this.t-i-1]|=(this.s&n)<i;)r+=this[i]-t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;i>=this.DB;r-=t.s}e.s=0>r?-1:0,-1>r?e[i++]=this.DV+r:r>0&&(e[i++]=r),e.t=i,e.clamp()}function w(t,i){var r=this.abs(),s=t.abs(),n=r.t;for(i.t=n+s.t;--n>=0;)i[n]=0;for(n=0;n=0;)t[i]=0;for(i=0;i=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()}function B(t,r,s){var n=t.abs();if(!(n.t<=0)){var o=this.abs();if(o.t0?(n.lShiftTo(c,h),o.lShiftTo(c,s)):(n.copyTo(h),o.copyTo(s));var f=h.t,p=h[f-1];if(0!=p){var l=p*(1<1?h[f-2]>>this.F2:0),d=this.FV/l,g=(1<=0&&(s[s.t++]=1,s.subTo(T,s)),e.ONE.dlShiftTo(f,T),T.subTo(h,h);h.t=0;){var S=s[--v]==p?this.DM:Math.floor(s[v]*d+(s[v-1]+m)*g);if((s[v]+=h.am(0,S,s,b,0,f))0&&s.rShiftTo(c,s),0>a&&e.ZERO.subTo(s,s)}}}function K(t){var r=i();return this.abs().divRemTo(t,null,r),this.s<0&&r.compareTo(e.ZERO)>0&&t.subTo(r,r),r}function A(t){this.m=t}function U(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function O(t){return t}function V(t){t.divRemTo(this.m,null,t)}function N(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function J(t,e){t.squareTo(e),this.reduce(e)}function I(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function P(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(r,r),r}function L(t){var e=i();return t.copyTo(e),this.reduce(e),e}function q(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(i=e+this.m.t,t[i]+=this.m.am(0,r,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function C(t,e){t.squareTo(e),this.reduce(e)}function H(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function j(){return 0==(this.t>0?1&this[0]:this.s)}function k(t,r){if(t>4294967295||1>t)return e.ONE;var s=i(),n=i(),o=r.convert(this),h=y(t)-1;for(o.copyTo(s);--h>=0;)if(r.sqrTo(s,n),(t&1<0)r.mulTo(n,o,s);else{var a=s;s=n,n=a}return r.revert(s)}function F(t,e){var i;return i=256>t||e.isEven()?new A(e):new P(e),this.exp(t,i)} +// Copyright (c) 2005-2009 Tom Wu +// All Rights Reserved. +// See "LICENSE" for details. +function _(){var t=i();return this.copyTo(t),t}function z(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function G(){return 0==this.t?this.s:this[0]<<16>>16}function $(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function Y(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function W(t){if(null==t&&(t=10),0==this.signum()||2>t||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),s=c(r),n=i(),o=i(),h="";for(this.divRemTo(s,n,o);n.signum()>0;)h=(r+o.intValue()).toString(t).substr(1)+h,n.divRemTo(s,n,o);return o.intValue().toString(t)+h}function Q(t,i){this.fromInt(0),null==i&&(i=10);for(var r=this.chunkSize(i),s=Math.pow(i,r),n=!1,o=0,a=0,u=0;uc?"-"==t.charAt(u)&&0==this.signum()&&(n=!0):(a=i*a+c,++o>=r&&(this.dMultiply(s),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(i,o)),this.dAddOffset(a,0)),n&&e.ZERO.subTo(this,this)}function X(t,i,r){if("number"==typeof i)if(2>t)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),ht,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var s=new Array,n=7&t;s.length=(t>>3)+1,i.nextBytes(s),n>0?s[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[s++]=i|this.s<=0;)8>r?(i=(this[t]&(1<>(r+=this.DB-8)):(i=this[t]>>(r-=8)&255,0>=r&&(r+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==s&&(128&this.s)!=(128&i)&&++s,(s>0||i!=this.s)&&(e[s++]=i);return e}function et(t){return 0==this.compareTo(t)}function it(t){return this.compareTo(t)<0?this:t}function rt(t){return this.compareTo(t)>0?this:t}function st(t,e,i){var r,s,n=Math.min(t.t,this.t);for(r=0;n>r;++r)i[r]=e(this[r],t[r]);if(t.tt?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function gt(t){var e=i();return 0>t?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function mt(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function yt(){for(var t=0;t=this.t?0!=this.s:0!=(this[e]&1<i;)r+=this[i]+t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t>=this.DB;r+=this.s}else{for(r+=this.s;i>=this.DB;r+=t.s}e.s=0>r?-1:0,r>0?e[i++]=r:-1>r&&(e[i++]=this.DV+r),e.t=i,e.clamp()}function xt(t){var e=i();return this.addTo(t,e),e}function Bt(t){var e=i();return this.subTo(t,e),e}function Kt(t){var e=i();return this.multiplyTo(t,e),e}function At(){var t=i();return this.squareTo(t),t}function Ut(t){var e=i();return this.divRemTo(t,e,null),e}function Ot(t){var e=i();return this.divRemTo(t,null,e),e}function Vt(t){var e=i(),r=i();return this.divRemTo(t,e,r),new Array(e,r)}function Nt(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Jt(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function It(){}function Pt(t){return t}function Mt(t,e,i){t.multiplyTo(e,i)}function Lt(t,e){t.squareTo(e)}function qt(t){return this.exp(t,new It)}function Ct(t,e,i){var r=Math.min(this.t+t.t,e);for(i.s=0,i.t=r;r>0;)i[--r]=0;var s;for(s=i.t-this.t;s>r;++r)i[r+this.t]=this.am(0,t[r],i,r,0,this.t);for(s=Math.min(t.t,e);s>r;++r)this.am(0,t[r],i,r,0,e-r);i.clamp()}function Ht(t,e,i){--e;var r=i.t=this.t+t.t-e;for(i.s=0;--r>=0;)i[r]=0;for(r=Math.max(e-this.t,0);r2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=i();return t.copyTo(e),this.reduce(e),e}function Ft(t){return t}function _t(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function zt(t,e){t.squareTo(e),this.reduce(e)}function Zt(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function Gt(t,e){var r,s,n=t.bitLength(),o=c(1);if(0>=n)return o;r=18>n?1:48>n?3:144>n?4:768>n?5:6,s=8>n?new A(e):e.isEven()?new jt(e):new P(e);var h=new Array,a=3,u=r-1,f=(1<1){var p=i();for(s.sqrTo(h[1],p);f>=a;)h[a]=i(),s.mulTo(p,h[a-2],h[a]),a+=2}var l,d,g=t.t-1,m=!0,v=i();for(n=y(t[g])-1;g>=0;){for(n>=u?l=t[g]>>n-u&f:(l=(t[g]&(1<0&&(l|=t[g-1]>>this.DB+n-u)),a=r;0==(1&l);)l>>=1,--a;if((n-=a)<0&&(n+=this.DB,--g),m)h[l].copyTo(o),m=!1;else{for(;a>1;)s.sqrTo(o,v),s.sqrTo(v,o),a-=2;a>0?s.sqrTo(o,v):(d=o,o=v,v=d),s.mulTo(v,h[l],o)}for(;g>=0&&0==(t[g]&1<n)return e;for(n>s&&(n=s),n>0&&(e.rShiftTo(n,e),i.rShiftTo(n,i));e.signum()>0;)(s=e.getLowestSetBit())>0&&e.rShiftTo(s,e),(s=i.getLowestSetBit())>0&&i.rShiftTo(s,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return n>0&&i.lShiftTo(n,i),i}function Yt(t){if(0>=t)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(0==e)i=this[0]%t;else for(var r=this.t-1;r>=0;--r)i=(e*i+this[r])%t;return i}function Wt(t){var i=t.isEven();if(this.isEven()&&i||0==t.signum())return e.ZERO;for(var r=t.clone(),s=this.clone(),n=c(1),o=c(0),h=c(0),a=c(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),i?(n.isEven()&&o.isEven()||(n.addTo(this,n),o.subTo(t,o)),n.rShiftTo(1,n)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;s.isEven();)s.rShiftTo(1,s),i?(h.isEven()&&a.isEven()||(h.addTo(this,h),a.subTo(t,a)),h.rShiftTo(1,h)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);r.compareTo(s)>=0?(r.subTo(s,r),i&&n.subTo(h,n),o.subTo(a,o)):(s.subTo(r,s),i&&h.subTo(n,h),a.subTo(o,a))}return 0!=s.compareTo(e.ONE)?e.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a}function Qt(t){var e,i=this.abs();if(1==i.t&&i[0]<=Ae[Ae.length-1]){for(e=0;er;)r*=Ae[s++];for(r=i.modInt(r);s>e;)if(r%Ae[e++]==0)return!1}return i.millerRabin(t)}function Xt(t){var r=this.subtract(e.ONE),s=r.getLowestSetBit();if(0>=s)return!1;var n=r.shiftRight(s);t=t+1>>1,t>Ae.length&&(t=Ae.length);for(var o=i(),h=0;t>h;++h){o.fromInt(Ae[Math.floor(Math.random()*Ae.length)]);var a=o.modPow(n,this);if(0!=a.compareTo(e.ONE)&&0!=a.compareTo(r)){for(var u=1;u++e;++e)this.S[e]=e;for(i=0,e=0;256>e;++e)i=i+this.S[e]+t[e%t.length]&255,r=this.S[e],this.S[e]=this.S[i],this.S[i]=r;this.i=0,this.j=0}function ie(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]}function re(){return new te}function se(){if(null==Oe){for(Oe=re();Je>Ne;){var t=Math.floor(65536*Math.random());Ve[Ne++]=255&t}for(Oe.init(Ve),Ne=0;Ne=0&&i>0;){var n=t.charCodeAt(s--);128>n?r[--i]=n:n>127&&2048>n?(r[--i]=63&n|128,r[--i]=n>>6|192):(r[--i]=63&n|128,r[--i]=n>>6&63|128,r[--i]=n>>12|224)}r[--i]=0;for(var o=new oe,h=new Array;i>2;){for(h[0]=0;0==h[0];)o.nextBytes(h);r[--i]=h[0]}return r[--i]=2,r[--i]=0,new e(r)}function ue(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function ce(t,e){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=he(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")}function fe(t){return t.modPowInt(this.e,this.n)}function pe(t){var e=ae(t,this.n.bitLength()+7>>3);if(null==e)return null;var i=this.doPublic(e);if(null==i)return null;var r=i.toString(16);return 0==(1&r.length)?r:"0"+r}function le(t,e){for(var i=t.toByteArray(),r=0;r=i.length)return null;for(var s="";++rn?s+=String.fromCharCode(n):n>191&&224>n?(s+=String.fromCharCode((31&n)<<6|63&i[r+1]),++r):(s+=String.fromCharCode((15&n)<<12|(63&i[r+1])<<6|63&i[r+2]),r+=2)}return s}function de(t,e,i){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=he(t,16),this.e=parseInt(e,16),this.d=he(i,16)):console.error("Invalid RSA private key")}function ge(t,e,i,r,s,n,o,h){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=he(t,16),this.e=parseInt(e,16),this.d=he(i,16),this.p=he(r,16),this.q=he(s,16),this.dmp1=he(n,16),this.dmq1=he(o,16),this.coeff=he(h,16)):console.error("Invalid RSA private key")}function me(t,i){var r=new oe,s=t>>1;this.e=parseInt(i,16);for(var n=new e(i,16);;){for(;this.p=new e(t-s,1,r),0!=this.p.subtract(e.ONE).gcd(n).compareTo(e.ONE)||!this.p.isProbablePrime(10););for(;this.q=new e(s,1,r),0!=this.q.subtract(e.ONE).gcd(n).compareTo(e.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var h=this.p.subtract(e.ONE),a=this.q.subtract(e.ONE),u=h.multiply(a);if(0==u.gcd(n).compareTo(e.ONE)){this.n=this.p.multiply(this.q),this.d=n.modInverse(u),this.dmp1=this.d.mod(h),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);break}}}function ye(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),i=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(i)<0;)e=e.add(this.p);return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)}function ve(t){var e=he(t,16),i=this.doPrivate(e);return null==i?null:le(i,this.n.bitLength()+7>>3)}function be(t){var e,i,r="";for(e=0;e+3<=t.length;e+=3)i=parseInt(t.substring(e,e+3),16),r+=Le.charAt(i>>6)+Le.charAt(63&i);for(e+1==t.length?(i=parseInt(t.substring(e,e+1),16),r+=Le.charAt(i<<2)):e+2==t.length&&(i=parseInt(t.substring(e,e+2),16),r+=Le.charAt(i>>2)+Le.charAt((3&i)<<4));(3&r.length)>0;)r+=qe;return r}function Te(t){var e,i,r="",s=0;for(e=0;e>2),i=3&v,s=1):1==s?(r+=o(i<<2|v>>4),i=15&v,s=2):2==s?(r+=o(i),r+=o(v>>2),i=3&v,s=3):(r+=o(i<<2|v>>4),r+=o(15&v),s=0));return 1==s&&(r+=o(i<<2)),r} +// Copyright (c) 2005 Tom Wu +// All Rights Reserved. +// See "LICENSE" for details. +var Se,Re=0xdeadbeefcafe,Ee=15715070==(16777215&Re);Ee&&"Microsoft Internet Explorer"==navigator.appName?(e.prototype.am=s,Se=30):Ee&&"Netscape"!=navigator.appName?(e.prototype.am=r,Se=26):(e.prototype.am=n,Se=28),e.prototype.DB=Se,e.prototype.DM=(1<=xe;++xe)Ke[we++]=xe;for(we="a".charCodeAt(0),xe=10;36>xe;++xe)Ke[we++]=xe;for(we="A".charCodeAt(0),xe=10;36>xe;++xe)Ke[we++]=xe;A.prototype.convert=U,A.prototype.revert=O,A.prototype.reduce=V,A.prototype.mulTo=N,A.prototype.sqrTo=J,P.prototype.convert=M,P.prototype.revert=L,P.prototype.reduce=q,P.prototype.mulTo=H,P.prototype.sqrTo=C,e.prototype.copyTo=a,e.prototype.fromInt=u,e.prototype.fromString=f,e.prototype.clamp=p,e.prototype.dlShiftTo=T,e.prototype.drShiftTo=S,e.prototype.lShiftTo=R,e.prototype.rShiftTo=E,e.prototype.subTo=D,e.prototype.multiplyTo=w,e.prototype.squareTo=x,e.prototype.divRemTo=B,e.prototype.invDigit=I,e.prototype.isEven=j,e.prototype.exp=k,e.prototype.toString=l,e.prototype.negate=d,e.prototype.abs=g,e.prototype.compareTo=m,e.prototype.bitLength=b,e.prototype.mod=K,e.prototype.modPowInt=F,e.ZERO=c(0),e.ONE=c(1),It.prototype.convert=Pt,It.prototype.revert=Pt,It.prototype.mulTo=Mt,It.prototype.sqrTo=Lt,jt.prototype.convert=kt,jt.prototype.revert=Ft,jt.prototype.reduce=_t,jt.prototype.mulTo=Zt,jt.prototype.sqrTo=zt;var Ae=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Ue=(1<<26)/Ae[Ae.length-1];e.prototype.chunkSize=$,e.prototype.toRadix=W,e.prototype.fromRadix=Q,e.prototype.fromNumber=X,e.prototype.bitwiseTo=st,e.prototype.changeBit=St,e.prototype.addTo=wt,e.prototype.dMultiply=Nt,e.prototype.dAddOffset=Jt,e.prototype.multiplyLowerTo=Ct,e.prototype.multiplyUpperTo=Ht,e.prototype.modInt=Yt,e.prototype.millerRabin=Xt,e.prototype.clone=_,e.prototype.intValue=z,e.prototype.byteValue=Z,e.prototype.shortValue=G,e.prototype.signum=Y,e.prototype.toByteArray=tt,e.prototype.equals=et,e.prototype.min=it,e.prototype.max=rt,e.prototype.and=ot,e.prototype.or=at,e.prototype.xor=ct,e.prototype.andNot=pt,e.prototype.not=lt,e.prototype.shiftLeft=dt,e.prototype.shiftRight=gt,e.prototype.getLowestSetBit=yt,e.prototype.bitCount=bt,e.prototype.testBit=Tt,e.prototype.setBit=Rt,e.prototype.clearBit=Et,e.prototype.flipBit=Dt,e.prototype.add=xt,e.prototype.subtract=Bt,e.prototype.multiply=Kt,e.prototype.divide=Ut,e.prototype.remainder=Ot,e.prototype.divideAndRemainder=Vt,e.prototype.modPow=Gt,e.prototype.modInverse=Wt,e.prototype.pow=qt,e.prototype.gcd=$t,e.prototype.isProbablePrime=Qt,e.prototype.square=At,te.prototype.init=ee,te.prototype.next=ie;var Oe,Ve,Ne,Je=256;if(null==Ve){Ve=new Array,Ne=0;var Ie;if(window.crypto&&window.crypto.getRandomValues){var Pe=new Uint32Array(256);for(window.crypto.getRandomValues(Pe),Ie=0;Ie=256||Ne>=Je)return void(window.removeEventListener?window.removeEventListener("mousemove",Me,!1):window.detachEvent&&window.detachEvent("onmousemove",Me));try{var e=t.x+t.y;Ve[Ne++]=255&e,this.count+=1}catch(i){}};window.addEventListener?window.addEventListener("mousemove",Me,!1):window.attachEvent&&window.attachEvent("onmousemove",Me)}oe.prototype.nextBytes=ne,ue.prototype.doPublic=fe,ue.prototype.setPublic=ce,ue.prototype.encrypt=pe,ue.prototype.doPrivate=ye,ue.prototype.setPrivate=de,ue.prototype.setPrivateEx=ge,ue.prototype.generate=me,ue.prototype.decrypt=ve, +// Copyright (c) 2011 Kevin M Burns Jr. +// All Rights Reserved. +// See "LICENSE" for details. +// +// Extension to jsbn which adds facilities for asynchronous RSA key generation +// Primarily created to avoid execution timeout on mobile devices +// +// http://www-cs-students.stanford.edu/~tjw/jsbn/ +// +// --- +function(){var t=function(t,r,s){var n=new oe,o=t>>1;this.e=parseInt(r,16);var h=new e(r,16),a=this,u=function(){var r=function(){if(a.p.compareTo(a.q)<=0){var t=a.p;a.p=a.q,a.q=t}var i=a.p.subtract(e.ONE),r=a.q.subtract(e.ONE),n=i.multiply(r);0==n.gcd(h).compareTo(e.ONE)?(a.n=a.p.multiply(a.q),a.d=h.modInverse(n),a.dmp1=a.d.mod(i),a.dmq1=a.d.mod(r),a.coeff=a.q.modInverse(a.p),setTimeout(function(){s()},0)):setTimeout(u,0)},c=function(){a.q=i(),a.q.fromNumberAsync(o,1,n,function(){a.q.subtract(e.ONE).gcda(h,function(t){0==t.compareTo(e.ONE)&&a.q.isProbablePrime(10)?setTimeout(r,0):setTimeout(c,0)})})},f=function(){a.p=i(),a.p.fromNumberAsync(t-o,1,n,function(){a.p.subtract(e.ONE).gcda(h,function(t){0==t.compareTo(e.ONE)&&a.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(f,0)})})};setTimeout(f,0)};setTimeout(u,0)};ue.prototype.generateAsync=t;var r=function(t,e){var i=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(i.compareTo(r)<0){var s=i;i=r,r=s}var n=i.getLowestSetBit(),o=r.getLowestSetBit();if(0>o)return void e(i);o>n&&(o=n),o>0&&(i.rShiftTo(o,i),r.rShiftTo(o,r));var h=function(){(n=i.getLowestSetBit())>0&&i.rShiftTo(n,i),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),i.compareTo(r)>=0?(i.subTo(r,i),i.rShiftTo(1,i)):(r.subTo(i,r),r.rShiftTo(1,r)),i.signum()>0?setTimeout(h,0):(o>0&&r.lShiftTo(o,r),setTimeout(function(){e(r)},0))};setTimeout(h,10)};e.prototype.gcda=r;var s=function(t,i,r,s){if("number"==typeof i)if(2>t)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),ht,this),this.isEven()&&this.dAddOffset(1,0);var n=this,o=function(){n.dAddOffset(2,0),n.bitLength()>t&&n.subTo(e.ONE.shiftLeft(t-1),n),n.isProbablePrime(i)?setTimeout(function(){s()},0):setTimeout(o,0)};setTimeout(o,0)}else{var h=new Array,a=7&t;h.length=(t>>3)+1,i.nextBytes(h),a>0?h[0]&=(1<MIT License + */ +"undefined"!=typeof KJUR&&KJUR||(KJUR={}),"undefined"!=typeof KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var i=t.toString(16);if("-"!=i.substr(0,1))i.length%2==1?i="0"+i:i.match(/^[0-7]/)||(i="00"+i);else{var r=i.substr(1),s=r.length;s%2==1?s+=1:i.match(/^[0-7]/)||(s+=2);for(var n="",o=0;s>o;o++)n+="f";var h=new e(n,16),a=h.xor(t).add(e.ONE);i=a.toString(16).replace(/^-/,"")}return i},this.getPEMStringFromHex=function(t,e){var i=CryptoJS.enc.Hex.parse(t),r=CryptoJS.enc.Base64.stringify(i),s=r.replace(/(.{64})/g,"$1\r\n");return s=s.replace(/\r\n$/,""),"-----BEGIN "+e+"-----\r\n"+s+"\r\n-----END "+e+"-----\r\n"}},KJUR.asn1.ASN1Object=function(){var t="";this.getLengthHexFromValue=function(){if("undefined"==typeof this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+t.length+",v="+this.hV;var e=this.hV.length/2,i=e.toString(16);if(i.length%2==1&&(i="0"+i),128>e)return i;var r=i.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);var s=128+r;return s.toString(16)+i},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},KJUR.asn1.DERAbstractString=function(t){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("undefined"!=typeof t.str?this.setString(t.str):"undefined"!=typeof t.hex&&this.setStringHex(t.hex))},Ce.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractTime=function(t){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(t){utc=t.getTime()+6e4*t.getTimezoneOffset();var e=new Date(utc);return e},this.formatDate=function(t,e){var i=this.zeroPadding,r=this.localDateToUTC(t),s=String(r.getFullYear());"utc"==e&&(s=s.substr(2,2));var n=i(String(r.getMonth()+1),2),o=i(String(r.getDate()),2),h=i(String(r.getHours()),2),a=i(String(r.getMinutes()),2),u=i(String(r.getSeconds()),2);return s+n+o+h+a+u+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setByDateValue=function(t,e,i,r,s,n){var o=new Date(Date.UTC(t,e-1,i,r,s,n,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},Ce.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractStructured=function(t){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,"undefined"!=typeof t&&"undefined"!=typeof t.array&&(this.asn1Array=t.array)},Ce.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object),KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},Ce.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object),KJUR.asn1.DERInteger=function(t){KJUR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var i=new e(String(t),10);this.setByBigInteger(i)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("undefined"!=typeof t.bigint?this.setByBigInteger(t.bigint):"undefined"!=typeof t["int"]?this.setByInteger(t["int"]):"undefined"!=typeof t.hex&&this.setValueHex(t.hex))},Ce.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object),KJUR.asn1.DERBitString=function(t){KJUR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(0>t||t>7)throw"unused bits shall be from 0 to 7: u = "+t;var i="0"+t;this.hTLV=null,this.isModified=!0,this.hV=i+e},this.setByBinaryString=function(t){t=t.replace(/0+$/,"");var e=8-t.length%8;8==e&&(e=0);for(var i=0;e>=i;i++)t+="0";for(var r="",i=0;ii;i++)e[i]=!1;return e},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof t&&("undefined"!=typeof t.hex?this.setHexValueIncludingUnusedBits(t.hex):"undefined"!=typeof t.bin?this.setByBinaryString(t.bin):"undefined"!=typeof t.array&&this.setByBooleanArray(t.array))},Ce.extend(KJUR.asn1.DERBitString,KJUR.asn1.ASN1Object),KJUR.asn1.DEROctetString=function(t){KJUR.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},Ce.extend(KJUR.asn1.DEROctetString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNull=function(){KJUR.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},Ce.extend(KJUR.asn1.DERNull,KJUR.asn1.ASN1Object),KJUR.asn1.DERObjectIdentifier=function(t){var i=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},r=function(t){var r="",s=new e(t,10),n=s.toString(2),o=7-n.length%7;7==o&&(o=0);for(var h="",a=0;o>a;a++)h+="0";n=h+n;for(var a=0;a +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +function(t){"use strict";var e,i={};i.decode=function(i){var r;if(e===t){var s="0123456789ABCDEF",n=" \f\n\r \u2028\u2029";for(e=[],r=0;16>r;++r)e[s.charAt(r)]=r;for(s=s.toLowerCase(),r=10;16>r;++r)e[s.charAt(r)]=r;for(r=0;r=2?(o[o.length]=h,h=0,a=0):h<<=4}}if(a)throw"Hex encoding incomplete: 4 bits missing";return o},window.Hex=i}(), +// Copyright (c) 2008-2013 Lapo Luchini +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +function(t){"use strict";var e,i={};i.decode=function(i){var r;if(e===t){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="= \f\n\r \u2028\u2029";for(e=[],r=0;64>r;++r)e[s.charAt(r)]=r;for(r=0;r=4?(o[o.length]=h>>16,o[o.length]=h>>8&255,o[o.length]=255&h,h=0,a=0):h<<=6}}switch(a){case 1:throw"Base64 encoding incomplete: at least 2 bits missing";case 2:o[o.length]=h>>10;break;case 3:o[o.length]=h>>16,o[o.length]=h>>8&255}return o},i.re=/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,i.unarmor=function(t){var e=i.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw"RegExp out of sync";t=e[2]}return i.decode(t)},window.Base64=i}(), +// Copyright (c) 2008-2013 Lapo Luchini +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +function(t){"use strict";function e(t,i){t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=i)}function i(t,e,i,r,s){this.stream=t,this.header=e,this.length=i,this.tag=r,this.sub=s}var r=100,s="…",n={tag:function(t,e){var i=document.createElement(t);return i.className=e,i},text:function(t){return document.createTextNode(t)}};e.prototype.get=function(e){if(e===t&&(e=this.pos++),e>=this.enc.length)throw"Requesting byte offset "+e+" on a stream of length "+this.enc.length;return this.enc[e]},e.prototype.hexDigits="0123456789ABCDEF",e.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},e.prototype.hexDump=function(t,e,i){for(var r="",s=t;e>s;++s)if(r+=this.hexByte(this.get(s)),i!==!0)switch(15&s){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r},e.prototype.parseStringISO=function(t,e){for(var i="",r=t;e>r;++r)i+=String.fromCharCode(this.get(r));return i},e.prototype.parseStringUTF=function(t,e){for(var i="",r=t;e>r;){var s=this.get(r++);i+=128>s?String.fromCharCode(s):s>191&&224>s?String.fromCharCode((31&s)<<6|63&this.get(r++)):String.fromCharCode((15&s)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return i},e.prototype.parseStringBMP=function(t,e){for(var i="",r=t;e>r;r+=2){var s=this.get(r),n=this.get(r+1);i+=String.fromCharCode((s<<8)+n)}return i},e.prototype.reTime=/^((?:1[89]|2\d)?\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,e.prototype.parseTime=function(t,e){var i=this.parseStringISO(t,e),r=this.reTime.exec(i);return r?(i=r[1]+"-"+r[2]+"-"+r[3]+" "+r[4],r[5]&&(i+=":"+r[5],r[6]&&(i+=":"+r[6],r[7]&&(i+="."+r[7]))),r[8]&&(i+=" UTC","Z"!=r[8]&&(i+=r[8],r[9]&&(i+=":"+r[9]))),i):"Unrecognized time: "+i},e.prototype.parseInteger=function(t,e){var i=e-t;if(i>4){i<<=3;var r=this.get(t);if(0===r)i-=8;else for(;128>r;)r<<=1,--i;return"("+i+" bit)"}for(var s=0,n=t;e>n;++n)s=s<<8|this.get(n);return s},e.prototype.parseBitString=function(t,e){var i=this.get(t),r=(e-t-1<<3)-i,s="("+r+" bit)";if(20>=r){var n=i;s+=" ";for(var o=e-1;o>t;--o){for(var h=this.get(o),a=n;8>a;++a)s+=h>>a&1?"1":"0";n=0}}return s},e.prototype.parseOctetString=function(t,e){var i=e-t,n="("+i+" byte) ";i>r&&(e=t+r);for(var o=t;e>o;++o)n+=this.hexByte(this.get(o));return i>r&&(n+=s),n},e.prototype.parseOID=function(t,e){for(var i="",r=0,s=0,n=t;e>n;++n){var o=this.get(n);if(r=r<<7|127&o,s+=7,!(128&o)){if(""===i){var h=80>r?40>r?0:1:2;i=h+"."+(r-40*h)}else i+="."+(s>=31?"bigint":r);r=s=0}}return i},i.prototype.typeName=function(){if(this.tag===t)return"unknown";var e=this.tag>>6,i=(this.tag>>5&1,31&this.tag);switch(e){case 0:switch(i){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString";default:return"Universal_"+i.toString(16)}case 1:return"Application_"+i.toString(16);case 2:return"["+i+"]";case 3:return"Private_"+i.toString(16)}},i.prototype.reSeemsASCII=/^[ -~]+$/,i.prototype.content=function(){if(this.tag===t)return null;var e=this.tag>>6,i=31&this.tag,n=this.posContent(),o=Math.abs(this.length);if(0!==e){if(null!==this.sub)return"("+this.sub.length+" elem)";var h=this.stream.parseStringISO(n,n+Math.min(o,r));return this.reSeemsASCII.test(h)?h.substring(0,2*r)+(h.length>2*r?s:""):this.stream.parseOctetString(n,n+o)}switch(i){case 1:return 0===this.stream.get(n)?"false":"true";case 2:return this.stream.parseInteger(n,n+o);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(n,n+o);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(n,n+o);case 6:return this.stream.parseOID(n,n+o);case 16:case 17:return"("+this.sub.length+" elem)";case 12:return this.stream.parseStringUTF(n,n+o);case 18:case 19:case 20:case 21:case 22:case 26:return this.stream.parseStringISO(n,n+o);case 30:return this.stream.parseStringBMP(n,n+o);case 23:case 24:return this.stream.parseTime(n,n+o)}return null},i.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},i.prototype.print=function(e){if(e===t&&(e=""),document.writeln(e+this),null!==this.sub){e+=" ";for(var i=0,r=this.sub.length;r>i;++i)this.sub[i].print(e)}},i.prototype.toPrettyString=function(e){e===t&&(e="");var i=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(i+="+"),i+=this.length,32&this.tag?i+=" (constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(i+=" (encapsulates)"),i+="\n",null!==this.sub){e+=" ";for(var r=0,s=this.sub.length;s>r;++r)i+=this.sub[r].toPrettyString(e)}return i},i.prototype.toDOM=function(){var t=n.tag("div","node");t.asn1=this;var e=n.tag("div","head"),i=this.typeName().replace(/_/g," ");e.innerHTML=i;var r=this.content();if(null!==r){r=String(r).replace(/",i+="Length: "+this.header+"+",i+=this.length>=0?this.length:-this.length+" (undefined)",32&this.tag?i+="
(constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(i+="
(encapsulates)"),null!==r&&(i+="
Value:
"+r+"","object"==typeof oids&&6==this.tag)){var h=oids[r];h&&(h.d&&(i+="
"+h.d),h.c&&(i+="
"+h.c),h.w&&(i+="
(warning!)"))}o.innerHTML=i,t.appendChild(o);var a=n.tag("div","sub");if(null!==this.sub)for(var u=0,c=this.sub.length;c>u;++u)a.appendChild(this.sub[u].toDOM());return t.appendChild(a),e.onclick=function(){t.className="node collapsed"==t.className?"node":"node collapsed"},t},i.prototype.posStart=function(){return this.stream.pos},i.prototype.posContent=function(){return this.stream.pos+this.header},i.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},i.prototype.fakeHover=function(t){this.node.className+=" hover",t&&(this.head.className+=" hover")},i.prototype.fakeOut=function(t){var e=/ ?hover/;this.node.className=this.node.className.replace(e,""),t&&(this.head.className=this.head.className.replace(e,""))},i.prototype.toHexDOM_sub=function(t,e,i,r,s){if(!(r>=s)){var o=n.tag("span",e);o.appendChild(n.text(i.hexDump(r,s))),t.appendChild(o)}},i.prototype.toHexDOM=function(e){var i=n.tag("span","hex");if(e===t&&(e=i),this.head.hexNode=i,this.head.onmouseover=function(){this.hexNode.className="hexCurrent"},this.head.onmouseout=function(){this.hexNode.className="hex"},i.asn1=this,i.onmouseover=function(){var t=!e.selected;t&&(e.selected=this.asn1,this.className="hexCurrent"),this.asn1.fakeHover(t)},i.onmouseout=function(){var t=e.selected==this.asn1;this.asn1.fakeOut(t),t&&(e.selected=null,this.className="hex")},this.toHexDOM_sub(i,"tag",this.stream,this.posStart(),this.posStart()+1),this.toHexDOM_sub(i,this.length>=0?"dlen":"ulen",this.stream,this.posStart()+1,this.posContent()),null===this.sub)i.appendChild(n.text(this.stream.hexDump(this.posContent(),this.posEnd())));else if(this.sub.length>0){var r=this.sub[0],s=this.sub[this.sub.length-1];this.toHexDOM_sub(i,"intro",this.stream,this.posContent(),r.posStart());for(var o=0,h=this.sub.length;h>o;++o)i.appendChild(this.sub[o].toHexDOM(e));this.toHexDOM_sub(i,"outro",this.stream,s.posEnd(),this.posEnd())}return i},i.prototype.toHexString=function(t){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},i.decodeLength=function(t){var e=t.get(),i=127&e;if(i==e)return i;if(i>3)throw"Length over 24 bits not supported at position "+(t.pos-1);if(0===i)return-1;e=0;for(var r=0;i>r;++r)e=e<<8|t.get();return e},i.hasContent=function(t,r,s){if(32&t)return!0;if(3>t||t>4)return!1;var n=new e(s);3==t&&n.get();var o=n.get();if(o>>6&1)return!1;try{var h=i.decodeLength(n);return n.pos-s.pos+h==r}catch(a){return!1}},i.decode=function(t){t instanceof e||(t=new e(t,0));var r=new e(t),s=t.get(),n=i.decodeLength(t),o=t.pos-r.pos,h=null;if(i.hasContent(s,n,t)){var a=t.pos;if(3==s&&t.get(),h=[],n>=0){for(var u=a+n;t.posr;++r){var n=new e(t[r].value,0),o=i.decodeLength(n);o!=t[r].expected&&document.write("In test["+r+"] expected "+t[r].expected+" got "+o+"\n")}},window.ASN1=i}(),ASN1.prototype.getHexStringValue=function(){var t=this.toHexString(),e=2*this.header,i=2*this.length;return t.substr(e,i)},ue.prototype.parseKey=function(t){try{var e=0,i=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,s=r.test(t)?Hex.decode(t):Base64.unarmor(t),n=ASN1.decode(s);if(3===n.sub.length&&(n=n.sub[2].sub[0]),9===n.sub.length){e=n.sub[1].getHexStringValue(),this.n=he(e,16),i=n.sub[2].getHexStringValue(),this.e=parseInt(i,16);var o=n.sub[3].getHexStringValue();this.d=he(o,16);var h=n.sub[4].getHexStringValue();this.p=he(h,16);var a=n.sub[5].getHexStringValue();this.q=he(a,16);var u=n.sub[6].getHexStringValue();this.dmp1=he(u,16);var c=n.sub[7].getHexStringValue();this.dmq1=he(c,16);var f=n.sub[8].getHexStringValue();this.coeff=he(f,16)}else{if(2!==n.sub.length)return!1;var p=n.sub[1],l=p.sub[0];e=l.sub[0].getHexStringValue(),this.n=he(e,16),i=l.sub[1].getHexStringValue(),this.e=parseInt(i,16)}return!0}catch(d){return!1}},ue.prototype.getPrivateBaseKey=function(){var t={array:[new KJUR.asn1.DERInteger({"int":0}),new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({"int":this.e}),new KJUR.asn1.DERInteger({bigint:this.d}),new KJUR.asn1.DERInteger({bigint:this.p}),new KJUR.asn1.DERInteger({bigint:this.q}),new KJUR.asn1.DERInteger({bigint:this.dmp1}),new KJUR.asn1.DERInteger({bigint:this.dmq1}),new KJUR.asn1.DERInteger({bigint:this.coeff})]},e=new KJUR.asn1.DERSequence(t);return e.getEncodedHex()},ue.prototype.getPrivateBaseKeyB64=function(){return be(this.getPrivateBaseKey())},ue.prototype.getPublicBaseKey=function(){var t={array:[new KJUR.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new KJUR.asn1.DERNull]},e=new KJUR.asn1.DERSequence(t);t={array:[new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({"int":this.e})]};var i=new KJUR.asn1.DERSequence(t);t={hex:"00"+i.getEncodedHex()};var r=new KJUR.asn1.DERBitString(t);t={array:[e,r]};var s=new KJUR.asn1.DERSequence(t);return s.getEncodedHex()},ue.prototype.getPublicBaseKeyB64=function(){return be(this.getPublicBaseKey())},ue.prototype.wordwrap=function(t,e){if(e=e||64,!t)return t;var i="(.{1,"+e+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(i,"g")).join("\n")},ue.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";return t+=this.wordwrap(this.getPrivateBaseKeyB64())+"\n",t+="-----END RSA PRIVATE KEY-----"},ue.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";return t+=this.wordwrap(this.getPublicBaseKeyB64())+"\n",t+="-----END PUBLIC KEY-----"},ue.prototype.hasPublicKeyProperty=function(t){return t=t||{},t.hasOwnProperty("n")&&t.hasOwnProperty("e")},ue.prototype.hasPrivateKeyProperty=function(t){return t=t||{},t.hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")},ue.prototype.parsePropertiesFrom=function(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)};var _e=function(t){ue.call(this),t&&("string"==typeof t?this.parseKey(t):(this.hasPrivateKeyProperty(t)||this.hasPublicKeyProperty(t))&&this.parsePropertiesFrom(t))};_e.prototype=new ue,_e.prototype.constructor=_e;var ze=function(t){t=t||{},this.default_key_size=parseInt(t.default_key_size)||1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null};ze.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new _e(t)},ze.prototype.setPrivateKey=function(t){this.setKey(t)},ze.prototype.setPublicKey=function(t){this.setKey(t)},ze.prototype.decrypt=function(t){try{return this.getKey().decrypt(Te(t))}catch(e){return!1}},ze.prototype.encrypt=function(t){try{return be(this.getKey().encrypt(t))}catch(e){return!1}},ze.prototype.getKey=function(t){if(!this.key){if(this.key=new _e,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},ze.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},ze.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},ze.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},ze.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},ze.version="2.3.1",t.JSEncrypt=ze}); \ No newline at end of file From e17d875206c699a187c2f235c634ad3b6ed4bf20 Mon Sep 17 00:00:00 2001 From: Bai Date: Tue, 30 Jun 2020 17:23:56 +0800 Subject: [PATCH 05/19] =?UTF-8?q?feat(login=20password=20ecrypt):=20?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=AF=86=E7=A0=81=E5=8A=A0=E5=AF=86=E4=BC=A0?= =?UTF-8?q?=E8=BE=932?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/authentication/utils.py b/apps/authentication/utils.py index 3bc9455d3..9d1c45d98 100644 --- a/apps/authentication/utils.py +++ b/apps/authentication/utils.py @@ -48,6 +48,7 @@ def check_user_valid(**kwargs): password = rsa_decrypt(password, rsa_private_key) except Exception as e: logger.error(e, exc_info=True) + logger.error('Need decrypt password => {}'.format(password)) return None, errors.reason_password_decrypt_failed user = authenticate(request, username=username, From 98c91d0f18e94fbe4a5878aab60e84b390317ee9 Mon Sep 17 00:00:00 2001 From: Bai Date: Tue, 30 Jun 2020 17:37:16 +0800 Subject: [PATCH 06/19] =?UTF-8?q?feat(login=20password=20ecrypt):=20?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=AF=86=E7=A0=81=E5=8A=A0=E5=AF=86=E4=BC=A0?= =?UTF-8?q?=E8=BE=93=EF=BC=88=E6=B7=BB=E5=8A=A0=E7=BF=BB=E8=AF=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/locale/zh/LC_MESSAGES/django.mo | Bin 54229 -> 54288 bytes apps/locale/zh/LC_MESSAGES/django.po | 124 ++++++++++++++------------- 2 files changed, 64 insertions(+), 60 deletions(-) diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index 5854d565a426a859fd8fe87c2371a501f84f01cc..da2448bb46c2ecabdf14b57420014c77304da192 100644 GIT binary patch delta 15157 zcmYk@2Y60rAII^Nh!H|0K}2L24G|=656e<0RE|oYt6(lkr0wjuEvSrzO{Xf+vWtz34ct{2XUzZO8e5xKJI( z8I6nZ493-UoI|wx*K?eFTz8~C#c^EcQbWhdPlpXJJ5Dw{h`I4N=E93u0Iy>a3`qBk z!x-ZF7=XPn8T(=xoQvvz2;=b|jK+vYj#CP&U|HsOx>9+8#K(9Fzrk}jwXx#_D#jk&Qr24fm> zSDdD(fqEl%$axEM;BeISV=*s&h+4pG)WX-8TTtWf!#F&Fu8!sjmHrsl)Nv}~G*rhQ zQ4{@&CGi55z`$mXlNFP(ELO%4?15U)Q1e~X$$WrX_%zf)7ocw4ie{X@j^Y3bO?V!4 zFR!B}xNZ3dsDZLI=aeuMwX@1t24BQL9Dtf=II7=7%!^;5PIjy1_n;Pfr8(!XhwnBC z4Upqi?_mo?9#SVBwc^sKld6Ckr~_)D-BA<1j>Yh8tcbI)JRZfWn6(9O1lB@b*A_Kj zCzp!u@#~m`!>wTjYNGY1oo+$(+lN}vNz?%6Q3GBry8Zf$Cqztd819 zBh~T8FxBr+ENliBF(*_%CX_XQ-3N)z*8f zVo z)R8|zjpyIaTUcm2&R;u>BawNpP!m>i<_6Zjdmle4G`E}`D*8yJaxoxL9#Q5Zw~5+-9e z)Co;P?Q|DvoS#uAc@A|8uA}C8h8jOxm&|^y6HG-7;TVO{sC!rq)vel{k`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ESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 11d4c9e49..8c53afa4e 100644 --- a/apps/locale/zh/LC_MESSAGES/django.po +++ b/apps/locale/zh/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: JumpServer 0.3.3\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-28 18:58+0800\n" +"POT-Creation-Date: 2020-06-30 17:24+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: ibuler \n" "Language-Team: JumpServer team\n" @@ -84,7 +84,7 @@ msgstr "数据库" #: users/templates/users/user_group_detail.html:62 #: users/templates/users/user_group_list.html:16 #: users/templates/users/user_profile.html:138 -#: xpack/plugins/change_auth_plan/models.py:77 xpack/plugins/cloud/models.py:53 +#: xpack/plugins/change_auth_plan/models.py:76 xpack/plugins/cloud/models.py:53 #: xpack/plugins/cloud/models.py:139 xpack/plugins/gathered_user/models.py:26 msgid "Comment" msgstr "备注" @@ -110,7 +110,7 @@ msgstr "数据库应用" #: users/templates/users/user_asset_permission.html:40 #: users/templates/users/user_asset_permission.html:70 #: users/templates/users/user_granted_remote_app.html:36 -#: xpack/plugins/change_auth_plan/models.py:283 +#: xpack/plugins/change_auth_plan/models.py:282 #: xpack/plugins/cloud/models.py:269 msgid "Asset" msgstr "资产" @@ -134,7 +134,7 @@ msgstr "参数" #: assets/models/group.py:21 common/mixins/models.py:49 orgs/models.py:16 #: perms/models/base.py:54 users/models/user.py:508 #: users/serializers/group.py:35 users/templates/users/user_detail.html:97 -#: xpack/plugins/change_auth_plan/models.py:81 xpack/plugins/cloud/models.py:56 +#: xpack/plugins/change_auth_plan/models.py:80 xpack/plugins/cloud/models.py:56 #: xpack/plugins/cloud/models.py:145 xpack/plugins/gathered_user/models.py:30 msgid "Created by" msgstr "创建者" @@ -233,7 +233,7 @@ msgstr "网域" #: assets/models/asset.py:195 assets/models/user.py:109 #: perms/models/asset_permission.py:81 -#: xpack/plugins/change_auth_plan/models.py:56 +#: xpack/plugins/change_auth_plan/models.py:55 #: xpack/plugins/gathered_user/models.py:24 msgid "Nodes" msgstr "节点" @@ -343,8 +343,8 @@ msgstr "" #: users/templates/users/user_detail.html:53 #: users/templates/users/user_list.html:15 #: users/templates/users/user_profile.html:47 -#: xpack/plugins/change_auth_plan/models.py:47 -#: xpack/plugins/change_auth_plan/models.py:279 +#: xpack/plugins/change_auth_plan/models.py:46 +#: xpack/plugins/change_auth_plan/models.py:278 msgid "Username" msgstr "用户名" @@ -359,21 +359,21 @@ msgstr "用户名" #: users/templates/users/user_profile_update.html:41 #: users/templates/users/user_pubkey_update.html:41 #: users/templates/users/user_update.html:20 -#: xpack/plugins/change_auth_plan/models.py:68 -#: xpack/plugins/change_auth_plan/models.py:191 -#: xpack/plugins/change_auth_plan/models.py:286 +#: xpack/plugins/change_auth_plan/models.py:67 +#: xpack/plugins/change_auth_plan/models.py:190 +#: xpack/plugins/change_auth_plan/models.py:285 msgid "Password" msgstr "密码" -#: assets/models/base.py:235 xpack/plugins/change_auth_plan/models.py:72 -#: xpack/plugins/change_auth_plan/models.py:198 -#: xpack/plugins/change_auth_plan/models.py:293 +#: assets/models/base.py:235 xpack/plugins/change_auth_plan/models.py:71 +#: xpack/plugins/change_auth_plan/models.py:197 +#: xpack/plugins/change_auth_plan/models.py:292 msgid "SSH private key" msgstr "SSH密钥" -#: assets/models/base.py:236 xpack/plugins/change_auth_plan/models.py:75 -#: xpack/plugins/change_auth_plan/models.py:194 -#: xpack/plugins/change_auth_plan/models.py:289 +#: assets/models/base.py:236 xpack/plugins/change_auth_plan/models.py:74 +#: xpack/plugins/change_auth_plan/models.py:193 +#: xpack/plugins/change_auth_plan/models.py:288 msgid "SSH public key" msgstr "SSH公钥" @@ -603,7 +603,7 @@ msgid "Username same with user" msgstr "用户名与用户相同" #: assets/models/user.py:110 templates/_nav.html:39 -#: xpack/plugins/change_auth_plan/models.py:52 +#: xpack/plugins/change_auth_plan/models.py:51 msgid "Assets" msgstr "资产管理" @@ -914,8 +914,8 @@ msgid "Success" msgstr "成功" #: audits/models.py:43 ops/models/command.py:28 perms/models/base.py:52 -#: terminal/models.py:199 xpack/plugins/change_auth_plan/models.py:177 -#: xpack/plugins/change_auth_plan/models.py:308 +#: terminal/models.py:199 xpack/plugins/change_auth_plan/models.py:176 +#: xpack/plugins/change_auth_plan/models.py:307 #: xpack/plugins/gathered_user/models.py:76 msgid "Date start" msgstr "开始日期" @@ -999,7 +999,7 @@ msgstr "Agent" msgid "MFA" msgstr "多因子认证" -#: audits/models.py:105 xpack/plugins/change_auth_plan/models.py:304 +#: audits/models.py:105 xpack/plugins/change_auth_plan/models.py:303 #: xpack/plugins/cloud/models.py:217 msgid "Reason" msgstr "原因" @@ -1085,39 +1085,43 @@ msgstr "" msgid "Invalid token or cache refreshed." msgstr "" -#: authentication/errors.py:21 +#: authentication/errors.py:22 msgid "Username/password check failed" msgstr "用户名/密码 校验失败" -#: authentication/errors.py:22 +#: authentication/errors.py:23 +msgid "Password decrypt failed" +msgstr "密码解密失败" + +#: authentication/errors.py:24 msgid "MFA failed" msgstr "多因子认证失败" -#: authentication/errors.py:23 +#: authentication/errors.py:25 msgid "MFA unset" msgstr "多因子认证没有设定" -#: authentication/errors.py:24 +#: authentication/errors.py:26 msgid "Username does not exist" msgstr "用户名不存在" -#: authentication/errors.py:25 +#: authentication/errors.py:27 msgid "Password expired" msgstr "密码已过期" -#: authentication/errors.py:26 +#: authentication/errors.py:28 msgid "Disabled or expired" msgstr "禁用或失效" -#: authentication/errors.py:27 +#: authentication/errors.py:29 msgid "This account is inactive." msgstr "此账户已禁用" -#: authentication/errors.py:37 +#: authentication/errors.py:39 msgid "No session found, check your cookie" msgstr "会话已变更,刷新页面" -#: authentication/errors.py:39 +#: authentication/errors.py:41 #, python-brace-format msgid "" "The username or password you entered is incorrect, please enter it again. " @@ -1127,34 +1131,34 @@ msgstr "" "您输入的用户名或密码不正确,请重新输入。 您还可以尝试 {times_try} 次(账号将" "被临时 锁定 {block_time} 分钟)" -#: authentication/errors.py:45 +#: authentication/errors.py:47 msgid "" "The account has been locked (please contact admin to unlock it or try again " "after {} minutes)" msgstr "账号已被锁定(请联系管理员解锁 或 {}分钟后重试)" -#: authentication/errors.py:48 users/views/profile/otp.py:63 +#: authentication/errors.py:50 users/views/profile/otp.py:63 #: users/views/profile/otp.py:102 users/views/profile/otp.py:121 msgid "MFA code invalid, or ntp sync server time" msgstr "MFA验证码不正确,或者服务器端时间不对" -#: authentication/errors.py:50 +#: authentication/errors.py:52 msgid "MFA required" msgstr "需要多因子认证" -#: authentication/errors.py:51 +#: authentication/errors.py:53 msgid "MFA not set, please set it first" msgstr "多因子认证没有设置,请先完成设置" -#: authentication/errors.py:52 +#: authentication/errors.py:54 msgid "Login confirm required" msgstr "需要登录复核" -#: authentication/errors.py:53 +#: authentication/errors.py:55 msgid "Wait login confirm ticket for accept" msgstr "等待登录复核处理" -#: authentication/errors.py:54 +#: authentication/errors.py:56 msgid "Login confirm ticket was {}" msgstr "登录复核 {}" @@ -1334,7 +1338,7 @@ msgstr "欢迎回来,请输入用户名和密码登录" msgid "Please enable cookies and try again." msgstr "设置你的浏览器支持cookie" -#: authentication/views/login.py:168 +#: authentication/views/login.py:172 msgid "" "Wait for {} confirm, You also can copy link to her/him
\n" " Don't close this page" @@ -1342,15 +1346,15 @@ msgstr "" "等待 {} 确认, 你也可以复制链接发给他/她
\n" " 不要关闭本页面" -#: authentication/views/login.py:173 +#: authentication/views/login.py:177 msgid "No ticket found" msgstr "没有发现工单" -#: authentication/views/login.py:205 +#: authentication/views/login.py:209 msgid "Logout success" msgstr "退出登录成功" -#: authentication/views/login.py:206 +#: authentication/views/login.py:210 msgid "Logout success, return login page" msgstr "退出登录成功,返回到登录页面" @@ -1552,8 +1556,8 @@ msgstr "开始时间" msgid "End time" msgstr "完成时间" -#: ops/models/adhoc.py:242 xpack/plugins/change_auth_plan/models.py:180 -#: xpack/plugins/change_auth_plan/models.py:311 +#: ops/models/adhoc.py:242 xpack/plugins/change_auth_plan/models.py:179 +#: xpack/plugins/change_auth_plan/models.py:310 #: xpack/plugins/gathered_user/models.py:79 msgid "Time" msgstr "时间" @@ -2666,7 +2670,7 @@ msgid "Set password" msgstr "设置密码" #: users/forms/user.py:132 users/serializers/user.py:38 -#: xpack/plugins/change_auth_plan/models.py:61 +#: xpack/plugins/change_auth_plan/models.py:60 #: xpack/plugins/change_auth_plan/serializers.py:30 msgid "Password strategy" msgstr "密码策略" @@ -3542,65 +3546,65 @@ msgid "Token invalid or expired" msgstr "Token错误或失效" #: xpack/plugins/change_auth_plan/meta.py:9 -#: xpack/plugins/change_auth_plan/models.py:89 -#: xpack/plugins/change_auth_plan/models.py:184 +#: xpack/plugins/change_auth_plan/models.py:88 +#: xpack/plugins/change_auth_plan/models.py:183 msgid "Change auth plan" msgstr "改密计划" -#: xpack/plugins/change_auth_plan/models.py:41 +#: xpack/plugins/change_auth_plan/models.py:40 msgid "Custom password" msgstr "自定义密码" -#: xpack/plugins/change_auth_plan/models.py:42 +#: xpack/plugins/change_auth_plan/models.py:41 msgid "All assets use the same random password" msgstr "所有资产使用相同的随机密码" -#: xpack/plugins/change_auth_plan/models.py:43 +#: xpack/plugins/change_auth_plan/models.py:42 msgid "All assets use different random password" msgstr "所有资产使用不同的随机密码" -#: xpack/plugins/change_auth_plan/models.py:65 +#: xpack/plugins/change_auth_plan/models.py:64 msgid "Password rules" msgstr "密码规则" -#: xpack/plugins/change_auth_plan/models.py:188 +#: xpack/plugins/change_auth_plan/models.py:187 msgid "Change auth plan snapshot" msgstr "改密计划快照" -#: xpack/plugins/change_auth_plan/models.py:203 -#: xpack/plugins/change_auth_plan/models.py:297 +#: xpack/plugins/change_auth_plan/models.py:202 +#: xpack/plugins/change_auth_plan/models.py:296 msgid "Change auth plan execution" msgstr "改密计划执行" -#: xpack/plugins/change_auth_plan/models.py:270 +#: xpack/plugins/change_auth_plan/models.py:269 msgid "Ready" msgstr "" -#: xpack/plugins/change_auth_plan/models.py:271 +#: xpack/plugins/change_auth_plan/models.py:270 msgid "Preflight check" msgstr "" -#: xpack/plugins/change_auth_plan/models.py:272 +#: xpack/plugins/change_auth_plan/models.py:271 msgid "Change auth" msgstr "" -#: xpack/plugins/change_auth_plan/models.py:273 +#: xpack/plugins/change_auth_plan/models.py:272 msgid "Verify auth" msgstr "" -#: xpack/plugins/change_auth_plan/models.py:274 +#: xpack/plugins/change_auth_plan/models.py:273 msgid "Keep auth" msgstr "" -#: xpack/plugins/change_auth_plan/models.py:275 +#: xpack/plugins/change_auth_plan/models.py:274 msgid "Finished" msgstr "结束" -#: xpack/plugins/change_auth_plan/models.py:301 +#: xpack/plugins/change_auth_plan/models.py:300 msgid "Step" msgstr "步骤" -#: xpack/plugins/change_auth_plan/models.py:318 +#: xpack/plugins/change_auth_plan/models.py:317 msgid "Change auth plan task" msgstr "改密计划任务" From 183df82a75e9ba4141a6be9b4f615c9b9c3ab7d5 Mon Sep 17 00:00:00 2001 From: Bai Date: Tue, 30 Jun 2020 18:14:53 +0800 Subject: [PATCH 07/19] =?UTF-8?q?feat(login=20password=20ecrypt):=20?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=AF=86=E7=A0=81=E5=8A=A0=E5=AF=86=E4=BC=A0?= =?UTF-8?q?=E8=BE=93=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/templates/authentication/login.html | 9 ++++++--- .../templates/authentication/xpack_login.html | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/authentication/templates/authentication/login.html b/apps/authentication/templates/authentication/login.html index 60b365d9e..14978e426 100644 --- a/apps/authentication/templates/authentication/login.html +++ b/apps/authentication/templates/authentication/login.html @@ -66,13 +66,16 @@