Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
fbe4f4c1
Commit
fbe4f4c1
authored
Oct 25, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:jumpserver/jumpserver into dev
parents
4d53b6f0
39b41458
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
39 additions
and
39 deletions
+39
-39
const.py
apps/assets/const.py
+5
-5
asset.py
apps/assets/forms/asset.py
+3
-3
user.py
apps/assets/forms/user.py
+2
-2
asset.py
apps/assets/serializers/asset.py
+6
-6
system_user.py
apps/assets/serializers/system_user.py
+6
-6
const.py
apps/jumpserver/const.py
+1
-1
django.mo
apps/locale/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/locale/zh/LC_MESSAGES/django.po
+0
-0
serializers.py
apps/orgs/serializers.py
+6
-6
asset_permission.py
apps/perms/forms/asset_permission.py
+4
-4
_foot_js.html
apps/templates/_foot_js.html
+1
-1
requirements.txt
requirements/requirements.txt
+5
-5
No files found.
apps/assets/const.py
View file @
fbe4f4c1
...
@@ -4,11 +4,11 @@
...
@@ -4,11 +4,11 @@
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_HELP_TEXT
=
_
(
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_HELP_TEXT
=
_
(
'
Only Numbers、letters、 chinese and characters ( {} ) are allowed
'
'
Cannot contain special characters: [ {} ]
'
)
.
format
(
" "
.
join
([
'
.'
,
'_'
,
'@'
,
'-
'
]))
)
.
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"
)
_
(
"* The contains characters that are not allowed"
)
apps/assets/forms/asset.py
View file @
fbe4f4c1
...
@@ -7,7 +7,7 @@ from common.utils import get_logger
...
@@ -7,7 +7,7 @@ from common.utils import get_logger
from
orgs.mixins.forms
import
OrgModelForm
from
orgs.mixins.forms
import
OrgModelForm
from
..models
import
Asset
,
Node
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__
)
logger
=
get_logger
(
__file__
)
...
@@ -69,7 +69,7 @@ class AssetCreateForm(OrgModelForm):
...
@@ -69,7 +69,7 @@ class AssetCreateForm(OrgModelForm):
'nodes'
:
_
(
"Node"
),
'nodes'
:
_
(
"Node"
),
}
}
help_texts
=
{
help_texts
=
{
'hostname'
:
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_HELP_TEXT
,
'hostname'
:
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_HELP_TEXT
,
'admin_user'
:
_
(
'admin_user'
:
_
(
'root or other NOPASSWD sudo privilege user existed in asset,'
'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'
'If asset is windows or other set any one, more see admin user left menu'
...
@@ -116,7 +116,7 @@ class AssetUpdateForm(OrgModelForm):
...
@@ -116,7 +116,7 @@ class AssetUpdateForm(OrgModelForm):
'nodes'
:
_
(
"Node"
),
'nodes'
:
_
(
"Node"
),
}
}
help_texts
=
{
help_texts
=
{
'hostname'
:
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_HELP_TEXT
,
'hostname'
:
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_HELP_TEXT
,
'admin_user'
:
_
(
'admin_user'
:
_
(
'root or other NOPASSWD sudo privilege user existed in asset,'
'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'
'If asset is windows or other set any one, more see admin user left menu'
...
...
apps/assets/forms/user.py
View file @
fbe4f4c1
...
@@ -6,7 +6,7 @@ from django.utils.translation import gettext_lazy as _
...
@@ -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
common.utils
import
validate_ssh_private_key
,
ssh_pubkey_gen
,
get_logger
from
orgs.mixins.forms
import
OrgModelForm
from
orgs.mixins.forms
import
OrgModelForm
from
..models
import
AdminUser
,
SystemUser
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__
)
logger
=
get_logger
(
__file__
)
__all__
=
[
__all__
=
[
...
@@ -99,7 +99,7 @@ class SystemUserForm(OrgModelForm, PasswordAndKeyAuthForm):
...
@@ -99,7 +99,7 @@ class SystemUserForm(OrgModelForm, PasswordAndKeyAuthForm):
}),
}),
}
}
help_texts
=
{
help_texts
=
{
'name'
:
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_HELP_TEXT
,
'name'
:
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_HELP_TEXT
,
'auto_push'
:
_
(
'Auto push system user to asset'
),
'auto_push'
:
_
(
'Auto push system user to asset'
),
'priority'
:
_
(
'1-100, High level will be using login asset as default, '
'priority'
:
_
(
'1-100, High level will be using login asset as default, '
'if user was granted more than 2 system user'
),
'if user was granted more than 2 system user'
),
...
...
apps/assets/serializers/asset.py
View file @
fbe4f4c1
...
@@ -9,8 +9,8 @@ from orgs.mixins.serializers import BulkOrgResourceModelSerializer
...
@@ -9,8 +9,8 @@ from orgs.mixins.serializers import BulkOrgResourceModelSerializer
from
common.serializers
import
AdaptedBulkListSerializer
from
common.serializers
import
AdaptedBulkListSerializer
from
..models
import
Asset
,
Node
,
Label
from
..models
import
Asset
,
Node
,
Label
from
..const
import
(
from
..const
import
(
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_PATTERN
,
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_PATTERN
,
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_ERROR_MSG
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_ERROR_MSG
)
)
from
.base
import
ConnectivitySerializer
from
.base
import
ConnectivitySerializer
...
@@ -98,10 +98,10 @@ class AssetSerializer(BulkOrgResourceModelSerializer):
...
@@ -98,10 +98,10 @@ class AssetSerializer(BulkOrgResourceModelSerializer):
@staticmethod
@staticmethod
def
validate_hostname
(
hostname
):
def
validate_hostname
(
hostname
):
pattern
=
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_PATTERN
pattern
=
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_PATTERN
res
=
re
.
mat
ch
(
pattern
,
hostname
)
res
=
re
.
sear
ch
(
pattern
,
hostname
)
if
res
is
None
:
if
res
is
not
None
:
msg
=
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_ERROR_MSG
msg
=
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_ERROR_MSG
raise
serializers
.
ValidationError
(
msg
)
raise
serializers
.
ValidationError
(
msg
)
return
hostname
return
hostname
...
...
apps/assets/serializers/system_user.py
View file @
fbe4f4c1
...
@@ -8,8 +8,8 @@ from common.utils import ssh_pubkey_gen
...
@@ -8,8 +8,8 @@ from common.utils import ssh_pubkey_gen
from
orgs.mixins.serializers
import
BulkOrgResourceModelSerializer
from
orgs.mixins.serializers
import
BulkOrgResourceModelSerializer
from
..models
import
SystemUser
from
..models
import
SystemUser
from
..const
import
(
from
..const
import
(
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_PATTERN
,
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_PATTERN
,
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_ERROR_MSG
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_ERROR_MSG
)
)
from
.base
import
AuthSerializer
,
AuthSerializerMixin
from
.base
import
AuthSerializer
,
AuthSerializerMixin
...
@@ -41,10 +41,10 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
...
@@ -41,10 +41,10 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
@staticmethod
@staticmethod
def
validate_name
(
name
):
def
validate_name
(
name
):
pattern
=
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_PATTERN
pattern
=
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_PATTERN
res
=
re
.
mat
ch
(
pattern
,
name
)
res
=
re
.
sear
ch
(
pattern
,
name
)
if
res
is
None
:
if
res
is
not
None
:
msg
=
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_ERROR_MSG
msg
=
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_ERROR_MSG
raise
serializers
.
ValidationError
(
msg
)
raise
serializers
.
ValidationError
(
msg
)
return
name
return
name
...
...
apps/jumpserver/const.py
View file @
fbe4f4c1
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#
#
VERSION
=
'1.5.
3
'
VERSION
=
'1.5.
4
'
apps/locale/zh/LC_MESSAGES/django.mo
View file @
fbe4f4c1
No preview for this file type
apps/locale/zh/LC_MESSAGES/django.po
View file @
fbe4f4c1
This diff is collapsed.
Click to expand it.
apps/orgs/serializers.py
View file @
fbe4f4c1
...
@@ -5,8 +5,8 @@ from rest_framework import serializers
...
@@ -5,8 +5,8 @@ from rest_framework import serializers
from
users.models
import
User
,
UserGroup
from
users.models
import
User
,
UserGroup
from
assets.models
import
Asset
,
Domain
,
AdminUser
,
SystemUser
,
Label
from
assets.models
import
Asset
,
Domain
,
AdminUser
,
SystemUser
,
Label
from
assets.const
import
(
from
assets.const
import
(
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_PATTERN
,
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_PATTERN
,
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_ERROR_MSG
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_ERROR_MSG
)
)
from
perms.models
import
AssetPermission
from
perms.models
import
AssetPermission
from
common.serializers
import
AdaptedBulkListSerializer
from
common.serializers
import
AdaptedBulkListSerializer
...
@@ -24,10 +24,10 @@ class OrgSerializer(ModelSerializer):
...
@@ -24,10 +24,10 @@ class OrgSerializer(ModelSerializer):
@staticmethod
@staticmethod
def
validate_name
(
name
):
def
validate_name
(
name
):
pattern
=
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_PATTERN
pattern
=
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_PATTERN
res
=
re
.
mat
ch
(
pattern
,
name
)
res
=
re
.
sear
ch
(
pattern
,
name
)
if
res
is
None
:
if
res
is
not
None
:
msg
=
GENERAL_
LIMIT
_SPECIAL_CHARACTERS_ERROR_MSG
msg
=
GENERAL_
FORBIDDEN
_SPECIAL_CHARACTERS_ERROR_MSG
raise
serializers
.
ValidationError
(
msg
)
raise
serializers
.
ValidationError
(
msg
)
return
name
return
name
...
...
apps/perms/forms/asset_permission.py
View file @
fbe4f4c1
...
@@ -20,6 +20,10 @@ class ActionField(forms.MultipleChoiceField):
...
@@ -20,6 +20,10 @@ class ActionField(forms.MultipleChoiceField):
kwargs
[
'initial'
]
=
Action
.
ALL
kwargs
[
'initial'
]
=
Action
.
ALL
kwargs
[
'label'
]
=
_
(
"Action"
)
kwargs
[
'label'
]
=
_
(
"Action"
)
kwargs
[
'widget'
]
=
forms
.
CheckboxSelectMultiple
()
kwargs
[
'widget'
]
=
forms
.
CheckboxSelectMultiple
()
kwargs
[
'help_text'
]
=
_
(
'Tips: The RDP protocol does not support separate controls '
'for uploading or downloading files'
)
super
()
.
__init__
(
*
args
,
**
kwargs
)
super
()
.
__init__
(
*
args
,
**
kwargs
)
def
to_python
(
self
,
value
):
def
to_python
(
self
,
value
):
...
@@ -89,10 +93,6 @@ class AssetPermissionForm(OrgModelForm):
...
@@ -89,10 +93,6 @@ class AssetPermissionForm(OrgModelForm):
labels
=
{
labels
=
{
'nodes'
:
_
(
"Node"
),
'nodes'
:
_
(
"Node"
),
}
}
help_texts
=
{
'actions'
:
_
(
'Tips: The RDP protocol does not support separate '
'controls for uploading or downloading files'
)
}
def
clean_user_groups
(
self
):
def
clean_user_groups
(
self
):
users
=
self
.
cleaned_data
.
get
(
'users'
)
users
=
self
.
cleaned_data
.
get
(
'users'
)
...
...
apps/templates/_foot_js.html
View file @
fbe4f4c1
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<script
src=
"{% static "
js
/
plugins
/
toastr
/
toastr
.
min
.
js
"
%}"
></script>
<script
src=
"{% static "
js
/
plugins
/
toastr
/
toastr
.
min
.
js
"
%}"
></script>
<script
src=
"{% static "
js
/
inspinia
.
js
"
%}"
></script>
<script
src=
"{% static "
js
/
inspinia
.
js
"
%}"
></script>
<script
type=
"text/javascript"
src=
"{% url 'javascript-catalog' %}"
></script>
<script
type=
"text/javascript"
src=
"{% url 'javascript-catalog' %}"
></script>
<script
src=
"{% static "
js
/
jumpserver
.
js
"
%}?
v=
4
"
></script>
<script
src=
"{% static "
js
/
jumpserver
.
js
"
%}?
v=
5
"
></script>
<script>
<script>
activeNav
();
activeNav
();
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
...
...
requirements/requirements.txt
View file @
fbe4f4c1
amqp==2.1.4
amqp==2.1.4
ansible==2.8.
0
ansible==2.8.
2
asn1crypto==0.24.0
asn1crypto==0.24.0
bcrypt==3.1.4
bcrypt==3.1.4
billiard==3.5.0.3
billiard==3.5.0.3
...
@@ -14,7 +14,7 @@ coreapi==2.3.3
...
@@ -14,7 +14,7 @@ coreapi==2.3.3
coreschema==0.0.4
coreschema==0.0.4
cryptography==2.3.1
cryptography==2.3.1
decorator==4.1.2
decorator==4.1.2
Django==2.1.
7
Django==2.1.
11
django-auth-ldap==1.7.0
django-auth-ldap==1.7.0
django-bootstrap3==9.1.0
django-bootstrap3==9.1.0
django-celery-beat==1.4.0
django-celery-beat==1.4.0
...
@@ -27,7 +27,7 @@ django-simple-captcha==0.5.6
...
@@ -27,7 +27,7 @@ django-simple-captcha==0.5.6
djangorestframework==3.9.4
djangorestframework==3.9.4
djangorestframework-bulk==0.2.1
djangorestframework-bulk==0.2.1
docutils==0.14
docutils==0.14
ecdsa==0.13
ecdsa==0.13
.3
enum-compat==0.0.2
enum-compat==0.0.2
ephem==3.7.6.0
ephem==3.7.6.0
eventlet==0.24.1
eventlet==0.24.1
...
@@ -47,7 +47,7 @@ olefile==0.44
...
@@ -47,7 +47,7 @@ olefile==0.44
openapi-codec==1.3.2
openapi-codec==1.3.2
paramiko==2.4.2
paramiko==2.4.2
passlib==1.7.1
passlib==1.7.1
Pillow==
4.3
.0
Pillow==
6.2
.0
pyasn1==0.4.2
pyasn1==0.4.2
pycparser==2.19
pycparser==2.19
pycrypto==2.6.1
pycrypto==2.6.1
...
@@ -68,7 +68,7 @@ uritemplate==3.0.0
...
@@ -68,7 +68,7 @@ uritemplate==3.0.0
urllib3==1.25.2
urllib3==1.25.2
vine==1.1.4
vine==1.1.4
drf-yasg==1.9.1
drf-yasg==1.9.1
Werkzeug==0.1
4.1
Werkzeug==0.1
5.3
drf-nested-routers==0.91
drf-nested-routers==0.91
aliyun-python-sdk-core-v3==2.9.1
aliyun-python-sdk-core-v3==2.9.1
aliyun-python-sdk-ecs==4.10.1
aliyun-python-sdk-ecs==4.10.1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment