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,600 | __init__.py | jumpserver_jumpserver/apps/accounts/api/automations/__init__.py | from .backup import *
from .base import *
from .change_secret import *
from .gather_accounts import *
from .push_account import *
| 130 | Python | .py | 5 | 25 | 30 | 0.776 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,601 | base.py | jumpserver_jumpserver/apps/accounts/api/automations/base.py | from django.shortcuts import get_object_or_404
from django.utils.translation import gettext_lazy as _
from rest_framework import status, mixins, viewsets
from rest_framework.response import Response
from accounts.models import AutomationExecution
from accounts.tasks import execute_account_automation_task
from assets i... | 4,112 | Python | .py | 92 | 37.271739 | 95 | 0.69377 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,602 | __init__.py | jumpserver_jumpserver/apps/accounts/backends/__init__.py | from importlib import import_module
from django.utils.functional import LazyObject
from common.utils import get_logger
from ..const import VaultTypeChoices
__all__ = ['vault_client', 'get_vault_client']
logger = get_logger(__file__)
def get_vault_client(raise_exception=False, **kwargs):
enabled = kwargs.get(... | 1,325 | Python | .py | 29 | 38.206897 | 95 | 0.691129 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,603 | base.py | jumpserver_jumpserver/apps/accounts/backends/base.py | from abc import ABC, abstractmethod
from django.forms.models import model_to_dict
__all__ = ['BaseVault']
class BaseVault(ABC):
def __init__(self, *args, **kwargs):
self.enabled = kwargs.get('VAULT_ENABLED')
def get(self, instance):
""" 返回 secret 值 """
return self._get(instance)
... | 1,987 | Python | .py | 54 | 28.722222 | 70 | 0.6387 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,604 | entries.py | jumpserver_jumpserver/apps/accounts/backends/hcp/entries.py | import sys
from abc import ABC
from common.db.utils import Encryptor
from common.utils import lazyproperty
current_module = sys.modules[__name__]
__all__ = ['build_entry']
class BaseEntry(ABC):
def __init__(self, instance):
self.instance = instance
@lazyproperty
def full_path(self):
p... | 1,995 | Python | .py | 61 | 26.147541 | 77 | 0.654108 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,605 | service.py | jumpserver_jumpserver/apps/accounts/backends/hcp/service.py | # -*- coding: utf-8 -*-
#
import hvac
from hvac import exceptions
from requests.exceptions import ConnectionError
from common.utils import get_logger
logger = get_logger(__name__)
__all__ = ['VaultKVClient']
class VaultKVClient(object):
max_versions = 20
def __init__(self, url, token, mount_point):
... | 3,297 | Python | .py | 87 | 27.321839 | 83 | 0.587823 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,606 | main.py | jumpserver_jumpserver/apps/accounts/backends/hcp/main.py | from common.db.utils import get_logger
from .entries import build_entry
from .service import VaultKVClient
from ..base import BaseVault
__all__ = ['Vault']
logger = get_logger(__name__)
class Vault(BaseVault):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.client = V... | 1,682 | Python | .py | 42 | 31.928571 | 80 | 0.637322 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,607 | main.py | jumpserver_jumpserver/apps/accounts/backends/local/main.py | from common.utils import get_logger
from ..base import BaseVault
logger = get_logger(__name__)
__all__ = ['Vault']
class Vault(BaseVault):
def is_active(self):
return True, ''
def _get(self, instance):
secret = getattr(instance, '_secret', None)
return secret
def _create(self,... | 709 | Python | .py | 25 | 21 | 51 | 0.570776 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,608 | methods.py | jumpserver_jumpserver/apps/accounts/automations/methods.py | import os
from assets.automations.methods import get_platform_automation_methods
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
platform_automation_methods = get_platform_automation_methods(BASE_DIR)
| 209 | Python | .py | 4 | 50.75 | 71 | 0.82266 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,609 | endpoint.py | jumpserver_jumpserver/apps/accounts/automations/endpoint.py | from .backup_account.manager import AccountBackupManager
from .change_secret.manager import ChangeSecretManager
from .gather_accounts.manager import GatherAccountsManager
from .push_account.manager import PushAccountManager
from .remove_account.manager import RemoveAccountManager
from .verify_account.manager import Ver... | 1,226 | Python | .py | 24 | 44.666667 | 82 | 0.786565 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,610 | manager.py | jumpserver_jumpserver/apps/accounts/automations/remove_account/manager.py | import os
from copy import deepcopy
from django.db.models import QuerySet
from accounts.const import AutomationTypes
from accounts.models import Account
from common.utils import get_logger
from ..base.manager import AccountBasePlaybookManager
logger = get_logger(__name__)
class RemoveAccountManager(AccountBasePlay... | 2,510 | Python | .py | 55 | 36.872727 | 102 | 0.653689 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,611 | handlers.py | jumpserver_jumpserver/apps/accounts/automations/backup_account/handlers.py | import os
import time
from collections import defaultdict, OrderedDict
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from xlsxwriter import Workbook
from accounts.const import AccountBackupType
from accounts.models.automations.backup_acc... | 11,861 | Python | .py | 274 | 33 | 107 | 0.602389 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,612 | manager.py | jumpserver_jumpserver/apps/accounts/automations/backup_account/manager.py | # -*- coding: utf-8 -*-
#
import time
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from common.utils.timezone import local_now_display
from .handlers import AccountBackupHandler
class AccountBackupManager:
def __init__(self, execution):
self.execution = execut... | 1,480 | Python | .py | 39 | 30.871795 | 96 | 0.640363 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,613 | filter.py | jumpserver_jumpserver/apps/accounts/automations/gather_accounts/filter.py | import re
from django.utils import timezone
__all__ = ['GatherAccountsFilter']
# TODO 后期会挪到playbook中
class GatherAccountsFilter:
def __init__(self, tp):
self.tp = tp
@staticmethod
def mysql_filter(info):
result = {}
for _, user_dict in info.items():
for username, _ ... | 2,313 | Python | .py | 63 | 26.253968 | 89 | 0.52965 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,614 | manager.py | jumpserver_jumpserver/apps/accounts/automations/gather_accounts/manager.py | from collections import defaultdict
from accounts.const import AutomationTypes
from accounts.models import GatheredAccount
from assets.models import Asset
from common.utils import get_logger
from orgs.utils import tmp_to_org
from users.models import User
from .filter import GatherAccountsFilter
from ..base.manager imp... | 5,254 | Python | .py | 112 | 36.705357 | 95 | 0.632454 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,615 | manager.py | jumpserver_jumpserver/apps/accounts/automations/push_account/manager.py | from accounts.const import AutomationTypes
from common.utils import get_logger
from ..base.manager import AccountBasePlaybookManager
from ..change_secret.manager import ChangeSecretManager
logger = get_logger(__name__)
class PushAccountManager(ChangeSecretManager, AccountBasePlaybookManager):
@classmethod
d... | 3,051 | Python | .py | 68 | 40.073529 | 96 | 0.612697 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,616 | manager.py | jumpserver_jumpserver/apps/accounts/automations/change_secret/manager.py | import os
import time
from copy import deepcopy
from django.conf import settings
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from xlsxwriter import Workbook
from accounts.const import AutomationTypes, SecretType, SSHKeyStrategy, SecretStrategy, ChangeSecretRecordStatusChoi... | 11,436 | Python | .py | 254 | 34.023622 | 118 | 0.612741 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,617 | manager.py | jumpserver_jumpserver/apps/accounts/automations/verify_account/manager.py | import os
from copy import deepcopy
from django.db.models import QuerySet
from accounts.const import AutomationTypes, Connectivity, SecretType
from common.utils import get_logger
from ..base.manager import AccountBasePlaybookManager
logger = get_logger(__name__)
class VerifyAccountManager(AccountBasePlaybookManage... | 3,290 | Python | .py | 72 | 35.402778 | 102 | 0.616682 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,618 | manager.py | jumpserver_jumpserver/apps/accounts/automations/base/manager.py | from accounts.automations.methods import platform_automation_methods
from assets.automations.base.manager import BasePlaybookManager
from common.utils import get_logger
logger = get_logger(__name__)
class AccountBasePlaybookManager(BasePlaybookManager):
@property
def platform_automation_methods(self):
... | 358 | Python | .py | 8 | 41.25 | 68 | 0.83237 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,619 | manager.py | jumpserver_jumpserver/apps/accounts/automations/verify_gateway_account/manager.py | from django.utils.translation import gettext_lazy as _
from accounts.const import AutomationTypes
from assets.automations.ping_gateway.manager import PingGatewayManager
from common.utils import get_logger
logger = get_logger(__name__)
class VerifyGatewayAccountManager(PingGatewayManager):
@classmethod
def ... | 717 | Python | .py | 16 | 39.625 | 91 | 0.762248 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,620 | template.py | jumpserver_jumpserver/apps/accounts/serializers/account/template.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from accounts.const import SecretStrategy, SecretType
from accounts.models import AccountTemplate
from accounts.utils import SecretGenerator
from common.serializers import SecretReadableMixin
from common.serializers.fields im... | 3,855 | Python | .py | 73 | 45.109589 | 119 | 0.694511 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,621 | backup.py | jumpserver_jumpserver/apps/accounts/serializers/account/backup.py | # -*- coding: utf-8 -*-
#
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from accounts.models import AccountBackupAutomation, AccountBackupExecution
from common.const.choices import Trigger
from common.serializers.fields import LabeledChoiceField, EncryptedField
from comm... | 2,196 | Python | .py | 47 | 38.893617 | 108 | 0.663084 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,622 | account.py | jumpserver_jumpserver/apps/accounts/serializers/account/account.py | import uuid
from copy import deepcopy
from django.db import IntegrityError
from django.db import transaction
from django.db.models import Q
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from rest_framework.generics import get_object_or_404
from rest_framework.validators ... | 18,511 | Python | .py | 424 | 34.412736 | 101 | 0.623255 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,623 | __init__.py | jumpserver_jumpserver/apps/accounts/serializers/account/__init__.py | from .account import *
from .backup import *
from .base import *
from .gathered_account import *
from .template import *
from .virtual import *
| 144 | Python | .py | 6 | 23 | 31 | 0.775362 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,624 | base.py | jumpserver_jumpserver/apps/accounts/serializers/account/base.py | # -*- coding: utf-8 -*-
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from accounts.const import SecretType
from accounts.models import BaseAccount
from accounts.utils import validate_password_for_ansible, validate_ssh_key
from common.serializers import ResourceLabelsMix... | 3,370 | Python | .py | 90 | 28.555556 | 86 | 0.621713 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,625 | gathered_account.py | jumpserver_jumpserver/apps/accounts/serializers/account/gathered_account.py | from django.utils.translation import gettext_lazy as _
from accounts.models import GatheredAccount
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
from .account import AccountAssetSerializer
from .base import BaseAccountSerializer
class GatheredAccountSerializer(BulkOrgResourceModelSerializer):
... | 811 | Python | .py | 18 | 38.888889 | 72 | 0.732234 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,626 | virtual.py | jumpserver_jumpserver/apps/accounts/serializers/account/virtual.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from accounts.models import VirtualAccount
__all__ = ['VirtualAccountSerializer']
class VirtualAccountSerializer(serializers.ModelSerializer):
class Meta:
model = VirtualAccount
field_mini = ['id', 'ali... | 1,139 | Python | .py | 26 | 33.269231 | 90 | 0.570784 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,627 | push_account.py | jumpserver_jumpserver/apps/accounts/serializers/automations/push_account.py | from accounts.const import AutomationTypes
from accounts.models import PushAccountAutomation
from .change_secret import (
ChangeSecretAutomationSerializer, ChangeSecretUpdateAssetSerializer,
ChangeSecretUpdateNodeSerializer
)
class PushAccountAutomationSerializer(ChangeSecretAutomationSerializer):
class M... | 1,008 | Python | .py | 24 | 35.875 | 74 | 0.793245 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,628 | gather_accounts.py | jumpserver_jumpserver/apps/accounts/serializers/automations/gather_accounts.py | # -*- coding: utf-8 -*-
#
from accounts.const import AutomationTypes
from accounts.models import GatherAccountsAutomation
from common.utils import get_logger
from .base import BaseAutomationSerializer
logger = get_logger(__file__)
__all__ = [
'GatherAccountAutomationSerializer',
]
class GatherAccountAutomation... | 772 | Python | .py | 20 | 33.6 | 73 | 0.75302 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,629 | change_secret.py | jumpserver_jumpserver/apps/accounts/serializers/automations/change_secret.py | # -*- coding: utf-8 -*-
#
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from accounts.const import (
AutomationTypes, SecretType, SecretStrategy,
SSHKeyStrategy, ChangeSecretRecordStatusChoice
)
from accounts.models import (
Account, ChangeSecretAutomation,
... | 6,538 | Python | .py | 154 | 34.727273 | 103 | 0.673016 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,630 | __init__.py | jumpserver_jumpserver/apps/accounts/serializers/automations/__init__.py | from .base import *
from .change_secret import *
from .gather_accounts import *
from .push_account import *
| 108 | Python | .py | 4 | 26 | 30 | 0.778846 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,631 | base.py | jumpserver_jumpserver/apps/accounts/serializers/automations/base.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from accounts.models import AutomationExecution
from assets.const import AutomationTypes
from assets.models import Asset, Node, BaseAutomation
from common.const.choices import Trigger
from common.serializers.fields import Obj... | 3,646 | Python | .py | 80 | 38.15 | 102 | 0.676156 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,632 | const.py | jumpserver_jumpserver/apps/acls/const.py | from django.db import models
from django.utils.translation import gettext_lazy as _
class ActionChoices(models.TextChoices):
reject = 'reject', _('Reject')
accept = 'accept', _('Accept')
review = 'review', _('Review')
warning = 'warning', _('Warn')
notice = 'notice', _('Notify')
notify_and_war... | 364 | Python | .py | 9 | 36.555556 | 61 | 0.660057 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,633 | apps.py | jumpserver_jumpserver/apps/acls/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class AclsConfig(AppConfig):
name = 'acls'
verbose_name = _('App Acls')
| 171 | Python | .py | 5 | 31.2 | 54 | 0.756098 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,634 | notifications.py | jumpserver_jumpserver/apps/acls/notifications.py | from django.template.loader import render_to_string
from django.utils.translation import gettext_lazy as _
from accounts.models import Account
from assets.models import Asset
from audits.models import UserLoginLog
from notifications.notifications import UserMessage
from users.models import User
class UserLoginRemind... | 2,150 | Python | .py | 58 | 28.741379 | 95 | 0.617124 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,635 | connect_method.py | jumpserver_jumpserver/apps/acls/models/connect_method.py | from django.db import models
from django.utils.translation import gettext_lazy as _
from .base import UserBaseACL
__all__ = ['ConnectMethodACL']
class ConnectMethodACL(UserBaseACL):
connect_methods = models.JSONField(default=list, verbose_name=_('Connect methods'))
class Meta(UserBaseACL.Meta):
ver... | 381 | Python | .py | 9 | 38.111111 | 87 | 0.746594 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,636 | __init__.py | jumpserver_jumpserver/apps/acls/models/__init__.py | from .command_acl import *
from .connect_method import *
from .login_acl import *
from .login_asset_acl import *
| 113 | Python | .py | 4 | 27.25 | 30 | 0.770642 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,637 | base.py | jumpserver_jumpserver/apps/acls/models/base.py | from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from django.utils.translation import gettext_lazy as _
from common.db.fields import JSONManyToManyField
from common.db.models import JMSBaseModel
from common.utils import contains_ip
from common.utils.time_period impor... | 4,404 | Python | .py | 102 | 35.343137 | 104 | 0.661658 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,638 | login_acl.py | jumpserver_jumpserver/apps/acls/models/login_acl.py | from django.db import models
from django.utils.translation import gettext_lazy as _
from common.utils import get_request_ip, get_ip_city
from common.utils.timezone import local_now_display
from .base import UserBaseACL
class LoginACL(UserBaseACL):
# 规则, ip_group, time_period
rules = models.JSONField(default=... | 1,482 | Python | .py | 37 | 31.945946 | 66 | 0.640167 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,639 | command_acl.py | jumpserver_jumpserver/apps/acls/models/command_acl.py | # -*- coding: utf-8 -*-
#
import re
from django.db import models
from django.utils.translation import gettext_lazy as _
from common.utils import lazyproperty, get_logger
from orgs.mixins.models import JMSOrgBaseModel
from .base import UserAssetAccountBaseACL
logger = get_logger(__file__)
class TypeChoices(models.T... | 3,991 | Python | .py | 104 | 29.086538 | 94 | 0.592583 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,640 | login_asset_acl.py | jumpserver_jumpserver/apps/acls/models/login_asset_acl.py | from django.db import models
from django.utils.translation import gettext_lazy as _
from .base import UserAssetAccountBaseACL
class LoginAssetACL(UserAssetAccountBaseACL):
# 规则, ip_group, time_period
rules = models.JSONField(default=dict, verbose_name=_('Rule'))
class Meta(UserAssetAccountBaseACL.Meta):... | 1,148 | Python | .py | 28 | 32.642857 | 96 | 0.64955 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,641 | 0002_auto_20210926_1047.py | jumpserver_jumpserver/apps/acls/migrations/0002_auto_20210926_1047.py | # Generated by Django 4.1.13 on 2024-05-09 03:16
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('acls', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
o... | 1,870 | Python | .py | 48 | 29.166667 | 127 | 0.613436 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,642 | 0001_initial.py | jumpserver_jumpserver/apps/acls/migrations/0001_initial.py | # Generated by Django 4.1.13 on 2024-05-09 03:16
import common.db.fields
import django.core.validators
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Comm... | 8,958 | Python | .py | 123 | 58.512195 | 252 | 0.607883 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,643 | api_urls.py | jumpserver_jumpserver/apps/acls/urls/api_urls.py | from django.urls import path
from rest_framework_bulk.routes import BulkRouter
from .. import api
app_name = 'acls'
router = BulkRouter()
router.register(r'login-acls', api.LoginACLViewSet, 'login-acl')
router.register(r'login-asset-acls', api.LoginAssetACLViewSet, 'login-asset-acl')
router.register(r'command-filter... | 686 | Python | .py | 14 | 47.357143 | 91 | 0.793103 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,644 | connect_method.py | jumpserver_jumpserver/apps/acls/api/connect_method.py | from django_filters import rest_framework as drf_filters
from common.api import JMSBulkModelViewSet
from orgs.utils import tmp_to_root_org
from .common import ACLUserFilterMixin
from .. import serializers
from ..models import ConnectMethodACL
__all__ = ['ConnectMethodACLViewSet']
class ConnectMethodFilter(ACLUserFi... | 862 | Python | .py | 20 | 38.45 | 89 | 0.765906 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,645 | login_asset_check.py | jumpserver_jumpserver/apps/acls/api/login_asset_check.py | from rest_framework.generics import CreateAPIView
from rest_framework.response import Response
from common.utils import reverse, lazyproperty
from orgs.utils import tmp_to_org
from .. import serializers
from ..models import LoginAssetACL
__all__ = ['LoginAssetCheckAPI']
class LoginAssetCheckAPI(CreateAPIView):
... | 3,080 | Python | .py | 71 | 34.408451 | 97 | 0.645798 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,646 | __init__.py | jumpserver_jumpserver/apps/acls/api/__init__.py | from .command_acl import *
from .connect_method import *
from .login_acl import *
from .login_asset_acl import *
from .login_asset_check import *
| 146 | Python | .py | 5 | 28.2 | 32 | 0.77305 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,647 | login_acl.py | jumpserver_jumpserver/apps/acls/api/login_acl.py | from common.api import JMSBulkModelViewSet
from orgs.utils import tmp_to_root_org
from .common import ACLUserFilterMixin
from .. import serializers
from ..models import LoginACL
__all__ = ['LoginACLViewSet']
class LoginACLFilter(ACLUserFilterMixin):
class Meta:
model = LoginACL
fields = ('name',... | 664 | Python | .py | 18 | 32.111111 | 53 | 0.739812 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,648 | common.py | jumpserver_jumpserver/apps/acls/api/common.py | from django.db.models import Q
from django_filters import rest_framework as drf_filters
from common.drf.filters import BaseFilterSet
from common.utils import is_uuid
class ACLUserFilterMixin(BaseFilterSet):
users = drf_filters.CharFilter(method='filter_user')
@staticmethod
def filter_user(queryset, name... | 1,394 | Python | .py | 36 | 30.361111 | 58 | 0.650852 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,649 | command_acl.py | jumpserver_jumpserver/apps/acls/api/command_acl.py | from rest_framework.decorators import action
from rest_framework.response import Response
from orgs.mixins.api import OrgBulkModelViewSet
from .common import ACLUserAssetFilterMixin
from .. import models, serializers
__all__ = ['CommandFilterACLViewSet', 'CommandGroupViewSet']
class CommandGroupViewSet(OrgBulkModel... | 1,596 | Python | .py | 36 | 38.083333 | 79 | 0.722115 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,650 | login_asset_acl.py | jumpserver_jumpserver/apps/acls/api/login_asset_acl.py | from orgs.mixins.api import OrgBulkModelViewSet
from .common import ACLUserAssetFilterMixin
from .. import models, serializers
__all__ = ['LoginAssetACLViewSet']
class LoginAssetACLFilter(ACLUserAssetFilterMixin):
class Meta:
model = models.LoginAssetACL
fields = ['name', ]
class LoginAssetACLV... | 512 | Python | .py | 13 | 35.230769 | 58 | 0.783401 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,651 | connect_method.py | jumpserver_jumpserver/apps/acls/serializers/connect_method.py | from orgs.mixins.serializers import BulkOrgResourceModelSerializer
from .base import BaseUserAssetAccountACLSerializer as BaseSerializer
from ..const import ActionChoices
from ..models import ConnectMethodACL
__all__ = ["ConnectMethodACLSerializer"]
class ConnectMethodACLSerializer(BaseSerializer, BulkOrgResourceMod... | 720 | Python | .py | 15 | 41.466667 | 81 | 0.746439 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,652 | login_asset_check.py | jumpserver_jumpserver/apps/acls/serializers/login_asset_check.py | from rest_framework import serializers
from common.utils import get_object_or_none
from orgs.utils import tmp_to_root_org
from users.models import User
__all__ = ['LoginAssetCheckSerializer']
class LoginAssetCheckSerializer(serializers.Serializer):
user_id = serializers.UUIDField(required=True, allow_null=False... | 1,171 | Python | .py | 28 | 35.107143 | 72 | 0.677533 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,653 | __init__.py | jumpserver_jumpserver/apps/acls/serializers/__init__.py | from .command_acl import *
from .connect_method import *
from .login_acl import *
from .login_asset_acl import *
from .login_asset_check import *
| 146 | Python | .py | 5 | 28.2 | 32 | 0.77305 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,654 | base.py | jumpserver_jumpserver/apps/acls/serializers/base.py | from django.conf import settings
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from acls.models.base import BaseACL
from common.serializers.fields import JSONManyToManyField, LabeledChoiceField
from orgs.models import Organization
from ..const import ActionChoices
commo... | 4,229 | Python | .py | 104 | 32.865385 | 100 | 0.651146 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,655 | login_acl.py | jumpserver_jumpserver/apps/acls/serializers/login_acl.py | from django.utils.translation import gettext as _
from common.serializers import MethodSerializer
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
from .base import BaseUserACLSerializer
from .rules import RuleSerializer
from ..models import LoginACL
__all__ = ["LoginACLSerializer"]
common_help_tex... | 694 | Python | .py | 15 | 42.4 | 80 | 0.787202 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,656 | command_acl.py | jumpserver_jumpserver/apps/acls/serializers/command_acl.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from acls.models import CommandGroup, CommandFilterACL
from common.serializers.fields import ObjectRelatedField, LabeledChoiceField
from common.utils import lazyproperty, get_object_or_none
from orgs.mixins.serializers import... | 2,429 | Python | .py | 52 | 40.653846 | 93 | 0.7337 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,657 | login_asset_acl.py | jumpserver_jumpserver/apps/acls/serializers/login_asset_acl.py | from django.utils.translation import gettext_lazy as _
from common.serializers import MethodSerializer
from orgs.mixins.serializers import BulkOrgResourceModelSerializer
from .base import BaseUserAssetAccountACLSerializer as BaseSerializer
from .rules import RuleSerializer
from ..models import LoginAssetACL
__all__ =... | 669 | Python | .py | 14 | 43.785714 | 78 | 0.805855 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,658 | rules.py | jumpserver_jumpserver/apps/acls/serializers/rules/rules.py | # coding: utf-8
#
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.utils import get_logger
from common.utils.ip import is_ip_address, is_ip_network, is_ip_segment
logger = get_logger(__file__)
__all__ = ['RuleSerializer', 'ip_group_child_validator', 'ip_group_... | 1,209 | Python | .py | 26 | 41.115385 | 97 | 0.673765 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,659 | signals.py | jumpserver_jumpserver/apps/settings/signals.py | from django.dispatch import Signal
category_setting_updated = Signal()
setting_changed = Signal()
| 99 | Python | .py | 3 | 31.666667 | 35 | 0.821053 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,660 | models.py | jumpserver_jumpserver/apps/settings/models.py | import json
from django.conf import settings
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.core.files.uploadedfile import InMemoryUploadedFile
from django.db import models
from django.db.utils import ProgrammingError, OperationalError
from django.utils... | 7,036 | Python | .py | 163 | 33.398773 | 96 | 0.625297 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,661 | prompt.py | jumpserver_jumpserver/apps/settings/prompt.py | class DefaultChatPrompt:
DEFAULT = {
'zh': [
{
'name': '周报生成器',
'content': '使用下面提供的文本作为中文周报的基础,生成一个简洁的摘要,突出最重要的内容。该报告应以 markdown 格式编写,'
'并应易于阅读和理解,以满足一般受众的需要。特别是要注重提供对利益相关者和决策者有用的见解和分析。'
'你也可以根据需要使用任何额外的信息或来源。'... | 14,647 | Python | .py | 196 | 34.255102 | 120 | 0.517756 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,662 | const.py | jumpserver_jumpserver/apps/settings/const.py | from django.db.models import TextChoices
class ImportStatus(TextChoices):
ok = 'ok', 'Ok'
pending = 'pending', 'Pending'
error = 'error', 'Error'
| 160 | Python | .py | 5 | 28.2 | 40 | 0.686275 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,663 | apps.py | jumpserver_jumpserver/apps/settings/apps.py | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class SettingsConfig(AppConfig):
name = 'settings'
verbose_name = _('App Settings')
def ready(self):
from . import signal_handlers # noqa
from . import tasks # noqa
| 287 | Python | .py | 8 | 31 | 54 | 0.706522 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,664 | ws.py | jumpserver_jumpserver/apps/settings/ws.py | # -*- coding: utf-8 -*-
#
import json
import asyncio
from asgiref.sync import sync_to_async
from channels.generic.websocket import AsyncJsonWebsocketConsumer
from django.core.cache import cache
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from django.utils import translation
... | 9,869 | Python | .py | 226 | 34.849558 | 95 | 0.629568 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,665 | notifications.py | jumpserver_jumpserver/apps/settings/notifications.py | from django.template.loader import render_to_string
from django.utils.translation import gettext as _
from common.utils import get_logger
from common.utils.timezone import local_now_display
from notifications.notifications import UserMessage
logger = get_logger(__file__)
class LDAPImportMessage(UserMessage):
de... | 1,354 | Python | .py | 31 | 35.548387 | 78 | 0.623672 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,666 | signal_handlers.py | jumpserver_jumpserver/apps/settings/signal_handlers.py | # -*- coding: utf-8 -*-
#
import json
from django.conf import LazySettings
from django.db.models.signals import post_save
from django.db.utils import ProgrammingError, OperationalError
from django.dispatch import receiver
from django.utils.functional import LazyObject
from common.decorators import on_transaction_comm... | 2,262 | Python | .py | 58 | 33.603448 | 72 | 0.72879 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,667 | ldap.py | jumpserver_jumpserver/apps/settings/tasks/ldap.py | # coding: utf-8
import time
from celery import shared_task
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from common.utils import get_logger
from common.utils.timezone import local_now_display
from ops.celery.decorator import after_app_ready_start
from ops.celery.utils import... | 4,685 | Python | .py | 119 | 33.428571 | 103 | 0.684025 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,668 | 0001_initial.py | jumpserver_jumpserver/apps/settings/migrations/0001_initial.py | # Generated by Django 4.1.13 on 2024-05-09 03:16
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ChatPrompt',
fields=[
('create... | 3,035 | Python | .py | 43 | 58 | 828 | 0.615539 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,669 | telnet.py | jumpserver_jumpserver/apps/settings/tools/telnet.py | # -*- coding: utf-8 -*-
#
import asyncio
import socket
import telnetlib
from settings.utils import generate_ips
PROMPT_REGEX = r'[\<|\[](.*)[\>|\]]'
async def telnet(dest_addr, port_number=23, timeout=10):
loop = asyncio.get_running_loop()
try:
connection = await loop.run_in_executor(None, telnetlib... | 2,118 | Python | .py | 49 | 35.734694 | 104 | 0.618261 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,670 | traceroute.py | jumpserver_jumpserver/apps/settings/tools/traceroute.py | # -*- coding: utf-8 -*-
#
import asyncio
import socket
import struct
import time
from settings.utils import generate_ips
def calculate_checksum(data):
# 计算 ICMP 校验和
checksum = 0
if len(data) % 2 == 1:
data += b'\x00'
for i in range(0, len(data), 2):
w = (data[i] << 8) + data[i+1]
... | 2,374 | Python | .py | 65 | 26.507692 | 79 | 0.577153 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,671 | ping.py | jumpserver_jumpserver/apps/settings/tools/ping.py | # -*- coding: utf-8 -*-
#
import asyncio
import os
import select
import socket
import struct
import time
from common.utils import lookup_domain
from settings.utils import generate_ips
# From /usr/include/linux/icmp.h; your milage may vary.
ICMP_ECHO_REQUEST = 8 # Seems to be the same on Solaris.
def checksum(sourc... | 5,638 | Python | .py | 147 | 30.816327 | 86 | 0.603283 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,672 | __init__.py | jumpserver_jumpserver/apps/settings/tools/__init__.py | # coding: utf-8
#
from .ping import *
from .telnet import *
from .nmap import *
from .tcpdump import *
from .traceroute import *
| 129 | Python | .py | 7 | 17.428571 | 25 | 0.745902 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,673 | nmap.py | jumpserver_jumpserver/apps/settings/tools/nmap.py | import asyncio
import time
import nmap
from common.utils.timezone import local_now_display
from settings.utils import generate_ips
def get_nmap_result(nm, ip, ports, timeout):
results = []
nm.scan(ip, ports=ports, timeout=timeout)
tcp_port = nm[ip].get('tcp', {})
udp_port = nm[ip].get('udp', {})
... | 1,976 | Python | .py | 47 | 35.680851 | 96 | 0.637832 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,674 | tcpdump.py | jumpserver_jumpserver/apps/settings/tools/tcpdump.py | import asyncio
import netifaces
import socket
import struct
from common.utils.timezone import local_now_display
from settings.utils import generate_ips, generate_ports
async def once_tcpdump(
interface, src_ips, src_ports, dest_ips, dest_ports, display, stop_event
):
loop = asyncio.get_event_loop()
s... | 3,474 | Python | .py | 86 | 30.186047 | 94 | 0.610619 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,675 | db.py | jumpserver_jumpserver/apps/settings/utils/db.py | from django.apps import apps
from orgs.utils import tmp_to_root_org
__all__ = ['DBTableDataAnalyzer']
class DBTableDataAnalyzer(object):
def get_tables_info(self):
table_models = self.get_all_table_models()
with tmp_to_root_org():
table_info = self._fetch_tables_info(table_models)
... | 1,613 | Python | .py | 47 | 23.361702 | 64 | 0.536977 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,676 | ldap.py | jumpserver_jumpserver/apps/settings/utils/ldap.py | # coding: utf-8
#
import json
from collections import defaultdict
from copy import deepcopy
from django.conf import settings
from django.core.cache import cache
from django.utils.translation import gettext_lazy as _
from ldap3 import Server, Connection, SIMPLE
from ldap3.core.exceptions import (
LDAPSocketOpenErr... | 25,182 | Python | .py | 604 | 31.824503 | 100 | 0.610533 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,677 | __init__.py | jumpserver_jumpserver/apps/settings/utils/__init__.py | # coding: utf-8
#
from .ldap import *
from .common import *
from .db import *
| 79 | Python | .py | 5 | 14.6 | 21 | 0.712329 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,678 | common.py | jumpserver_jumpserver/apps/settings/utils/common.py | # coding: utf-8
from jumpserver.context_processor import default_interface
from django.conf import settings
from IPy import IP
from common.utils import lookup_domain
def get_interface_setting_or_default():
if not settings.XPACK_ENABLED:
return default_interface
from xpack.plugins.interface.models imp... | 2,125 | Python | .py | 63 | 26.142857 | 78 | 0.591957 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,679 | api_urls.py | jumpserver_jumpserver/apps/settings/urls/api_urls.py | from __future__ import absolute_import
from django.urls import path
from rest_framework_bulk.routes import BulkRouter
from .. import api
app_name = 'common'
router = BulkRouter()
router.register(r'chatai-prompts', api.ChatPromptViewSet, 'chatai-prompt')
urlpatterns = [
path('mail/testing/', api.MailTestingAPI.a... | 1,917 | Python | .py | 30 | 60.033333 | 89 | 0.709729 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,680 | ws_urls.py | jumpserver_jumpserver/apps/settings/urls/ws_urls.py | from django.urls import path
from .. import ws
app_name = 'common'
urlpatterns = [
path('ws/setting/tools/', ws.ToolsWebsocket.as_asgi(), name='setting-tools-ws'),
path('ws/ldap/', ws.LdapWebsocket.as_asgi(), name='ldap-ws'),
]
| 239 | Python | .py | 7 | 31.571429 | 84 | 0.694323 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,681 | slack.py | jumpserver_jumpserver/apps/settings/api/slack.py | from rest_framework.views import Response
from rest_framework.generics import GenericAPIView
from rest_framework.exceptions import APIException
from rest_framework import status
from django.utils.translation import gettext_lazy as _
from settings.models import Setting
from common.sdk.im.slack import Slack
from .. imp... | 1,334 | Python | .py | 32 | 33.4375 | 87 | 0.667697 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,682 | ldap.py | jumpserver_jumpserver/apps/settings/api/ldap.py | # -*- coding: utf-8 -*-
from django.utils.translation import gettext_lazy as _
from rest_framework import generics
from rest_framework.views import Response
from common.utils import get_logger
from users.models import User
from ..const import ImportStatus
from ..models import Setting
from ..serializers import LDAPUse... | 3,188 | Python | .py | 79 | 32.088608 | 105 | 0.64748 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,683 | feishu.py | jumpserver_jumpserver/apps/settings/api/feishu.py | from django.utils.translation import gettext_lazy as _
from rest_framework import status
from rest_framework.exceptions import APIException
from rest_framework.generics import GenericAPIView
from rest_framework.views import Response
from common.sdk.im.feishu import FeiShu
from common.sdk.im.lark import Lark
from setti... | 1,602 | Python | .py | 36 | 36.472222 | 87 | 0.671805 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,684 | dingtalk.py | jumpserver_jumpserver/apps/settings/api/dingtalk.py | from rest_framework.views import Response
from rest_framework.generics import GenericAPIView
from rest_framework.exceptions import APIException
from rest_framework import status
from django.utils.translation import gettext_lazy as _
from django.conf import settings
from common.sdk.im.dingtalk import DingTalk
from .. i... | 1,424 | Python | .py | 31 | 37.451613 | 87 | 0.677001 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,685 | wecom.py | jumpserver_jumpserver/apps/settings/api/wecom.py | from rest_framework.views import Response
from rest_framework.generics import GenericAPIView
from rest_framework.exceptions import APIException
from rest_framework import status
from django.utils.translation import gettext_lazy as _
from settings.models import Setting
from common.sdk.im.wecom import WeCom
from .. imp... | 1,565 | Python | .py | 34 | 37.705882 | 98 | 0.683968 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,686 | settings.py | jumpserver_jumpserver/apps/settings/api/settings.py | # -*- coding: utf-8 -*-
#
import re
from django.conf import settings
from django.core.cache import cache
from django.http import HttpResponse
from django.views.static import serve
from rest_framework import generics
from rest_framework import status
from rest_framework.permissions import AllowAny
from rest_framework.v... | 8,533 | Python | .py | 187 | 37.042781 | 102 | 0.665746 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,687 | chat.py | jumpserver_jumpserver/apps/settings/api/chat.py | import httpx
import openai
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from rest_framework import status
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from common.api import JMSModelViewSet
from common.permissions import IsVa... | 3,967 | Python | .py | 102 | 28.882353 | 92 | 0.605593 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,688 | vault.py | jumpserver_jumpserver/apps/settings/api/vault.py | from django.conf import settings
from django.utils.translation import gettext_lazy as _
from rest_framework import status
from rest_framework.generics import GenericAPIView
from rest_framework.views import Response, APIView
from accounts.backends import get_vault_client
from accounts.tasks.vault import sync_secret_to_... | 1,873 | Python | .py | 49 | 30.408163 | 74 | 0.658101 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,689 | i18n.py | jumpserver_jumpserver/apps/settings/api/i18n.py | import json
import os
from django.conf import settings
from django.utils._os import safe_join
from rest_framework.generics import RetrieveAPIView
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
class ComponentI18nApi(RetrieveAPIView):
base_path = 'locale'
permissi... | 1,391 | Python | .py | 38 | 28.052632 | 66 | 0.606241 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,690 | security.py | jumpserver_jumpserver/apps/settings/api/security.py | from uuid import uuid4
from django.conf import settings
from django.core.cache import cache
from rest_framework.generics import ListAPIView, CreateAPIView
from rest_framework.views import Response
from users.utils import LoginIpBlockUtil
from ..serializers import SecurityBlockIPSerializer
class BlockIPSecurityAPI(L... | 1,876 | Python | .py | 47 | 32.978723 | 67 | 0.651265 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,691 | __init__.py | jumpserver_jumpserver/apps/settings/api/__init__.py | from .chat import *
from .dingtalk import *
from .email import *
from .feishu import *
from .lark import *
from .i18n import *
from .ldap import *
from .public import *
from .security import *
from .settings import *
from .slack import *
from .sms import *
from .vault import *
from .wecom import *
| 299 | Python | .py | 14 | 20.357143 | 23 | 0.754386 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,692 | sms.py | jumpserver_jumpserver/apps/settings/api/sms.py | import importlib
from collections import OrderedDict
from django.utils.translation import gettext_lazy as _
from django.conf import settings
from rest_framework import status
from rest_framework.exceptions import APIException
from rest_framework.generics import ListAPIView, GenericAPIView
from rest_framework.response ... | 6,088 | Python | .py | 150 | 30.593333 | 101 | 0.603269 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,693 | email.py | jumpserver_jumpserver/apps/settings/api/email.py | # -*- coding: utf-8 -*-
#
from smtplib import SMTPSenderRefused
from django.conf import settings
from django.core.mail import send_mail
from django.utils.translation import gettext_lazy as _
from rest_framework.views import Response, APIView
from common.tasks import get_email_connection as get_connection
from common... | 2,755 | Python | .py | 63 | 32.412698 | 78 | 0.614351 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,694 | public.py | jumpserver_jumpserver/apps/settings/api/public.py | from django.conf import settings
from rest_framework import generics
from rest_framework.permissions import AllowAny
from authentication.permissions import IsValidUserOrConnectionToken
from common.const.choices import Language
from common.utils import get_logger, lazyproperty
from common.utils.timezone import local_no... | 2,656 | Python | .py | 61 | 34.114754 | 108 | 0.668616 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,695 | lark.py | jumpserver_jumpserver/apps/settings/api/lark.py | from .feishu import FeiShuTestingAPI
from .. import serializers
class LarkTestingAPI(FeiShuTestingAPI):
category = 'LARK'
serializer_class = serializers.LarkSettingSerializer
| 185 | Python | .py | 5 | 34 | 56 | 0.825843 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,696 | msg.py | jumpserver_jumpserver/apps/settings/serializers/msg.py | # coding: utf-8
#
from django.db import models
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import EncryptedField
__all__ = [
'MailTestSerializer', 'EmailSettingSerializer',
'EmailContentSettingSerializer', 'SMSBackendSerializer',... | 4,010 | Python | .py | 77 | 45.818182 | 210 | 0.704592 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,697 | feature.py | jumpserver_jumpserver/apps/settings/serializers/feature.py | import uuid
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from assets.const import Protocol
from common.serializers.fields import EncryptedField
from common.utils import date_expired_default
__all__ = [
'AnnouncementSettingSerialize... | 5,567 | Python | .py | 117 | 41.136752 | 100 | 0.690876 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,698 | terminal.py | jumpserver_jumpserver/apps/settings/serializers/terminal.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
class TerminalSettingSerializer(serializers.Serializer):
PREFIX_TITLE = _('Terminal')
SORT_BY_CHOICES = (
('name', _('Name')),
('ip', _('Address'))
)
PAGE_SIZE_CHOICES = (
('all', _(... | 2,726 | Python | .py | 68 | 31.647059 | 110 | 0.619066 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,699 | settings.py | jumpserver_jumpserver/apps/settings/serializers/settings.py | from django.core.cache import cache
from django.utils import translation
from django.utils.translation import gettext_noop, gettext_lazy as _
from rest_framework import serializers
from common.utils import i18n_fmt
from .auth import (
LDAPSettingSerializer, OIDCSettingSerializer, KeycloakSettingSerializer,
CAS... | 3,542 | Python | .py | 85 | 33.952941 | 101 | 0.711259 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |