From a57df0e05fcfa90716b5cdc9f0b1a03b4ec41df4 Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Fri, 25 Oct 2019 10:55:28 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=E4=B8=BB=E6=9C=BA?= =?UTF-8?q?=E5=90=8D/=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7=E5=90=8D?= =?UTF-8?q?=E7=A7=B0/=E7=BB=84=E7=BB=87=E5=90=8D=E7=A7=B0=E7=9A=84?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6=E9=99=90=E5=88=B6=EF=BC=88?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E7=89=B9=E6=AE=8A=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E9=BB=91=E5=90=8D=E5=8D=95=EF=BC=89[/=20\]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/const.py | 10 +++++----- apps/assets/forms/asset.py | 6 +++--- apps/assets/forms/user.py | 4 ++-- apps/assets/serializers/asset.py | 12 ++++++------ apps/assets/serializers/system_user.py | 12 ++++++------ apps/locale/zh/LC_MESSAGES/django.mo | Bin 80782 -> 80725 bytes apps/locale/zh/LC_MESSAGES/django.po | 6 +++--- apps/orgs/serializers.py | 12 ++++++------ 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/apps/assets/const.py b/apps/assets/const.py index c23b700ba..7786d8f13 100644 --- a/apps/assets/const.py +++ b/apps/assets/const.py @@ -4,11 +4,11 @@ from django.utils.translation import ugettext_lazy as _ -GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT = _( - 'Only Numbers、letters、 chinese and characters ( {} ) are allowed' -).format(" ".join(['.', '_', '@', '-'])) +GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_HELP_TEXT = _( + 'Cannot contain special characters: [ {} ]' +).format(" ".join(['/', '\\'])) -GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN = r"^[\._@\w-]+$" +GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN = r"[/\\]" -GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG = \ +GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG = \ _("* The contains characters that are not allowed") diff --git a/apps/assets/forms/asset.py b/apps/assets/forms/asset.py index b6e5d3a42..805f49f24 100644 --- a/apps/assets/forms/asset.py +++ b/apps/assets/forms/asset.py @@ -7,7 +7,7 @@ from common.utils import get_logger from orgs.mixins.forms import OrgModelForm from ..models import Asset, Node -from ..const import GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT +from ..const import GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_HELP_TEXT logger = get_logger(__file__) @@ -69,7 +69,7 @@ class AssetCreateForm(OrgModelForm): 'nodes': _("Node"), } help_texts = { - 'hostname': GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT, + 'hostname': GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_HELP_TEXT, 'admin_user': _( 'root or other NOPASSWD sudo privilege user existed in asset,' 'If asset is windows or other set any one, more see admin user left menu' @@ -116,7 +116,7 @@ class AssetUpdateForm(OrgModelForm): 'nodes': _("Node"), } help_texts = { - 'hostname': GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT, + 'hostname': GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_HELP_TEXT, 'admin_user': _( 'root or other NOPASSWD sudo privilege user existed in asset,' 'If asset is windows or other set any one, more see admin user left menu' diff --git a/apps/assets/forms/user.py b/apps/assets/forms/user.py index b50639684..21626f4f6 100644 --- a/apps/assets/forms/user.py +++ b/apps/assets/forms/user.py @@ -6,7 +6,7 @@ from django.utils.translation import gettext_lazy as _ from common.utils import validate_ssh_private_key, ssh_pubkey_gen, get_logger from orgs.mixins.forms import OrgModelForm from ..models import AdminUser, SystemUser -from ..const import GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT +from ..const import GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_HELP_TEXT logger = get_logger(__file__) __all__ = [ @@ -99,7 +99,7 @@ class SystemUserForm(OrgModelForm, PasswordAndKeyAuthForm): }), } help_texts = { - 'name': GENERAL_LIMIT_SPECIAL_CHARACTERS_HELP_TEXT, + 'name': GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_HELP_TEXT, 'auto_push': _('Auto push system user to asset'), 'priority': _('1-100, High level will be using login asset as default, ' 'if user was granted more than 2 system user'), diff --git a/apps/assets/serializers/asset.py b/apps/assets/serializers/asset.py index f198aee76..a24374c13 100644 --- a/apps/assets/serializers/asset.py +++ b/apps/assets/serializers/asset.py @@ -9,8 +9,8 @@ from orgs.mixins.serializers import BulkOrgResourceModelSerializer from common.serializers import AdaptedBulkListSerializer from ..models import Asset, Node, Label from ..const import ( - GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN, - GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG + GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN, + GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG ) from .base import ConnectivitySerializer @@ -98,10 +98,10 @@ class AssetSerializer(BulkOrgResourceModelSerializer): @staticmethod def validate_hostname(hostname): - pattern = GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN - res = re.match(pattern, hostname) - if res is None: - msg = GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG + pattern = GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN + res = re.search(pattern, hostname) + if res is not None: + msg = GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG raise serializers.ValidationError(msg) return hostname diff --git a/apps/assets/serializers/system_user.py b/apps/assets/serializers/system_user.py index 1340741e6..648af01a7 100644 --- a/apps/assets/serializers/system_user.py +++ b/apps/assets/serializers/system_user.py @@ -8,8 +8,8 @@ from common.utils import ssh_pubkey_gen from orgs.mixins.serializers import BulkOrgResourceModelSerializer from ..models import SystemUser from ..const import ( - GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN, - GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG + GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN, + GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG ) from .base import AuthSerializer, AuthSerializerMixin @@ -41,10 +41,10 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer): @staticmethod def validate_name(name): - pattern = GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN - res = re.match(pattern, name) - if res is None: - msg = GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG + pattern = GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN + res = re.search(pattern, name) + if res is not None: + msg = GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG raise serializers.ValidationError(msg) return name diff --git a/apps/locale/zh/LC_MESSAGES/django.mo b/apps/locale/zh/LC_MESSAGES/django.mo index f6f15fd93f644e269b568b272c06909a755951e8..a6510ca5a41597f874d262fab0c92cdb24ef153b 100644 GIT binary patch delta 19928 zcmZA737C#m+{f`}%)(#{27_4{4932%*)rC#@1c+^6^Y3D5S8rQWvQ$oSwo4kmSkU& zJw&o)Uz6?q{+{#idf)54uj}?X|NlAnxz9QG@;ozU(!-D=4??~U3G)~6`FsZk`F!c| z5k_LryFOnA%!XMpFXqJ*%#W#<2YX>Sj>Zx=5liAm48dy{inlQWA7W+<9qi7ReX!5( z%Sa-xB?_WWP#jaS8D_&7mckm_y8iNECgO6a0n|kG zmu9y1Q&7j9Eb#{BBOZVn;dIo2b5R{F$FjH{!|)nvKzA_)Lx#DPNJRBp4wbKiTFIAD z{q@6W^pBvRYd9UXwDT}8u0yTFA=FA-Ms@fA)j{ZRH^c0xOIQ%K0;NzVs*4(MTU5W@ zEFO&N=Y7n>`F$U|f^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SV--E zpCeZO2*>-!w2cTmWSNOr%)hj4bU;`C_O?lV+Y|e2rClgbvv#@2ji5Y%E*EfAAuh)07X%sJ%rd4V(j=8WfYISzMe?>Fk7 zP!1yBk)wmP?}zn>tI_rb^>5&RpX}6aA`W46eOA+sPms5qiu?Y$9V2|VvogG_$u#Ep z@3X?nf8rjFB)W;<^#5@T;h0Nq3XQLj5616^hr8~xx;RGMmqVXW+U#(}tUtF}yVCrg z{;^|ZKtuo4j!D&X(Yh=3cR7-1F~-gwOL-kVd}{Ik>BzfBaM<7C#ptkisa-=fiq-}E zLtc#4|LD-WV?qkLgxTQgD-wreeJp}Gb~F!}kImou7E z&Z9GNE$*S+C)k2>9+HdZ_)ztHDp1}+`8;j%P=1;68~8nSZ7E-~b}Oh)5AggQI>lE{ zCHD^Tbkx5P>GK`OZO+rDD)~~B_v0fDeSXK${?9u_mwiOEoMR;|Zj#MTPopV6$L!LG zFA(d~7I*s}b}FA3Lv2NBzOWkArc;h3x5aW%{uZ61y9ANZXARjSuILq@-z4(CaO9w; zY2>R}yGR^O+gGh^Aocoe=V)d<=cY{?;-(pUJBJp@cr@%pY`p>f-;QfJ=oBzKu^j&2KRVHHF2flM!pkQIfd1>7= q3cqh!duh(3%vtYUPTzd#vnk{+ule-mw#gdd=C<^&ehLooRr-Gr5jolb diff --git a/apps/locale/zh/LC_MESSAGES/django.po b/apps/locale/zh/LC_MESSAGES/django.po index 1b88cc884..fdc37654f 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: 2019-10-24 18:31+0800\n" +"POT-Creation-Date: 2019-10-25 10:52+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: ibuler \n" "Language-Team: Jumpserver team\n" @@ -583,8 +583,8 @@ msgid "Test if the assets under the node are connectable: {}" msgstr "测试节点下资产是否可连接: {}" #: assets/const.py:8 -msgid "Only Numbers、letters、 chinese and characters ( {} ) are allowed" -msgstr "只允许包含数字、字母、中文和特殊字符( {} )" +msgid "Cannot contain special characters: [ {} ]" +msgstr "不能包含特殊字符:[ {} ]" #: assets/const.py:14 msgid "* The contains characters that are not allowed" diff --git a/apps/orgs/serializers.py b/apps/orgs/serializers.py index 8f4df1e10..3ac7da732 100644 --- a/apps/orgs/serializers.py +++ b/apps/orgs/serializers.py @@ -5,8 +5,8 @@ from rest_framework import serializers from users.models import User, UserGroup from assets.models import Asset, Domain, AdminUser, SystemUser, Label from assets.const import ( - GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN, - GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG + GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN, + GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG ) from perms.models import AssetPermission from common.serializers import AdaptedBulkListSerializer @@ -24,10 +24,10 @@ class OrgSerializer(ModelSerializer): @staticmethod def validate_name(name): - pattern = GENERAL_LIMIT_SPECIAL_CHARACTERS_PATTERN - res = re.match(pattern, name) - if res is None: - msg = GENERAL_LIMIT_SPECIAL_CHARACTERS_ERROR_MSG + pattern = GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_PATTERN + res = re.search(pattern, name) + if res is not None: + msg = GENERAL_FORBIDDEN_SPECIAL_CHARACTERS_ERROR_MSG raise serializers.ValidationError(msg) return name