id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
40,700 | prompt.py | jumpserver_jumpserver/apps/settings/serializers/prompt.py | from rest_framework import serializers
from settings.models import ChatPrompt
class ChatPromptSerializer(serializers.ModelSerializer):
class Meta:
model = ChatPrompt
fields = [
'id', 'name', 'content', 'builtin'
]
| 257 | Python | .py | 8 | 25.75 | 56 | 0.686992 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,701 | other.py | jumpserver_jumpserver/apps/settings/serializers/other.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
__all__ = ['OtherSettingSerializer']
class OtherSettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('More...')
PERM_SINGLE_ASSET_TO_UNGROUP_NODE = serializers.BooleanField(
required=False, label=_("... | 536 | Python | .py | 13 | 35.846154 | 65 | 0.705882 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,702 | basic.py | jumpserver_jumpserver/apps/settings/serializers/basic.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from orgs.models import Organization
class BasicSettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('Basic')
SITE_URL = serializers.URLField(
required=True, label=_("Site URL"),
help_text=_(... | 1,798 | Python | .py | 39 | 38.897436 | 107 | 0.677695 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,703 | cleaning.py | jumpserver_jumpserver/apps/settings/serializers/cleaning.py | from django.conf import settings
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
__all__ = ['CleaningSerializer']
MIN_VALUE = 180 if settings.LIMIT_SUPER_PRIV else 1
class CleaningSerializer(serializers.Serializer):
PREFIX_TITLE = _('Period clean')
LOGIN_LOG_KE... | 2,105 | Python | .py | 48 | 37.395833 | 121 | 0.681131 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,704 | security.py | jumpserver_jumpserver/apps/settings/serializers/security.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from acls.serializers.rules import ip_group_help_text, ip_group_child_validator
__all__ = [
'SecurityPasswordRuleSerializer', 'SecuritySessionSerializer',
'SecurityAuthSerializer', 'SecuritySettingSerializer',
'S... | 10,060 | Python | .py | 216 | 39.162037 | 115 | 0.681971 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,705 | tool.py | jumpserver_jumpserver/apps/settings/serializers/tool.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
__all__ = [
'ToolSerializer'
]
class ToolSerializer(serializers.Serializer):
PREFIX_TITLE = _('Tool')
TOOL_USER_ENABLED = serializers.BooleanField(
label=_('Tools in the Workbench'), default=True,
... | 474 | Python | .py | 14 | 28.071429 | 85 | 0.669584 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,706 | __init__.py | jumpserver_jumpserver/apps/settings/serializers/__init__.py | # coding: utf-8
#
from .auth import *
from .basic import *
from .cleaning import *
from .feature import *
from .msg import *
from .msg import *
from .other import *
from .prompt import *
from .public import *
from .security import *
from .settings import *
from .terminal import *
from .tool import *
| 302 | Python | .py | 15 | 19.066667 | 23 | 0.751748 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,707 | public.py | jumpserver_jumpserver/apps/settings/serializers/public.py | # coding: utf-8
#
from rest_framework import serializers
__all__ = [
'PublicSettingSerializer', 'PrivateSettingSerializer', 'ServerInfoSerializer'
]
class PublicSettingSerializer(serializers.Serializer):
XPACK_ENABLED = serializers.BooleanField()
INTERFACE = serializers.DictField()
LANGUAGES = seria... | 2,982 | Python | .py | 59 | 45.881356 | 81 | 0.776366 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,708 | slack.py | jumpserver_jumpserver/apps/settings/serializers/auth/slack.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import EncryptedField
from .base import OrgListField
__all__ = ['SlackSettingSerializer']
class SlackSettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('Slack')
AUTH_SLACK =... | 1,004 | Python | .py | 19 | 47.368421 | 100 | 0.734694 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,709 | ldap.py | jumpserver_jumpserver/apps/settings/serializers/auth/ldap.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import EncryptedField
from .base import OrgListField
__all__ = [
'LDAPTestConfigSerializer', 'LDAPUserSerializer', 'LDAPTestLoginSerializer',
'LDAPSettingSerializer',
]
class LDAPTest... | 4,663 | Python | .py | 99 | 40.353535 | 100 | 0.694818 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,710 | feishu.py | jumpserver_jumpserver/apps/settings/serializers/auth/feishu.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import EncryptedField
__all__ = ['FeiShuSettingSerializer']
from .base import OrgListField
class FeiShuSettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('FeiShu')
AUTH_FEI... | 908 | Python | .py | 18 | 44.888889 | 100 | 0.7319 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,711 | dingtalk.py | jumpserver_jumpserver/apps/settings/serializers/auth/dingtalk.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import EncryptedField
from .base import OrgListField
__all__ = ['DingTalkSettingSerializer']
class DingTalkSettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('DingTalk')
DIN... | 1,021 | Python | .py | 19 | 48.263158 | 100 | 0.742227 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,712 | wecom.py | jumpserver_jumpserver/apps/settings/serializers/auth/wecom.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import EncryptedField
from .base import OrgListField
__all__ = ['WeComSettingSerializer']
class WeComSettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('WeCom')
WECOM_CORPID... | 996 | Python | .py | 19 | 46.947368 | 100 | 0.734568 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,713 | passkey.py | jumpserver_jumpserver/apps/settings/serializers/auth/passkey.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
__all__ = ['PasskeySettingSerializer']
class PasskeySettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('Passkey')
AUTH_PASSKEY = serializers.BooleanField(
default=False, label=_('Passkey'),
... | 826 | Python | .py | 18 | 39.111111 | 89 | 0.681592 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,714 | ldap_ha.py | jumpserver_jumpserver/apps/settings/serializers/auth/ldap_ha.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import EncryptedField
from .base import OrgListField
__all__ = ['LDAPHATestConfigSerializer', 'LDAPHASettingSerializer']
class LDAPHATestConfigSerializer(serializers.Serializer):
AUTH_LDA... | 4,114 | Python | .py | 85 | 41.270588 | 107 | 0.683317 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,715 | sso.py | jumpserver_jumpserver/apps/settings/serializers/auth/sso.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
__all__ = [
'SSOSettingSerializer',
]
class SSOSettingSerializer(serializers.Serializer):
"""
不对外开放了,只能通过配置文件修改,比较这个稍微有点危险
"""
PREFIX_TITLE = _('SSO')
AUTH_SSO = serializers.BooleanField(
re... | 699 | Python | .py | 18 | 30.722222 | 93 | 0.689211 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,716 | __init__.py | jumpserver_jumpserver/apps/settings/serializers/auth/__init__.py | from .base import *
from .cas import *
from .dingtalk import *
from .feishu import *
from .lark import *
from .ldap import *
from .ldap_ha import *
from .oauth2 import *
from .oidc import *
from .passkey import *
from .radius import *
from .saml2 import *
from .slack import *
from .sms import *
from .sso import *
from ... | 336 | Python | .py | 16 | 20 | 23 | 0.746875 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,717 | saml2.py | jumpserver_jumpserver/apps/settings/serializers/auth/saml2.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from .base import OrgListField
__all__ = [
'SAML2SettingSerializer',
]
class SAML2SettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('SAML2')
AUTH_SAML2 = serializers.BooleanField(
default=Fal... | 1,686 | Python | .py | 41 | 34.926829 | 107 | 0.687195 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,718 | base.py | jumpserver_jumpserver/apps/settings/serializers/auth/base.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
__all__ = [
'AuthSettingSerializer',
'OrgListField'
]
class AuthSettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('Authentication')
AUTH_LDAP = serializers.BooleanField(required=False, label=_('LD... | 2,828 | Python | .py | 54 | 44.962963 | 101 | 0.686055 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,719 | cas.py | jumpserver_jumpserver/apps/settings/serializers/auth/cas.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from .base import OrgListField
__all__ = [
'CASSettingSerializer',
]
class CASSettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('CAS')
AUTH_CAS = serializers.BooleanField(required=False, label=_('CAS... | 1,746 | Python | .py | 42 | 35.047619 | 94 | 0.677059 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,720 | oidc.py | jumpserver_jumpserver/apps/settings/serializers/auth/oidc.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import EncryptedField
from .base import OrgListField
__all__ = [
'OIDCSettingSerializer', 'KeycloakSettingSerializer',
]
class CommonSettingSerializer(serializers.Serializer):
PREFIX_... | 4,734 | Python | .py | 107 | 37.504673 | 98 | 0.687241 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,721 | radius.py | jumpserver_jumpserver/apps/settings/serializers/auth/radius.py | # coding: utf-8
#
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import EncryptedField
from .base import OrgListField
__all__ = ['RadiusSettingSerializer']
class RadiusSettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('Radi... | 942 | Python | .py | 20 | 42.8 | 109 | 0.735808 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,722 | oauth2.py | jumpserver_jumpserver/apps/settings/serializers/auth/oauth2.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import EncryptedField
from common.utils import static_or_direct
from .base import OrgListField
__all__ = [
'OAuth2SettingSerializer',
]
class SettingImageField(serializers.ImageField):
... | 2,658 | Python | .py | 62 | 36.854839 | 100 | 0.695635 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,723 | sms.py | jumpserver_jumpserver/apps/settings/serializers/auth/sms.py | from django.db import models
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.sdk.sms import BACKENDS
from common.serializers.fields import EncryptedField, PhoneField
from common.validators import PhoneValidator
__all__ = [
'BaseSMSSettingSerializer',
'... | 6,366 | Python | .py | 101 | 54.663366 | 120 | 0.717463 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,724 | lark.py | jumpserver_jumpserver/apps/settings/serializers/auth/lark.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import EncryptedField
from .base import OrgListField
__all__ = ['LarkSettingSerializer']
class LarkSettingSerializer(serializers.Serializer):
PREFIX_TITLE = 'Lark'
AUTH_LARK = serial... | 884 | Python | .py | 18 | 43.611111 | 100 | 0.728223 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,725 | filters.py | jumpserver_jumpserver/apps/terminal/filters.py | from django.db.models import QuerySet
from django_filters import rest_framework as filters
from orgs.utils import filter_org_queryset
from terminal.models import Command, CommandStorage, Session
class CommandFilter(filters.FilterSet):
date_from = filters.DateTimeFilter(method='do_nothing')
date_to = filters.... | 2,912 | Python | .py | 67 | 35.686567 | 96 | 0.646976 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,726 | mixin.py | jumpserver_jumpserver/apps/terminal/mixin.py | from terminal.utils.loki_client import get_loki_client
__all__ = ['LokiMixin', ]
class LokiMixin:
@staticmethod
def get_loki_client():
return get_loki_client()
@staticmethod
def create_loki_query(components, search):
stream_selector = '{component!=""}'
if components:
... | 447 | Python | .py | 13 | 27.769231 | 62 | 0.631702 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,727 | hands.py | jumpserver_jumpserver/apps/terminal/hands.py | # -*- coding: utf-8 -*-
#
from users.models import User
from assets.models import SystemUser
| 95 | Python | .py | 4 | 22.25 | 36 | 0.744444 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,728 | startup.py | jumpserver_jumpserver/apps/terminal/startup.py | import os
import socket
import threading
import time
from django.conf import settings
from common.db.utils import close_old_connections
from common.decorators import Singleton
from common.utils import get_disk_usage, get_cpu_load, get_memory_usage
from .const import TerminalType
from .models import Terminal
from .ser... | 3,221 | Python | .py | 88 | 27.534091 | 80 | 0.618299 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,729 | tasks.py | jumpserver_jumpserver/apps/terminal/tasks.py | # -*- coding: utf-8 -*-
#
import datetime
from itertools import chain
from celery import shared_task
from celery.utils.log import get_task_logger
from django.core.files.storage import default_storage
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from common.storage.replay i... | 7,349 | Python | .py | 189 | 33.164021 | 97 | 0.697714 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,730 | const.py | jumpserver_jumpserver/apps/terminal/const.py | # -*- coding: utf-8 -*-
#
from django.db.models import TextChoices, IntegerChoices
from django.utils.translation import gettext_lazy as _
class RiskLevelChoices(IntegerChoices):
accept = 0, _('Accept')
warning = 4, _('Warning')
reject = 5, _('Reject')
review_reject = 6, _('Review & Reject')
revie... | 2,898 | Python | .py | 81 | 31.061728 | 79 | 0.627507 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,731 | apps.py | jumpserver_jumpserver/apps/terminal/apps.py | from __future__ import unicode_literals
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class TerminalConfig(AppConfig):
name = 'terminal'
verbose_name = _('App Terminals')
def ready(self):
from . import signal_handlers # noqa
from . import notif... | 404 | Python | .py | 11 | 31.363636 | 54 | 0.694087 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,732 | exceptions.py | jumpserver_jumpserver/apps/terminal/exceptions.py | from django.utils.translation import gettext_lazy as _
from common.exceptions import JMSException
class BulkCreateNotSupport(JMSException):
default_code = 'bulk_create_not_support'
default_detail = _('Bulk create not support')
class StorageInvalid(JMSException):
default_code = 'storage_invalid'
def... | 358 | Python | .py | 8 | 41.125 | 54 | 0.77971 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,733 | session_lifecycle.py | jumpserver_jumpserver/apps/terminal/session_lifecycle.py | from django.utils.translation import gettext_noop
from audits.const import ActivityChoices
from audits.models import ActivityLog
from common.utils import i18n_fmt
from terminal.models import Session
class SessionLifecycleEventBase(object):
def __init__(self, session: Session, reason, *args, **kwargs):
s... | 5,301 | Python | .py | 124 | 36.846774 | 81 | 0.715512 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,734 | ws.py | jumpserver_jumpserver/apps/terminal/ws.py | import datetime
from threading import Thread
from channels.generic.websocket import JsonWebsocketConsumer
from django.utils import timezone
from rest_framework.renderers import JSONRenderer
from common.db.utils import safe_db_connection
from common.utils import get_logger
from common.utils.connection import Subscript... | 4,051 | Python | .py | 96 | 33.489583 | 101 | 0.656705 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,735 | permissions.py | jumpserver_jumpserver/apps/terminal/permissions.py | from rest_framework import permissions
from common.utils import get_logger
logger = get_logger(__file__)
__all__ = ['IsSessionAssignee']
class IsSessionAssignee(permissions.IsAuthenticated):
def has_permission(self, request, view):
if not request.user:
return False
if request.user.i... | 703 | Python | .py | 19 | 28.947368 | 84 | 0.653392 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,736 | notifications.py | jumpserver_jumpserver/apps/terminal/notifications.py | from typing import Callable
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.translation import gettext_lazy as _
from common.sdk.im.wecom import wecom_tool
from common.utils import get_logger, reverse
from common.utils import lazyproperty
from common.utils.timezo... | 10,147 | Python | .py | 252 | 31.277778 | 97 | 0.61287 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,737 | connect_methods.py | jumpserver_jumpserver/apps/terminal/connect_methods.py | # -*- coding: utf-8 -*-
#
import itertools
from collections import defaultdict
from django.conf import settings
from django.db.models import TextChoices
from django.utils.translation import gettext_lazy as _
from assets.const import Protocol
from .const import TerminalType
class WebMethod(TextChoices):
web_gui ... | 12,702 | Python | .py | 296 | 29.037162 | 103 | 0.548635 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,738 | __init__.py | jumpserver_jumpserver/apps/terminal/models/__init__.py | from .session import *
from .component import *
from .applet import *
from .virtualapp import *
| 96 | Python | .py | 4 | 23 | 25 | 0.782609 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,739 | host.py | jumpserver_jumpserver/apps/terminal/models/applet/host.py | from collections import defaultdict
from django.db import models
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from rest_framework.exceptions import ValidationError
from simple_history.utils import bulk_create_with_history
from assets.models import Host
from common.db.models... | 7,497 | Python | .py | 153 | 39.594771 | 106 | 0.66381 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,740 | applet.py | jumpserver_jumpserver/apps/terminal/models/applet/applet.py | import os.path
import random
import shutil
from collections import defaultdict
import yaml
from django.conf import settings
from django.core.cache import cache
from django.core.files.storage import default_storage
from django.db import models
from django.utils.translation import gettext_lazy as _
from rest_framework.s... | 13,992 | Python | .py | 284 | 38.940141 | 117 | 0.638735 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,741 | sharing.py | jumpserver_jumpserver/apps/terminal/models/session/sharing.py | import datetime
from django.db import models
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from django.utils.functional import cached_property
from common.db.models import JMSBaseModel
from common.utils import is_uuid
from orgs.mixins.models import OrgModelMixin
from orgs.ut... | 5,605 | Python | .py | 149 | 30.362416 | 80 | 0.641937 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,742 | replay.py | jumpserver_jumpserver/apps/terminal/models/session/replay.py | from django.db import models
from django.utils.translation import gettext_lazy as _
from common.db.models import JMSBaseModel
from .session import Session
class SessionReplay(JMSBaseModel):
session = models.ForeignKey(Session, on_delete=models.CASCADE, verbose_name=_("Session"))
class Meta:
verbose_... | 525 | Python | .py | 12 | 37.75 | 93 | 0.70334 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,743 | command.py | jumpserver_jumpserver/apps/terminal/models/session/command.py | from __future__ import unicode_literals
from django.db import models
from django.db.models.signals import post_save
from django.utils.translation import gettext_lazy as _
from terminal.backends.command.models import AbstractSessionCommand
class CommandManager(models.Manager):
def bulk_create(self, objs, **kwarg... | 2,254 | Python | .py | 63 | 26.444444 | 67 | 0.592287 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,744 | __init__.py | jumpserver_jumpserver/apps/terminal/models/session/__init__.py | from .command import *
from .replay import *
from .session import *
from .sharing import *
| 91 | Python | .py | 4 | 21.75 | 22 | 0.770115 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,745 | session.py | jumpserver_jumpserver/apps/terminal/models/session/session.py | from __future__ import unicode_literals
import os
import uuid
from datetime import timedelta
from django.conf import settings
from django.core.cache import cache
from django.core.files.storage import default_storage
from django.db import models
from django.utils import timezone
from django.utils.translation import ge... | 12,366 | Python | .py | 273 | 35.278388 | 119 | 0.634689 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,746 | terminal.py | jumpserver_jumpserver/apps/terminal/models/component/terminal.py | import uuid
from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.utils.translation import gettext_lazy as _
from common.const.signals import SKIP_SIGNAL
from common.db.models import JMSBaseModel
from common.utils import get_logger, lazyproperty
from orgs.utils ... | 5,752 | Python | .py | 147 | 31.204082 | 109 | 0.65148 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,747 | status.py | jumpserver_jumpserver/apps/terminal/models/component/status.py | import uuid
from django.core.cache import cache
from django.db import models
from django.forms.models import model_to_dict
from django.utils.translation import gettext_lazy as _
from common.utils import get_logger
logger = get_logger(__name__)
class Status(models.Model):
id = models.UUIDField(default=uuid.uuid... | 2,297 | Python | .py | 54 | 35.092593 | 90 | 0.65233 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,748 | endpoint.py | jumpserver_jumpserver/apps/terminal/models/component/endpoint.py | from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from django.db.models import Prefetch
from django.utils.translation import gettext_lazy as _
from assets.models import Asset
from common.db.fields import PortField
from common.db.models import JMSBaseModel
from common.... | 6,105 | Python | .py | 130 | 38.138462 | 103 | 0.648771 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,749 | __init__.py | jumpserver_jumpserver/apps/terminal/models/component/__init__.py | from .terminal import *
from .task import *
from .endpoint import *
from .status import *
from .storage import *
| 113 | Python | .py | 5 | 21.6 | 23 | 0.768519 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,750 | storage.py | jumpserver_jumpserver/apps/terminal/models/component/storage.py | from __future__ import unicode_literals
import copy
import os
from importlib import import_module
from django.conf import settings
from django.db import models
from django.utils.translation import gettext_lazy as _
from common.db.fields import EncryptJsonDictTextField
from common.db.models import JMSBaseModel
from c... | 6,324 | Python | .py | 168 | 29.5 | 91 | 0.654112 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,751 | task.py | jumpserver_jumpserver/apps/terminal/models/component/task.py | from __future__ import unicode_literals
from django.db import models
from django.utils.translation import gettext_lazy as _
from common.db.models import JMSBaseModel
from terminal.const import TaskNameType as SessionTaskChoices
from .terminal import Terminal
class Task(JMSBaseModel):
name = models.CharField(ma... | 896 | Python | .py | 18 | 45.277778 | 103 | 0.750861 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,752 | provider.py | jumpserver_jumpserver/apps/terminal/models/virtualapp/provider.py | from django.db import models
from django.utils.translation import gettext_lazy as _
from common.db.models import JMSBaseModel
__all__ = ['AppProvider', ]
class AppProvider(JMSBaseModel):
name = models.CharField(max_length=128, verbose_name=_('Name'), unique=True)
hostname = models.CharField(max_length=128, ... | 928 | Python | .py | 23 | 34.217391 | 80 | 0.676307 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,753 | virtualapp.py | jumpserver_jumpserver/apps/terminal/models/virtualapp/virtualapp.py | import os
import shutil
from django.conf import settings
from django.core.files.storage import default_storage
from django.db import models
from django.utils._os import safe_join
from django.utils.translation import gettext_lazy as _
from rest_framework.serializers import ValidationError
from common.db.models import ... | 3,980 | Python | .py | 85 | 39.870588 | 108 | 0.675006 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,754 | 0003_auto_20171230_0308.py | jumpserver_jumpserver/apps/terminal/migrations/0003_auto_20171230_0308.py | # Generated by Django 2.2.5 on 2019-11-25 01:31
from django.conf import settings
from django.db import migrations
def get_storage_data(s):
from common.utils import signer
import json
value = s.value
encrypted = s.encrypted
if encrypted:
value = signer.unsign(value)
try:
value... | 3,414 | Python | .py | 114 | 22.885965 | 64 | 0.587016 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,755 | 0001_initial.py | jumpserver_jumpserver/apps/terminal/migrations/0001_initial.py | # Generated by Django 4.1.13 on 2024-05-09 03:16
import uuid
import django.core.validators
import django.utils.timezone
from django.db import migrations, models
import common.db.fields
import terminal.models.component.terminal
class Migration(migrations.Migration):
initial = True
dependencies = [
... | 30,541 | Python | .py | 411 | 59.518248 | 403 | 0.60089 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,756 | 0002_auto_20171228_0025.py | jumpserver_jumpserver/apps/terminal/migrations/0002_auto_20171228_0025.py | # Generated by Django 4.1.13 on 2024-05-09 03:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('terminal', '0001_initial'),
migrations.swappable_dependency(se... | 5,479 | Python | .py | 115 | 36.991304 | 185 | 0.634378 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,757 | 0004_endpoint_is_active.py | jumpserver_jumpserver/apps/terminal/migrations/0004_endpoint_is_active.py | # Generated by Django 4.1.13 on 2024-09-25 07:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('terminal', '0003_auto_20171230_0308'),
]
operations = [
migrations.AddField(
model_name='endpoint',
name='is_active... | 416 | Python | .py | 13 | 24.769231 | 75 | 0.628141 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,758 | components.py | jumpserver_jumpserver/apps/terminal/utils/components.py | # -*- coding: utf-8 -*-
#
from itertools import groupby
from common.utils import get_logger
from terminal.const import ComponentLoad, TerminalType
logger = get_logger(__name__)
class ComputeLoadUtil:
# system status
@staticmethod
def _common_compute_system_status(value, thresholds):
if threshold... | 6,948 | Python | .py | 157 | 32.509554 | 105 | 0.599309 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,759 | __init__.py | jumpserver_jumpserver/apps/terminal/utils/__init__.py | from .components import *
from .common import *
from .db_port_mapper import *
| 78 | Python | .py | 3 | 25 | 29 | 0.773333 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,760 | loki_client.py | jumpserver_jumpserver/apps/terminal/utils/loki_client.py | import urllib.parse
import requests
from django.conf import settings
from websockets.sync.client import connect as ws_connect
def get_loki_client():
# TODO: 补充 auth 认证相关
return LokiClient(base_url=settings.LOKI_BASE_URL)
# https://grafana.com/docs/loki/latest/reference/loki-http-api/
class LokiClient(obje... | 1,553 | Python | .py | 43 | 28.186047 | 63 | 0.59973 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,761 | common.py | jumpserver_jumpserver/apps/terminal/utils/common.py | # -*- coding: utf-8 -*-
#
from common.utils import get_logger
from tickets.models import TicketSession
logger = get_logger(__name__)
def is_session_approver(session_id, user_id):
ticket = TicketSession.get_ticket_by_session_id(session_id)
if not ticket:
return False
ok = ticket.has_all_assignee(... | 343 | Python | .py | 11 | 27.636364 | 63 | 0.719512 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,762 | db_port_mapper.py | jumpserver_jumpserver/apps/terminal/utils/db_port_mapper.py | from django.conf import settings
from django.core.cache import cache
from django.utils.translation import gettext_lazy as _
from assets.const import DatabaseTypes
from assets.models import Database
from common.decorators import Singleton
from common.exceptions import JMSException
from common.utils import get_logger, g... | 5,574 | Python | .py | 131 | 32.793893 | 96 | 0.604338 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,763 | __init__.py | jumpserver_jumpserver/apps/terminal/applets/__init__.py | import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def install_or_update_builtin_applets():
from terminal.models import Applet
applets = os.listdir(BASE_DIR)
for d in applets:
path = os.path.join(BASE_DIR, d)
if not os.path.isdir(path) or not os.path.exists(os.path.join(path... | 608 | Python | .py | 16 | 30.375 | 93 | 0.619454 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,764 | app.py | jumpserver_jumpserver/apps/terminal/applets/dbeaver/app.py | import os
import shutil
import subprocess
import time
from xml.etree import ElementTree
from xml.sax import SAXException
import win32api
from common import wait_pid, BaseApplication
_default_path = r'C:\Program Files\DBeaver\dbeaver-cli.exe'
class AppletApplication(BaseApplication):
def __init__(self, *args, *... | 5,559 | Python | .py | 131 | 32.175573 | 93 | 0.59541 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,765 | main.py | jumpserver_jumpserver/apps/terminal/applets/dbeaver/main.py | import sys
from common import (block_input, unblock_input)
from common import convert_base64_to_dict
from app import AppletApplication
def main():
base64_str = sys.argv[1]
data = convert_base64_to_dict(base64_str)
applet_app = AppletApplication(**data)
block_input()
applet_app.run()
unblock_i... | 446 | Python | .py | 17 | 21.882353 | 47 | 0.674528 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,766 | common.py | jumpserver_jumpserver/apps/terminal/applets/dbeaver/common.py | import abc
import base64
import json
import locale
import os
import subprocess
import sys
import time
from subprocess import CREATE_NO_WINDOW
_blockInput = None
_messageBox = None
if sys.platform == 'win32':
import ctypes
from ctypes import wintypes
import win32ui
# import win32con
_messageBox = ... | 5,415 | Python | .py | 177 | 24 | 101 | 0.625048 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,767 | code_dialog.py | jumpserver_jumpserver/apps/terminal/applets/chrome/code_dialog.py | import functools
import threading
import tkinter as tk
from tkinter import StringVar, messagebox
from tkinter import ttk
class CodeDialog(object):
def __init__(self, title=None, label="Code Dialog"):
self.root = tk.Tk()
self.root.title(title)
self.code = StringVar()
mainframe = tt... | 3,172 | Python | .py | 85 | 28.752941 | 95 | 0.607048 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,768 | app.py | jumpserver_jumpserver/apps/terminal/applets/chrome/app.py | import os
import tempfile
import time
from enum import Enum
from subprocess import CREATE_NO_WINDOW
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.remote.webelement import WebElement
from code_dialog import CodeD... | 10,104 | Python | .py | 252 | 29.623016 | 102 | 0.592045 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,769 | main.py | jumpserver_jumpserver/apps/terminal/applets/chrome/main.py | import sys
from common import (block_input, unblock_input)
from common import convert_base64_to_dict
from app import AppletApplication
def main():
base64_str = sys.argv[1]
data = convert_base64_to_dict(base64_str)
applet_app = AppletApplication(**data)
block_input()
applet_app.run()
unblock_i... | 446 | Python | .py | 17 | 21.882353 | 47 | 0.674528 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,770 | common.py | jumpserver_jumpserver/apps/terminal/applets/chrome/common.py | import abc
import base64
import json
import locale
import os
import subprocess
import sys
import time
from subprocess import CREATE_NO_WINDOW
from threading import Thread
_blockInput = None
_messageBox = None
if sys.platform == 'win32':
import ctypes
from ctypes import wintypes
import win32ui
# import... | 5,742 | Python | .py | 186 | 24.11828 | 101 | 0.627671 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,771 | api_urls.py | jumpserver_jumpserver/apps/terminal/urls/api_urls.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from django.urls import path
from rest_framework_bulk.routes import BulkRouter
from .. import api
app_name = 'terminal'
router = BulkRouter()
router.register(r'sessions', api.SessionViewSet, 'session')
router.register(r'terminals/((?P<terminal>[^/.]{36})/)?status', ap... | 3,720 | Python | .py | 54 | 66 | 115 | 0.75765 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,772 | ws_urls.py | jumpserver_jumpserver/apps/terminal/urls/ws_urls.py | from django.urls import path
from .. import ws
app_name = 'terminal'
urlpatterns = [
path('ws/terminal-task/', ws.TerminalTaskWebsocket.as_asgi(), name='terminal-task-ws'),
path('ws/component-log-tail/', ws.LokiTailWebsocket.as_asgi(), name='component-log-tail-ws'),
]
| 280 | Python | .py | 7 | 37.428571 | 97 | 0.725926 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,773 | db_listen_port.py | jumpserver_jumpserver/apps/terminal/api/db_listen_port.py | # coding: utf-8
#
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework.viewsets import GenericViewSet
from assets.serializers.asset.database import DatabaseWithGatewaySerializer
from orgs.utils import tmp_to_org
from ..utils imp... | 1,116 | Python | .py | 26 | 37.923077 | 76 | 0.72366 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,774 | __init__.py | jumpserver_jumpserver/apps/terminal/api/__init__.py | # -*- coding: utf-8 -*-
#
from .applet import *
from .component import *
from .db_listen_port import *
from .session import *
from .virtualapp import *
| 152 | Python | .py | 7 | 20.714286 | 29 | 0.717241 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,775 | host.py | jumpserver_jumpserver/apps/terminal/api/applet/host.py | import uuid
from django.db import transaction
from rest_framework import status
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
from common.api import JMSBulkModelViewSet
from common.permissions import IsServiceAccount
from orgs.utils impor... | 5,510 | Python | .py | 107 | 43.224299 | 114 | 0.683937 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,776 | __init__.py | jumpserver_jumpserver/apps/terminal/api/applet/__init__.py | from .applet import *
from .host import *
from .relation import *
| 66 | Python | .py | 3 | 21 | 23 | 0.761905 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,777 | applet.py | jumpserver_jumpserver/apps/terminal/api/applet/applet.py | import os
import os.path
import re
import shutil
import zipfile
from typing import Callable
from django.conf import settings
from django.core.files.storage import default_storage
from django.http import HttpResponse
from django.shortcuts import get_object_or_404
from django.utils.translation import gettext as _, get_l... | 7,115 | Python | .py | 157 | 37.171975 | 107 | 0.652425 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,778 | relation.py | jumpserver_jumpserver/apps/terminal/api/applet/relation.py | from typing import Callable
from django.shortcuts import get_object_or_404
from django.conf import settings
from rest_framework.request import Request
from rest_framework.decorators import action
from rest_framework.response import Response
from common.api import JMSModelViewSet
from common.permissions import IsServi... | 2,692 | Python | .py | 71 | 31.28169 | 83 | 0.709405 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,779 | sharing.py | jumpserver_jumpserver/apps/terminal/api/session/sharing.py | from django.conf import settings
from django.utils.translation import gettext_lazy as _
from rest_framework.decorators import action
from rest_framework.exceptions import MethodNotAllowed, ValidationError
from rest_framework.response import Response
from common.const.http import PATCH
from orgs.mixins.api import OrgMo... | 2,668 | Python | .py | 63 | 35.349206 | 82 | 0.687765 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,780 | command.py | jumpserver_jumpserver/apps/terminal/api/session/command.py | # -*- coding: utf-8 -*-
#
import uuid
from django.utils import timezone
from rest_framework import generics
from rest_framework.fields import DateTimeField
from rest_framework.response import Response
from acls.models import CommandFilterACL, CommandGroup
from common.api import JMSBulkModelViewSet
from common.utils im... | 9,272 | Python | .py | 204 | 35.465686 | 105 | 0.638823 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,781 | __init__.py | jumpserver_jumpserver/apps/terminal/api/session/__init__.py | from .session import *
from .sharing import *
from .command import *
from .task import *
| 89 | Python | .py | 4 | 21.25 | 22 | 0.764706 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,782 | task.py | jumpserver_jumpserver/apps/terminal/api/session/task.py | # -*- coding: utf-8 -*-
#
import logging
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.permissions import IsAuthenticated
from rest_framework.views import APIView, Response
from common.api import JMSBulkModelViewSet
from common.const.http import POST
from common.ut... | 3,918 | Python | .py | 85 | 38.729412 | 102 | 0.688615 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,783 | session.py | jumpserver_jumpserver/apps/terminal/api/session/session.py | # -*- coding: utf-8 -*-
#
import os
import tarfile
from django.core.files.storage import default_storage
from django.db.models import F
from django.http import FileResponse
from django.shortcuts import get_object_or_404, reverse
from django.utils.encoding import escape_uri_path
from django.utils.translation import get... | 13,843 | Python | .py | 300 | 36.833333 | 108 | 0.650461 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,784 | terminal.py | jumpserver_jumpserver/apps/terminal/api/component/terminal.py | # -*- coding: utf-8 -*-
#
import logging
from django.db.models import Q
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from rest_framework import generics
from rest_framework import status
from rest_framework.views import APIView, Response
from django_filters import rest_framewo... | 3,047 | Python | .py | 73 | 35.506849 | 87 | 0.709066 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,785 | status.py | jumpserver_jumpserver/apps/terminal/api/component/status.py | # -*- coding: utf-8 -*-
#
import datetime
import logging
from django.utils import timezone
from django.shortcuts import get_object_or_404
from rest_framework import viewsets, generics
from rest_framework.views import Response
from rest_framework import status
from terminal.models import Terminal, Status, Session
from... | 2,389 | Python | .py | 53 | 38.660377 | 110 | 0.724033 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,786 | endpoint.py | jumpserver_jumpserver/apps/terminal/api/component/endpoint.py | from django.shortcuts import get_object_or_404
from django.utils.translation import gettext_lazy as _
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.request import Request
from rest_framework.response import Response
from assets.models import Asset
from authenticatio... | 3,583 | Python | .py | 81 | 36.320988 | 105 | 0.693558 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,787 | __init__.py | jumpserver_jumpserver/apps/terminal/api/component/__init__.py | from .connect_methods import *
from .endpoint import *
from .loki_log import *
from .status import *
from .storage import *
from .terminal import *
| 148 | Python | .py | 6 | 23.666667 | 30 | 0.774648 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,788 | storage.py | jumpserver_jumpserver/apps/terminal/api/component/storage.py | # coding: utf-8
#
from django.utils.translation import gettext_lazy as _
from django_filters import rest_framework as drf_filters
from django_filters import utils
from rest_framework import viewsets, generics, status
from rest_framework.decorators import action
from rest_framework.request import Request
from rest_fram... | 5,712 | Python | .py | 132 | 32.787879 | 96 | 0.613211 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,789 | connect_methods.py | jumpserver_jumpserver/apps/terminal/api/component/connect_methods.py | # -*- coding: utf-8 -*-
#
import itertools
from rest_framework import generics
from rest_framework.views import Response
from common.permissions import IsValidUser
from common.utils import get_request_os, is_true, distinct
from terminal import serializers
from terminal.connect_methods import ConnectMethodUtil
__all_... | 1,167 | Python | .py | 26 | 39 | 96 | 0.728395 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,790 | loki_log.py | jumpserver_jumpserver/apps/terminal/api/component/loki_log.py | from rest_framework.response import Response
from rest_framework.views import APIView
from common.permissions import OnlySuperUser
from common.utils import get_logger
from terminal import serializers
from terminal.mixin import LokiMixin
__all__ = ['LokiLogAPI', ]
logger = get_logger(__name__)
class LokiLogAPI(APIV... | 1,335 | Python | .py | 28 | 41.285714 | 83 | 0.702012 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,791 | provider.py | jumpserver_jumpserver/apps/terminal/api/virtualapp/provider.py | from django.core.cache import cache
from rest_framework.decorators import action
from rest_framework.exceptions import ValidationError
from rest_framework.response import Response
from common.api import JMSBulkModelViewSet
from common.permissions import IsServiceAccount
from orgs.utils import tmp_to_builtin_org
from t... | 2,424 | Python | .py | 54 | 38.296296 | 91 | 0.698305 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,792 | __init__.py | jumpserver_jumpserver/apps/terminal/api/virtualapp/__init__.py | from .provider import *
from .relation import *
from .virtualapp import *
| 74 | Python | .py | 3 | 23.666667 | 25 | 0.788732 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,793 | virtualapp.py | jumpserver_jumpserver/apps/terminal/api/virtualapp/virtualapp.py | import os.path
import shutil
import zipfile
from typing import Callable
from django.core.files.storage import default_storage
from django.utils._os import safe_join
from django.utils.translation import gettext as _
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.req... | 2,999 | Python | .py | 65 | 39.661538 | 97 | 0.704312 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,794 | relation.py | jumpserver_jumpserver/apps/terminal/api/virtualapp/relation.py | from typing import Callable
from django.conf import settings
from django.shortcuts import get_object_or_404
from rest_framework.request import Request
from common.api import JMSModelViewSet
from common.permissions import IsServiceAccount
from common.utils import is_uuid
from rbac.permissions import RBACPermission
fro... | 1,877 | Python | .py | 52 | 29.480769 | 82 | 0.696635 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,795 | install_builtin_applets.py | jumpserver_jumpserver/apps/terminal/management/commands/install_builtin_applets.py | from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Install builtin applets'
def handle(self, *args, **options):
from terminal.applets import install_or_update_builtin_applets
install_or_update_builtin_applets()
| 275 | Python | .py | 6 | 40.333333 | 70 | 0.75188 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,796 | __init__.py | jumpserver_jumpserver/apps/terminal/backends/__init__.py | from importlib import import_module
from django.conf import settings
from django.utils.functional import LazyObject
from common.utils import get_logger
logger = get_logger(__file__)
TYPE_ENGINE_MAPPING = {
'elasticsearch': 'terminal.backends.command.es',
'es': 'terminal.backends.command.es',
}
def get_comm... | 1,809 | Python | .py | 48 | 31.8125 | 69 | 0.71027 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,797 | db.py | jumpserver_jumpserver/apps/terminal/backends/command/db.py | # ~*~ coding: utf-8 ~*~
import datetime
from django.db import transaction
from django.db.utils import OperationalError
from django.utils import timezone
from common.utils.common import pretty_string
from .base import CommandBase
class CommandStore(CommandBase):
def __init__(self, params):
from terminal... | 4,408 | Python | .py | 110 | 28.9 | 78 | 0.579494 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,798 | models.py | jumpserver_jumpserver/apps/terminal/backends/command/models.py | # -*- coding: utf-8 -*-
#
import uuid
from datetime import datetime
from django.db import models
from django.utils.translation import gettext_lazy as _
from common.utils.common import lazyproperty
from orgs.mixins.models import OrgModelMixin
from terminal.const import RiskLevelChoices
class AbstractSessionCommand(O... | 1,737 | Python | .py | 42 | 35.380952 | 89 | 0.699881 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,799 | es.py | jumpserver_jumpserver/apps/terminal/backends/command/es.py | # -*- coding: utf-8 -*-
#
import pytz
from datetime import datetime
from common.utils import get_logger
from common.plugins.es import ES
logger = get_logger(__file__)
class CommandStore(ES):
def __init__(self, config):
properties = {
"session": {
"type": "keyword"
... | 1,668 | Python | .py | 48 | 25.375 | 88 | 0.547205 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |