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
89a2a44f
Commit
89a2a44f
authored
Aug 15, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改导入
parent
91b2def7
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
106 additions
and
116 deletions
+106
-116
remote_app.py
apps/applications/forms/remote_app.py
+1
-1
remote_app.py
apps/applications/models/remote_app.py
+1
-1
remote_app.py
apps/applications/serializers/remote_app.py
+1
-1
asset.py
apps/assets/api/asset.py
+1
-1
label.py
apps/assets/api/label.py
+1
-1
node.py
apps/assets/api/node.py
+55
-66
system_user.py
apps/assets/api/system_user.py
+1
-1
asset.py
apps/assets/forms/asset.py
+1
-1
cmd_filter.py
apps/assets/forms/cmd_filter.py
+1
-1
domain.py
apps/assets/forms/domain.py
+1
-1
user.py
apps/assets/forms/user.py
+1
-1
asset.py
apps/assets/models/asset.py
+1
-1
authbook.py
apps/assets/models/authbook.py
+1
-1
base.py
apps/assets/models/base.py
+1
-1
cmd_filter.py
apps/assets/models/cmd_filter.py
+1
-1
domain.py
apps/assets/models/domain.py
+1
-1
label.py
apps/assets/models/label.py
+1
-1
node.py
apps/assets/models/node.py
+1
-1
admin_user.py
apps/assets/serializers/admin_user.py
+1
-1
asset.py
apps/assets/serializers/asset.py
+1
-1
asset_user.py
apps/assets/serializers/asset_user.py
+1
-1
cmd_filter.py
apps/assets/serializers/cmd_filter.py
+1
-1
domain.py
apps/assets/serializers/domain.py
+1
-1
label.py
apps/assets/serializers/label.py
+1
-1
node.py
apps/assets/serializers/node.py
+1
-1
system_user.py
apps/assets/serializers/system_user.py
+1
-1
models.py
apps/audits/models.py
+1
-1
auth.py
apps/authentication/api/auth.py
+1
-1
api.py
apps/authentication/backends/api.py
+3
-2
command.py
apps/ops/api/command.py
+1
-1
api.py
apps/orgs/api.py
+1
-1
__init__.py
apps/orgs/mixins/__init__.py
+4
-4
serializers.py
apps/orgs/serializers.py
+1
-1
asset_permission.py
apps/perms/forms/asset_permission.py
+1
-1
remote_app_permission.py
apps/perms/forms/remote_app_permission.py
+1
-1
asset_permission.py
apps/perms/models/asset_permission.py
+1
-1
base.py
apps/perms/models/base.py
+2
-2
asset_permission.py
apps/perms/serializers/asset_permission.py
+1
-1
remote_app_permission.py
apps/perms/serializers/remote_app_permission.py
+1
-1
session.py
apps/terminal/api/session.py
+1
-1
models.py
apps/terminal/backends/command/models.py
+1
-1
models.py
apps/terminal/models.py
+1
-1
v1.py
apps/terminal/serializers/v1.py
+1
-1
forms.py
apps/users/forms.py
+1
-1
group.py
apps/users/models/group.py
+1
-1
v1.py
apps/users/serializers/v1.py
+1
-1
No files found.
apps/applications/forms/remote_app.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@
from
django.utils.translation
import
ugettext
as
_
from
django
import
forms
from
orgs.mixins
import
OrgModelForm
from
orgs.mixins
.forms
import
OrgModelForm
from
assets.models
import
SystemUser
from
..models
import
RemoteApp
...
...
apps/applications/models/remote_app.py
View file @
89a2a44f
...
...
@@ -5,7 +5,7 @@ import uuid
from
django.db
import
models
from
django.utils.translation
import
ugettext_lazy
as
_
from
orgs.mixins
import
OrgModelMixin
from
orgs.mixins
.models
import
OrgModelMixin
from
common.fields.model
import
EncryptJsonDictTextField
from
..
import
const
...
...
apps/applications/serializers/remote_app.py
View file @
89a2a44f
...
...
@@ -5,7 +5,7 @@
from
rest_framework
import
serializers
from
common.serializers
import
AdaptedBulkListSerializer
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
from
..
import
const
from
..models
import
RemoteApp
...
...
apps/assets/api/asset.py
View file @
89a2a44f
...
...
@@ -20,7 +20,7 @@ from common.mixins import IDInCacheFilterMixin, ApiMessageMixin
from
common.utils
import
get_logger
,
get_object_or_none
from
common.permissions
import
IsOrgAdmin
,
IsOrgAdminOrAppUser
from
orgs.mixins
import
OrgBulkModelViewSet
from
orgs.mixins
.api
import
OrgBulkModelViewSet
from
..const
import
CACHE_KEY_ASSET_BULK_UPDATE_ID_PREFIX
from
..models
import
Asset
,
AdminUser
,
Node
from
..
import
serializers
...
...
apps/assets/api/label.py
View file @
89a2a44f
...
...
@@ -17,7 +17,7 @@ from rest_framework.pagination import LimitOffsetPagination
from
django.db.models
import
Count
from
common.utils
import
get_logger
from
orgs.mixins
import
OrgBulkModelViewSet
from
orgs.mixins
.api
import
OrgBulkModelViewSet
from
..hands
import
IsOrgAdmin
from
..models
import
Label
from
..
import
serializers
...
...
apps/assets/api/node.py
View file @
89a2a44f
...
...
@@ -15,7 +15,7 @@
import
time
from
rest_framework
import
generics
,
mixins
from
rest_framework
import
generics
,
mixins
,
viewsets
from
rest_framework.serializers
import
ValidationError
from
rest_framework.pagination
import
LimitOffsetPagination
from
rest_framework.views
import
APIView
...
...
@@ -25,7 +25,7 @@ from django.shortcuts import get_object_or_404
from
common.utils
import
get_logger
,
get_object_or_none
from
common.tree
import
TreeNodeSerializer
from
orgs.mixins
import
OrgModelViewSet
from
orgs.mixins
.api
import
OrgModelViewSet
from
..hands
import
IsOrgAdmin
from
..models
import
Node
from
..tasks
import
update_assets_hardware_info_util
,
test_asset_connectivity_util
...
...
@@ -96,70 +96,6 @@ class NodeListAsTreeApi(generics.ListAPIView):
return
queryset
class
NodeChildrenAsTreeApi
(
generics
.
ListAPIView
):
"""
节点子节点作为树返回,
[
{
"id": "",
"name": "",
"pId": "",
"meta": ""
}
]
"""
permission_classes
=
(
IsOrgAdmin
,)
serializer_class
=
TreeNodeSerializer
node
=
None
is_root
=
False
def
get_queryset
(
self
):
t1
=
time
.
time
()
self
.
check_need_refresh_nodes
()
t2
=
time
.
time
()
print
(
"1: "
,
t2
-
t1
)
node_key
=
self
.
request
.
query_params
.
get
(
'key'
)
# util = NodeUtil()
# 是否包含自己
with_self
=
False
if
not
node_key
:
node_key
=
Node
.
root
()
.
key
with_self
=
True
# self.node = util.get_node_by_key(node_key)
self
.
node
=
get_object_or_404
(
Node
,
key
=
node_key
)
t3
=
time
.
time
()
print
(
"2: "
,
t3
-
t2
)
queryset
=
self
.
node
.
get_children
(
with_self
=
with_self
)
t4
=
time
.
time
()
queryset
=
[
node
.
as_tree_node
()
for
node
in
queryset
]
print
(
"3: "
,
t4
-
t3
)
t5
=
time
.
time
()
queryset
=
sorted
(
queryset
)
print
(
"4: "
,
t5
-
t4
)
return
queryset
def
filter_assets
(
self
,
queryset
):
include_assets
=
self
.
request
.
query_params
.
get
(
'assets'
,
'0'
)
==
'1'
if
not
include_assets
:
return
queryset
assets
=
self
.
node
.
get_assets
()
.
only
(
"id"
,
"hostname"
,
"ip"
,
'platform'
,
"os"
,
"org_id"
,
"protocols"
,
)
for
asset
in
assets
:
queryset
.
append
(
asset
.
as_tree_node
(
self
.
node
))
return
queryset
def
filter_queryset
(
self
,
queryset
):
queryset
=
self
.
filter_assets
(
queryset
)
return
queryset
def
check_need_refresh_nodes
(
self
):
if
self
.
request
.
query_params
.
get
(
'refresh'
,
'0'
)
==
'1'
:
Node
.
refresh_nodes
()
class
NodeChildrenApi
(
mixins
.
ListModelMixin
,
generics
.
CreateAPIView
):
queryset
=
Node
.
objects
.
all
()
permission_classes
=
(
IsOrgAdmin
,)
...
...
@@ -213,6 +149,59 @@ class NodeChildrenApi(mixins.ListModelMixin, generics.CreateAPIView):
return
queryset
class
NodeChildrenAsTreeApi
(
generics
.
ListAPIView
):
"""
节点子节点作为树返回,
[
{
"id": "",
"name": "",
"pId": "",
"meta": ""
}
]
"""
permission_classes
=
(
IsOrgAdmin
,)
serializer_class
=
TreeNodeSerializer
node
=
None
is_root
=
False
def
get_queryset
(
self
):
self
.
check_need_refresh_nodes
()
node_key
=
self
.
request
.
query_params
.
get
(
'key'
)
# 是否包含自己
with_self
=
False
if
not
node_key
:
node_key
=
Node
.
root
()
.
key
with_self
=
True
self
.
node
=
get_object_or_404
(
Node
,
key
=
node_key
)
queryset
=
self
.
node
.
get_children
(
with_self
=
with_self
)
queryset
=
[
node
.
as_tree_node
()
for
node
in
queryset
]
queryset
=
sorted
(
queryset
)
return
queryset
def
filter_assets
(
self
,
queryset
):
include_assets
=
self
.
request
.
query_params
.
get
(
'assets'
,
'0'
)
==
'1'
if
not
include_assets
:
return
queryset
assets
=
self
.
node
.
get_assets
()
.
only
(
"id"
,
"hostname"
,
"ip"
,
'platform'
,
"os"
,
"org_id"
,
"protocols"
,
)
for
asset
in
assets
:
queryset
.
append
(
asset
.
as_tree_node
(
self
.
node
))
return
queryset
def
filter_queryset
(
self
,
queryset
):
queryset
=
self
.
filter_assets
(
queryset
)
return
queryset
def
check_need_refresh_nodes
(
self
):
if
self
.
request
.
query_params
.
get
(
'refresh'
,
'0'
)
==
'1'
:
Node
.
refresh_nodes
()
class
NodeAssetsApi
(
generics
.
ListAPIView
):
permission_classes
=
(
IsOrgAdmin
,)
serializer_class
=
serializers
.
AssetSerializer
...
...
apps/assets/api/system_user.py
View file @
89a2a44f
...
...
@@ -22,7 +22,7 @@ from rest_framework.pagination import LimitOffsetPagination
from
common.utils
import
get_logger
from
common.permissions
import
IsOrgAdmin
,
IsOrgAdminOrAppUser
from
common.mixins
import
IDInCacheFilterMixin
from
orgs.mixins
import
OrgBulkModelViewSet
from
orgs.mixins
.api
import
OrgBulkModelViewSet
from
..models
import
SystemUser
,
Asset
from
..
import
serializers
from
..tasks
import
push_system_user_to_assets_manual
,
\
...
...
apps/assets/forms/asset.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@ from django import forms
from
django.utils.translation
import
gettext_lazy
as
_
from
common.utils
import
get_logger
from
orgs.mixins
import
OrgModelForm
from
orgs.mixins
.forms
import
OrgModelForm
from
..models
import
Asset
,
Node
...
...
apps/assets/forms/cmd_filter.py
View file @
89a2a44f
...
...
@@ -5,7 +5,7 @@ from django.core.exceptions import ValidationError
from
django.utils.translation
import
ugettext_lazy
as
_
import
re
from
orgs.mixins
import
OrgModelForm
from
orgs.mixins
.forms
import
OrgModelForm
from
..models
import
CommandFilter
,
CommandFilterRule
__all__
=
[
'CommandFilterForm'
,
'CommandFilterRuleForm'
]
...
...
apps/assets/forms/domain.py
View file @
89a2a44f
...
...
@@ -3,7 +3,7 @@
from
django
import
forms
from
django.utils.translation
import
gettext_lazy
as
_
from
orgs.mixins
import
OrgModelForm
from
orgs.mixins
.forms
import
OrgModelForm
from
..models
import
Domain
,
Asset
,
Gateway
from
.user
import
PasswordAndKeyAuthForm
...
...
apps/assets/forms/user.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@ from django import forms
from
django.utils.translation
import
gettext_lazy
as
_
from
common.utils
import
validate_ssh_private_key
,
ssh_pubkey_gen
,
get_logger
from
orgs.mixins
import
OrgModelForm
from
orgs.mixins
.forms
import
OrgModelForm
from
..models
import
AdminUser
,
SystemUser
logger
=
get_logger
(
__file__
)
...
...
apps/assets/models/asset.py
View file @
89a2a44f
...
...
@@ -13,7 +13,7 @@ from django.db import models
from
django.utils.translation
import
ugettext_lazy
as
_
from
.utils
import
Connectivity
from
orgs.mixins
import
OrgModelMixin
,
OrgManager
from
orgs.mixins
.models
import
OrgModelMixin
,
OrgManager
__all__
=
[
'Asset'
,
'ProtocolsMixin'
]
logger
=
logging
.
getLogger
(
__name__
)
...
...
apps/assets/models/authbook.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@
from
django.db
import
models
from
django.utils.translation
import
ugettext_lazy
as
_
from
orgs.mixins
import
OrgManager
from
orgs.mixins
.models
import
OrgManager
from
.base
import
AssetUser
__all__
=
[
'AuthBook'
]
...
...
apps/assets/models/base.py
View file @
89a2a44f
...
...
@@ -15,7 +15,7 @@ from common.utils import (
)
from
common.validators
import
alphanumeric
from
common
import
fields
from
orgs.mixins
import
OrgModelMixin
from
orgs.mixins
.models
import
OrgModelMixin
from
.utils
import
private_key_validator
,
Connectivity
signer
=
get_signer
()
...
...
apps/assets/models/cmd_filter.py
View file @
89a2a44f
...
...
@@ -7,7 +7,7 @@ from django.db import models
from
django.core.validators
import
MinValueValidator
,
MaxValueValidator
from
django.utils.translation
import
ugettext_lazy
as
_
from
orgs.mixins
import
OrgModelMixin
from
orgs.mixins
.models
import
OrgModelMixin
__all__
=
[
...
...
apps/assets/models/domain.py
View file @
89a2a44f
...
...
@@ -9,7 +9,7 @@ import paramiko
from
django.db
import
models
from
django.utils.translation
import
ugettext_lazy
as
_
from
orgs.mixins
import
OrgModelMixin
from
orgs.mixins
.models
import
OrgModelMixin
from
.base
import
AssetUser
__all__
=
[
'Domain'
,
'Gateway'
]
...
...
apps/assets/models/label.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@
import
uuid
from
django.db
import
models
from
django.utils.translation
import
ugettext_lazy
as
_
from
orgs.mixins
import
OrgModelMixin
from
orgs.mixins
.models
import
OrgModelMixin
class
Label
(
OrgModelMixin
):
...
...
apps/assets/models/node.py
View file @
89a2a44f
...
...
@@ -10,7 +10,7 @@ from django.utils.translation import ugettext_lazy as _
from
django.utils.translation
import
ugettext
from
django.core.cache
import
cache
from
orgs.mixins
import
OrgModelMixin
,
OrgManager
from
orgs.mixins
.models
import
OrgModelMixin
,
OrgManager
from
orgs.utils
import
set_current_org
,
get_current_org
from
orgs.models
import
Organization
...
...
apps/assets/serializers/admin_user.py
View file @
89a2a44f
...
...
@@ -6,7 +6,7 @@ from rest_framework import serializers
from
common.serializers
import
AdaptedBulkListSerializer
from
..models
import
Node
,
AdminUser
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
from
.base
import
AuthSerializer
,
AuthSerializerMixin
...
...
apps/assets/serializers/asset.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@ from rest_framework import serializers
from
django.db.models
import
Prefetch
from
django.utils.translation
import
ugettext_lazy
as
_
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
from
common.serializers
import
AdaptedBulkListSerializer
from
..models
import
Asset
,
Node
,
Label
from
.base
import
ConnectivitySerializer
...
...
apps/assets/serializers/asset_user.py
View file @
89a2a44f
...
...
@@ -5,7 +5,7 @@ from django.utils.translation import ugettext as _
from
rest_framework
import
serializers
from
common.serializers
import
AdaptedBulkListSerializer
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
from
..models
import
AuthBook
,
Asset
from
..backends
import
AssetUserManager
from
.base
import
ConnectivitySerializer
,
AuthSerializerMixin
...
...
apps/assets/serializers/cmd_filter.py
View file @
89a2a44f
...
...
@@ -7,7 +7,7 @@ from django.utils.translation import ugettext_lazy as _
from
common.fields
import
ChoiceDisplayField
from
common.serializers
import
AdaptedBulkListSerializer
from
..models
import
CommandFilter
,
CommandFilterRule
,
SystemUser
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
class
CommandFilterSerializer
(
BulkOrgResourceModelSerializer
):
...
...
apps/assets/serializers/domain.py
View file @
89a2a44f
...
...
@@ -3,7 +3,7 @@
from
rest_framework
import
serializers
from
common.serializers
import
AdaptedBulkListSerializer
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
from
..models
import
Domain
,
Gateway
from
.base
import
AuthSerializerMixin
...
...
apps/assets/serializers/label.py
View file @
89a2a44f
...
...
@@ -3,7 +3,7 @@
from
rest_framework
import
serializers
from
common.serializers
import
AdaptedBulkListSerializer
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
from
..models
import
Label
...
...
apps/assets/serializers/node.py
View file @
89a2a44f
...
...
@@ -2,7 +2,7 @@
from
rest_framework
import
serializers
from
django.utils.translation
import
ugettext
as
_
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
from
..models
import
Asset
,
Node
...
...
apps/assets/serializers/system_user.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@ from django.utils.translation import ugettext_lazy as _
from
common.serializers
import
AdaptedBulkListSerializer
from
common.utils
import
ssh_pubkey_gen
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
from
..models
import
SystemUser
from
.base
import
AuthSerializer
,
AuthSerializerMixin
...
...
apps/audits/models.py
View file @
89a2a44f
...
...
@@ -5,7 +5,7 @@ from django.db.models import Q
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils
import
timezone
from
orgs.mixins
import
OrgModelMixin
from
orgs.mixins
.models
import
OrgModelMixin
__all__
=
[
'FTPLog'
,
'OperateLog'
,
'PasswordChangeLog'
,
'UserLoginLog'
,
...
...
apps/authentication/api/auth.py
View file @
89a2a44f
...
...
@@ -16,7 +16,7 @@ from rest_framework.views import APIView
from
common.utils
import
get_logger
,
get_request_ip
from
common.permissions
import
IsOrgAdminOrAppUser
,
IsValidUser
from
orgs.mixins
import
RootOrgViewMixin
from
orgs.mixins
.api
import
RootOrgViewMixin
from
users.serializers
import
UserSerializer
from
users.models
import
User
from
assets.models
import
Asset
,
SystemUser
...
...
apps/authentication/backends/api.py
View file @
89a2a44f
...
...
@@ -108,8 +108,8 @@ class AccessKeyAuthentication(authentication.BaseAuthentication):
class
AccessTokenAuthentication
(
authentication
.
BaseAuthentication
):
keyword
=
'Bearer'
model
=
get_user_model
()
expiration
=
settings
.
TOKEN_EXPIRATION
or
3600
model
=
get_user_model
()
def
authenticate
(
self
,
request
):
auth
=
authentication
.
get_authorization_header
(
request
)
.
split
()
...
...
@@ -133,8 +133,9 @@ class AccessTokenAuthentication(authentication.BaseAuthentication):
return
self
.
authenticate_credentials
(
token
)
def
authenticate_credentials
(
self
,
token
):
model
=
get_user_model
()
user_id
=
cache
.
get
(
token
)
user
=
get_object_or_none
(
self
.
model
,
id
=
user_id
)
user
=
get_object_or_none
(
model
,
id
=
user_id
)
if
not
user
:
msg
=
_
(
'Invalid token or cache refreshed.'
)
...
...
apps/ops/api/command.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@ from rest_framework import viewsets
from
django.db
import
transaction
from
django.conf
import
settings
from
orgs.mixins
import
RootOrgViewMixin
from
orgs.mixins
.api
import
RootOrgViewMixin
from
common.permissions
import
IsValidUser
from
..models
import
CommandExecution
from
..serializers
import
CommandExecutionSerializer
...
...
apps/orgs/api.py
View file @
89a2a44f
...
...
@@ -14,7 +14,7 @@ from assets.models import Asset, Domain, AdminUser, SystemUser, Label
from
perms.models
import
AssetPermission
from
orgs.utils
import
current_org
from
common.utils
import
get_logger
from
.mixins
import
OrgMembershipModelViewSetMixin
from
.mixins
.api
import
OrgMembershipModelViewSetMixin
logger
=
get_logger
(
__file__
)
...
...
apps/orgs/mixins/__init__.py
View file @
89a2a44f
# -*- coding: utf-8 -*-
#
from
.models
import
*
from
.serializers
import
*
from
.forms
import
*
from
.api
import
*
#
from .models import *
#
from .serializers import *
#
from .forms import *
#
from .api import *
apps/orgs/serializers.py
View file @
89a2a44f
...
...
@@ -8,7 +8,7 @@ from perms.models import AssetPermission
from
common.serializers
import
AdaptedBulkListSerializer
from
.utils
import
set_current_org
,
get_current_org
from
.models
import
Organization
from
.mixins
import
OrgMembershipSerializerMixin
from
.mixins
.serializers
import
OrgMembershipSerializerMixin
class
OrgSerializer
(
ModelSerializer
):
...
...
apps/perms/forms/asset_permission.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@ from __future__ import absolute_import, unicode_literals
from
django
import
forms
from
django.utils.translation
import
ugettext_lazy
as
_
from
orgs.mixins
import
OrgModelForm
from
orgs.mixins
.forms
import
OrgModelForm
from
orgs.utils
import
current_org
from
assets.models
import
Asset
,
Node
from
..models
import
AssetPermission
,
Action
...
...
apps/perms/forms/remote_app_permission.py
View file @
89a2a44f
...
...
@@ -3,7 +3,7 @@
from
django.utils.translation
import
ugettext
as
_
from
django
import
forms
from
orgs.mixins
import
OrgModelForm
from
orgs.mixins
.forms
import
OrgModelForm
from
orgs.utils
import
current_org
from
..models
import
RemoteAppPermission
...
...
apps/perms/models/asset_permission.py
View file @
89a2a44f
...
...
@@ -6,7 +6,7 @@ from django.db.models import Q
from
django.utils.translation
import
ugettext_lazy
as
_
from
common.utils
import
date_expired_default
,
set_or_append_attr_bulk
from
orgs.mixins
import
OrgModelMixin
from
orgs.mixins
.models
import
OrgModelMixin
from
assets.models
import
Asset
,
SystemUser
,
Node
from
.base
import
BasePermission
...
...
apps/perms/models/base.py
View file @
89a2a44f
...
...
@@ -5,10 +5,10 @@ import uuid
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.db
import
models
from
django.utils
import
timezone
from
orgs.mixins
import
OrgModelMixin
from
orgs.mixins
.models
import
OrgModelMixin
from
common.utils
import
date_expired_default
,
set_or_append_attr_bulk
from
orgs.mixins
import
OrgManager
from
orgs.mixins
.models
import
OrgManager
__all__
=
[
...
...
apps/perms/serializers/asset_permission.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@
from
rest_framework
import
serializers
from
common.fields
import
StringManyToManyField
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
from
perms.models
import
AssetPermission
,
Action
from
assets.models
import
Asset
...
...
apps/perms/serializers/remote_app_permission.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@
from
rest_framework
import
serializers
from
common.serializers
import
AdaptedBulkListSerializer
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
from
..models
import
RemoteAppPermission
...
...
apps/terminal/api/session.py
View file @
89a2a44f
...
...
@@ -15,7 +15,7 @@ import jms_storage
from
common.utils
import
is_uuid
,
get_logger
from
common.permissions
import
IsOrgAdminOrAppUser
,
IsAuditor
from
common.filters
import
DatetimeRangeFilter
from
orgs.mixins
import
OrgBulkModelViewSet
from
orgs.mixins
.api
import
OrgBulkModelViewSet
from
..hands
import
SystemUser
from
..models
import
Session
from
..
import
serializers
...
...
apps/terminal/backends/command/models.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@ import uuid
from
django.db
import
models
from
django.utils.translation
import
ugettext_lazy
as
_
from
orgs.mixins
import
OrgModelMixin
from
orgs.mixins
.models
import
OrgModelMixin
class
AbstractSessionCommand
(
OrgModelMixin
):
...
...
apps/terminal/models.py
View file @
89a2a44f
...
...
@@ -11,7 +11,7 @@ from django.core.files.storage import default_storage
from
django.core.cache
import
cache
from
users.models
import
User
from
orgs.mixins
import
OrgModelMixin
from
orgs.mixins
.models
import
OrgModelMixin
from
common.utils
import
get_command_storage_setting
,
get_replay_storage_setting
from
.backends
import
get_multi_command_storage
from
.backends.command.models
import
AbstractSessionCommand
...
...
apps/terminal/serializers/v1.py
View file @
89a2a44f
...
...
@@ -2,7 +2,7 @@
#
from
rest_framework
import
serializers
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
from
common.mixins
import
BulkSerializerMixin
from
common.serializers
import
AdaptedBulkListSerializer
from
..models
import
Terminal
,
Status
,
Session
,
Task
...
...
apps/users/forms.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@ from django import forms
from
django.utils.translation
import
gettext_lazy
as
_
from
common.utils
import
validate_ssh_public_key
from
orgs.mixins
import
OrgModelForm
from
orgs.mixins
.forms
import
OrgModelForm
from
orgs.utils
import
current_org
from
.models
import
User
,
UserGroup
from
.utils
import
check_password_rules
...
...
apps/users/models/group.py
View file @
89a2a44f
...
...
@@ -4,7 +4,7 @@ import uuid
from
django.db
import
models
,
IntegrityError
from
django.utils.translation
import
ugettext_lazy
as
_
from
orgs.mixins
import
OrgModelMixin
from
orgs.mixins
.models
import
OrgModelMixin
__all__
=
[
'UserGroup'
]
...
...
apps/users/serializers/v1.py
View file @
89a2a44f
...
...
@@ -8,7 +8,7 @@ from common.utils import get_signer, validate_ssh_public_key
from
common.mixins
import
BulkSerializerMixin
from
common.fields
import
StringManyToManyField
from
common.serializers
import
AdaptedBulkListSerializer
from
orgs.mixins
import
BulkOrgResourceModelSerializer
from
orgs.mixins
.serializers
import
BulkOrgResourceModelSerializer
from
..models
import
User
,
UserGroup
...
...
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