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,500 | backends.py | jumpserver_jumpserver/apps/authentication/backends/passkey/backends.py | from django.conf import settings
from ..base import JMSModelBackend
class PasskeyAuthBackend(JMSModelBackend):
@staticmethod
def is_enabled():
return settings.AUTH_PASSKEY
def user_can_authenticate(self, user):
return user.source == 'local'
| 273 | Python | .py | 8 | 29.125 | 42 | 0.747126 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,501 | fido.py | jumpserver_jumpserver/apps/authentication/backends/passkey/fido.py | import json
from urllib.parse import urlparse
import fido2.features
from django.conf import settings
from django.utils import timezone
from django.utils.translation import gettext as _
from fido2.server import Fido2Server
from fido2.utils import websafe_decode, websafe_encode
from fido2.webauthn import PublicKeyCreden... | 5,097 | Python | .py | 130 | 33.792308 | 109 | 0.710958 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,502 | urls.py | jumpserver_jumpserver/apps/authentication/backends/passkey/urls.py | from rest_framework.routers import DefaultRouter
from . import api
router = DefaultRouter()
router.register('passkeys', api.PasskeyViewSet, 'passkey')
urlpatterns = []
urlpatterns += router.urls
| 198 | Python | .py | 6 | 31.5 | 58 | 0.809524 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,503 | api.py | jumpserver_jumpserver/apps/authentication/backends/passkey/api.py | from django.conf import settings
from django.http import JsonResponse
from django.shortcuts import render
from django.utils.translation import gettext as _
from rest_framework.decorators import action
from rest_framework.permissions import IsAuthenticated, AllowAny
from authentication.mixins import AuthMixin
from comm... | 2,871 | Python | .py | 60 | 40.116667 | 98 | 0.684173 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,504 | backends.py | jumpserver_jumpserver/apps/authentication/backends/cas/backends.py | # -*- coding: utf-8 -*-
#
from django_cas_ng.backends import CASBackend as _CASBackend
from django.conf import settings
from ..base import JMSBaseAuthBackend
__all__ = ['CASBackend']
class CASBackend(JMSBaseAuthBackend, _CASBackend):
@staticmethod
def is_enabled():
return settings.AUTH_CAS
| 311 | Python | .py | 10 | 28.1 | 60 | 0.747475 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,505 | urls.py | jumpserver_jumpserver/apps/authentication/backends/cas/urls.py | # -*- coding: utf-8 -*-
#
from django.urls import path
import django_cas_ng.views
from .views import CASLoginView
urlpatterns = [
path('login/', CASLoginView.as_view(), name='cas-login'),
path('logout/', django_cas_ng.views.LogoutView.as_view(), name='cas-logout'),
path('callback/', django_cas_ng.views.Ca... | 372 | Python | .py | 10 | 34.8 | 93 | 0.705556 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,506 | utils.py | jumpserver_jumpserver/apps/authentication/backends/cas/utils.py | from django_cas_ng import utils
from django_cas_ng.utils import (
django_settings, get_protocol,
urllib_parse, REDIRECT_FIELD_NAME, get_redirect_url
)
def get_service_url(request, redirect_to=None):
"""
重写 get_service url 方法, CAS_ROOT_PROXIED_AS 为空时, 支持跳转回当前访问的域名地址
"""
"""Generates application... | 1,046 | Python | .py | 28 | 29 | 73 | 0.636831 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,507 | __init__.py | jumpserver_jumpserver/apps/authentication/backends/cas/__init__.py | # -*- coding: utf-8 -*-
#
# 保证 utils 中的模块进行初始化
from . import utils
from .backends import *
| 114 | Python | .py | 5 | 17.2 | 23 | 0.686047 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,508 | middleware.py | jumpserver_jumpserver/apps/authentication/backends/cas/middleware.py | from django_cas_ng.middleware import CASMiddleware as _CASMiddleware
from django.core.exceptions import MiddlewareNotUsed
from django.conf import settings
class CASMiddleware(_CASMiddleware):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if not settings.AUTH_CAS:
... | 347 | Python | .py | 8 | 38.125 | 68 | 0.732938 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,509 | views.py | jumpserver_jumpserver/apps/authentication/backends/cas/views.py | from django_cas_ng.views import LoginView
from django.core.exceptions import PermissionDenied
from django.http import HttpResponseRedirect
__all__ = ['LoginView']
class CASLoginView(LoginView):
def get(self, request):
try:
return super().get(request)
except PermissionDenied:
... | 358 | Python | .py | 10 | 29.9 | 51 | 0.723032 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,510 | backends.py | jumpserver_jumpserver/apps/authentication/backends/radius/backends.py | # -*- coding: utf-8 -*-
#
import traceback
from django.conf import settings
from django.contrib.auth import get_user_model
from radiusauth.backends import RADIUSBackend, RADIUSRealmBackend
from authentication.backends.base import JMSBaseAuthBackend
from .signals import radius_create_user
User = get_user_model()
cl... | 1,998 | Python | .py | 46 | 35.565217 | 95 | 0.679688 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,511 | signals.py | jumpserver_jumpserver/apps/authentication/backends/oidc/signals.py | """
OpenID Connect relying party (RP) signals
=========================================
This modules defines Django signals that can be triggered during the OpenID Connect
authentication process.
"""
from django.dispatch import Signal
openid_create_or_update_user = Signal()
| 295 | Python | .py | 8 | 33.375 | 87 | 0.657244 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,512 | decorator.py | jumpserver_jumpserver/apps/authentication/backends/oidc/decorator.py | # coding: utf-8
#
import warnings
import contextlib
import requests
from django.conf import settings
from urllib3.exceptions import InsecureRequestWarning
from .utils import get_logger
__all__ = ['ssl_verification']
old_merge_environment_settings = requests.Session.merge_environment_settings
logger = get_logger... | 1,785 | Python | .py | 47 | 31.085106 | 84 | 0.688696 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,513 | backends.py | jumpserver_jumpserver/apps/authentication/backends/oidc/backends.py | """
OpenID Connect relying party (RP) authentication backends
=========================================================
This modules defines backends allowing to authenticate a user using a specific token endpoint
of an OpenID Connect provider (OP).
"""
import base64
import requests
from django.conf... | 14,965 | Python | .py | 288 | 41.329861 | 104 | 0.642681 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,514 | urls.py | jumpserver_jumpserver/apps/authentication/backends/oidc/urls.py | """
OpenID Connect relying party (RP) URLs
======================================
This modules defines the URLs allowing to perform OpenID Connect flows on a Relying Party (RP).
It defines three main endpoints: the authentication request endpoint, the authentication
callback endpoint and the end se... | 639 | Python | .py | 14 | 41.928571 | 99 | 0.696284 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,515 | utils.py | jumpserver_jumpserver/apps/authentication/backends/oidc/utils.py | """
OpenID Connect relying party (RP) utilities
===========================================
This modules defines utilities allowing to manipulate ID tokens and other common helpers.
"""
import datetime as dt
from calendar import timegm
from urllib.parse import urlparse
from django.core.exceptions import... | 4,713 | Python | .py | 86 | 49.174419 | 100 | 0.709846 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,516 | middleware.py | jumpserver_jumpserver/apps/authentication/backends/oidc/middleware.py | import time
import requests
import requests.exceptions
from django.conf import settings
from django.contrib import auth
from django.core.exceptions import MiddlewareNotUsed
from common.utils import get_logger
from .decorator import ssl_verification
from .utils import validate_and_return_id_token
logger = get_logger(... | 4,506 | Python | .py | 89 | 41.573034 | 104 | 0.668335 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,517 | views.py | jumpserver_jumpserver/apps/authentication/backends/oidc/views.py | """
OpenID Connect relying party (RP) views
=======================================
This modules defines views allowing to start the authorization and authentication process in
order to authenticate a specific user. The most important views are: the "login" allowing to
authenticate the users using ... | 11,855 | Python | .py | 211 | 46.014218 | 100 | 0.665086 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,518 | backends.py | jumpserver_jumpserver/apps/authentication/backends/saml2/backends.py | # -*- coding: utf-8 -*-
#
from django.contrib.auth import get_user_model
from django.conf import settings
from django.db import transaction
from common.utils import get_logger
from authentication.errors import reason_choices, reason_user_invalid
from .signals import (
saml2_create_or_update_user
)
from authenticat... | 2,703 | Python | .py | 60 | 36.483333 | 90 | 0.653861 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,519 | settings.py | jumpserver_jumpserver/apps/authentication/backends/saml2/settings.py | from django.conf import settings
from onelogin.saml2.settings import OneLogin_Saml2_Settings
class JmsSaml2Settings(OneLogin_Saml2_Settings):
def get_sp_key(self):
key = getattr(settings, 'SAML2_SP_KEY_CONTENT', '')
return key
def get_sp_cert(self):
cert = getattr(settings, 'SAML2_SP_... | 359 | Python | .py | 9 | 34.111111 | 61 | 0.70317 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,520 | urls.py | jumpserver_jumpserver/apps/authentication/backends/saml2/urls.py | # -*- coding: utf-8 -*-
#
from django.urls import path
from . import views
urlpatterns = [
path('login/', views.Saml2AuthRequestView.as_view(), name='saml2-login'),
path('logout/', views.Saml2EndSessionView.as_view(), name='saml2-logout'),
path('callback/', views.Saml2AuthCallbackView.as_view(), name='sa... | 423 | Python | .py | 10 | 39.4 | 84 | 0.709756 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,521 | __init__.py | jumpserver_jumpserver/apps/authentication/backends/saml2/__init__.py | # -*- coding: utf-8 -*-
#
from .backends import *
| 51 | Python | .py | 3 | 15.666667 | 23 | 0.595745 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,522 | views.py | jumpserver_jumpserver/apps/authentication/backends/saml2/views.py | import copy
from urllib import parse
from django.conf import settings
from django.contrib import auth
from django.db import IntegrityError
from django.http import HttpResponseRedirect, HttpResponse, HttpResponseServerError
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from djan... | 11,875 | Python | .py | 270 | 33.822222 | 96 | 0.62 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,523 | backends.py | jumpserver_jumpserver/apps/authentication/backends/oauth2/backends.py | # -*- coding: utf-8 -*-
#
import requests
from django.utils.translation import gettext_lazy as _
from django.contrib.auth import get_user_model
from django.utils.http import urlencode
from django.conf import settings
from django.urls import reverse
from common.utils import get_logger
from users.utils import construct... | 6,969 | Python | .py | 154 | 35.201299 | 108 | 0.622405 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,524 | urls.py | jumpserver_jumpserver/apps/authentication/backends/oauth2/urls.py | # -*- coding: utf-8 -*-
#
from django.urls import path
from . import views
urlpatterns = [
path('login/', views.OAuth2AuthRequestView.as_view(), name='login'),
path('callback/', views.OAuth2AuthCallbackView.as_view(), name='login-callback'),
path('logout/', views.OAuth2EndSessionView.as_view(), name='log... | 328 | Python | .py | 9 | 33.777778 | 85 | 0.705696 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,525 | __init__.py | jumpserver_jumpserver/apps/authentication/backends/oauth2/__init__.py | # -*- coding: utf-8 -*-
#
from .backends import *
| 51 | Python | .py | 3 | 15.666667 | 23 | 0.595745 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,526 | views.py | jumpserver_jumpserver/apps/authentication/backends/oauth2/views.py | from django.views import View
from django.conf import settings
from django.contrib import auth
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.utils.http import urlencode
from authentication.utils import build_absolute_uri
from authentication.views.mixins import FlashMessageMix... | 3,580 | Python | .py | 75 | 38.386667 | 101 | 0.661212 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,527 | password.py | jumpserver_jumpserver/apps/authentication/confirm/password.py | from django.utils.translation import gettext_lazy as _
from authentication.mixins import authenticate
from .base import BaseConfirm
class ConfirmPassword(BaseConfirm):
name = 'password'
display_name = _('Password')
def check(self):
return self.user.is_password_authenticate()
def authenticat... | 795 | Python | .py | 22 | 27.590909 | 89 | 0.616688 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,528 | relogin.py | jumpserver_jumpserver/apps/authentication/confirm/relogin.py | from datetime import datetime
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from .base import BaseConfirm
SPECIFIED_TIME = 5
RELOGIN_ERROR = _('Login time has exceeded {} minutes, please login again').format(SPECIFIED_TIME)
class ConfirmReLogin(BaseConfirm):
name = '... | 938 | Python | .py | 22 | 36.181818 | 98 | 0.656388 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,529 | mfa.py | jumpserver_jumpserver/apps/authentication/confirm/mfa.py | from users.models import User
from .base import BaseConfirm
class ConfirmMFA(BaseConfirm):
name = 'mfa'
display_name = 'MFA'
def check(self):
return self.user.active_mfa_backends and self.user.mfa_enabled
@property
def content(self):
backends = User.get_user_mfa_backends(self.us... | 757 | Python | .py | 20 | 30.15 | 70 | 0.647059 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,530 | __init__.py | jumpserver_jumpserver/apps/authentication/confirm/__init__.py | from .mfa import ConfirmMFA
from .password import ConfirmPassword
from .relogin import ConfirmReLogin
CONFIRM_BACKENDS = [ConfirmReLogin, ConfirmPassword, ConfirmMFA]
| 168 | Python | .py | 4 | 40.75 | 64 | 0.865031 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,531 | base.py | jumpserver_jumpserver/apps/authentication/confirm/base.py | import abc
class BaseConfirm(abc.ABC):
def __init__(self, user, request):
self.user = user
self.request = request
@property
@abc.abstractmethod
def name(self) -> str:
return ''
@property
@abc.abstractmethod
def display_name(self) -> str:
return ''
@ab... | 561 | Python | .py | 22 | 19.272727 | 58 | 0.616541 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,532 | ssh_key.py | jumpserver_jumpserver/apps/authentication/serializers/ssh_key.py | # -*- coding: utf-8 -*-
#
from django.db.models import TextChoices
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import ReadableHiddenField, LabeledChoiceField
from ..models import SSHKey
from common.utils import validate_ssh_public_key
fr... | 2,330 | Python | .py | 53 | 36.981132 | 116 | 0.688277 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,533 | token.py | jumpserver_jumpserver/apps/authentication/serializers/token.py | # -*- coding: utf-8 -*-
#
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from acls.serializers.rules import ip_group_child_validator, ip_group_help_text
from common.utils import get_object_or_none, random_string
from users.models import U... | 4,022 | Python | .py | 94 | 34.617021 | 100 | 0.660522 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,534 | __init__.py | jumpserver_jumpserver/apps/authentication/serializers/__init__.py | from .confirm import *
from .connect_token_secret import *
from .connection_token import *
from .password_mfa import *
from .ssh_key import *
from .token import *
| 163 | Python | .py | 6 | 26.166667 | 35 | 0.77707 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,535 | confirm.py | jumpserver_jumpserver/apps/authentication/serializers/confirm.py | from rest_framework import serializers
from common.serializers.fields import EncryptedField
from ..const import ConfirmType, MFAType
class ConfirmSerializer(serializers.Serializer):
confirm_type = serializers.ChoiceField(required=True, allow_blank=True, choices=ConfirmType.choices)
mfa_type = serializers.Cho... | 454 | Python | .py | 7 | 61.714286 | 104 | 0.828829 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,536 | connect_token_secret.py | jumpserver_jumpserver/apps/authentication/serializers/connect_token_secret.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from accounts.const import SecretType
from accounts.models import Account
from acls.models import CommandGroup, CommandFilterACL
from assets.models import Asset, Platform, Gateway, Domain
from assets.serializers.asset import ... | 6,710 | Python | .py | 138 | 42.304348 | 105 | 0.719639 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,537 | password_mfa.py | jumpserver_jumpserver/apps/authentication/serializers/password_mfa.py | # -*- coding: utf-8 -*-
#
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers.fields import EncryptedField
__all__ = [
'MFAChallengeSerializer', 'MFASelectTypeSerializer',
'PasswordVerifySerializer', 'ResetPasswordCodeSerializer',
]
class Res... | 1,661 | Python | .py | 40 | 35.2 | 87 | 0.695896 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,538 | connection_token.py | jumpserver_jumpserver/apps/authentication/serializers/connection_token.py | from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from common.serializers import CommonModelSerializer
from common.serializers.fields import EncryptedField
from perms.serializers.permission import ActionChoicesField
from ..models import ConnectionToken
__all__ = [
'Conn... | 2,827 | Python | .py | 62 | 37.645161 | 96 | 0.656318 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,539 | ssh.py | jumpserver_jumpserver/apps/libs/process/ssh.py | import logging
import psutil
from psutil import NoSuchProcess
logger = logging.getLogger(__name__)
def _should_kill(process):
return process.pid != 1 and process.name() == 'ssh'
def kill_ansible_ssh_process(pid):
try:
process = psutil.Process(pid)
except NoSuchProcess as e:
logger.erro... | 609 | Python | .py | 19 | 25.421053 | 68 | 0.646655 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,540 | custom_common.py | jumpserver_jumpserver/apps/libs/ansible/modules_utils/custom_common.py | import re
import time
import paramiko
from sshtunnel import SSHTunnelForwarder
class OldSSHTransport(paramiko.transport.Transport):
_preferred_pubkeys = (
"ssh-ed25519",
"ecdsa-sha2-nistp256",
"ecdsa-sha2-nistp384",
"ecdsa-sha2-nistp521",
"ssh-rsa",
"rsa-sha2-256",... | 7,523 | Python | .py | 179 | 30.960894 | 110 | 0.58626 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,541 | oracle_common.py | jumpserver_jumpserver/apps/libs/ansible/modules_utils/oracle_common.py | import os
import oracledb
from oracledb.exceptions import DatabaseError
from ansible.module_utils._text import to_native
def oracle_common_argument_spec():
"""
Returns a dict containing common options shared across the Oracle modules.
"""
options = dict(
login_user=dict(type='str', required=... | 3,199 | Python | .py | 80 | 30.175 | 103 | 0.593046 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,542 | custom_command.py | jumpserver_jumpserver/apps/libs/ansible/modules/custom_command.py | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: custom_command
short_description: Adds or removes a user with custom commands by ssh
description:
- You can add or edit users using ssh with custom commands.
options:
protoc... | 2,765 | Python | .py | 95 | 24.357895 | 79 | 0.66365 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,543 | mongodb_user.py | jumpserver_jumpserver/apps/libs/ansible/modules/mongodb_user.py | #!/usr/bin/python
# Modified from ansible_collections.community.mongodb.plugins.modules.mongodb_user
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: mongodb_user
short_description: Adds or removes a user from a MongoDB database
description:
-... | 15,000 | Python | .py | 372 | 33.231183 | 160 | 0.652532 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,544 | oracle_ping.py | jumpserver_jumpserver/apps/libs/ansible/modules/oracle_ping.py | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: oracle_ping
short_description: Check remote Oracle server availability
description:
- Simple module to check remote Oracle server availability.
requirements:
- "oracledb"
'''
EX... | 2,576 | Python | .py | 86 | 25.313953 | 84 | 0.675577 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,545 | oracle_user.py | jumpserver_jumpserver/apps/libs/ansible/modules/oracle_user.py | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: oracle_user
short_description: Adds or removes a user from a Oracle database
description:
- Adds or removes a user from a Oracle database.
options:
authentication_type:
d... | 7,037 | Python | .py | 189 | 30.867725 | 113 | 0.653124 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,546 | rdp_ping.py | jumpserver_jumpserver/apps/libs/ansible/modules/rdp_ping.py | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: custom_rdp_ping
short_description: Use rdp to probe whether an asset is connectable
description:
- Use rdp to probe whether an asset is connectable
'''
EXAMPLES = '''
- name: >... | 4,457 | Python | .py | 122 | 29.360656 | 100 | 0.643355 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,547 | telnet_ping.py | jumpserver_jumpserver/apps/libs/ansible/modules/telnet_ping.py | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: telnet_ping
short_description: Use telnet to probe whether an asset is connectable
description:
- Use telnet to probe whether an asset is connectable
'''
EXAMPLES = '''
- name:... | 1,582 | Python | .py | 54 | 25.296296 | 77 | 0.666667 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,548 | mongodb_ping.py | jumpserver_jumpserver/apps/libs/ansible/modules/mongodb_ping.py | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: mongodb_ping
short_description: Check remote MongoDB server availability
description:
- Simple module to check remote MongoDB server availability.
requirements:
- "pymongo"
'''
... | 3,127 | Python | .py | 103 | 25.359223 | 87 | 0.67011 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,549 | oracle_info.py | jumpserver_jumpserver/apps/libs/ansible/modules/oracle_info.py | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: oracle_info
short_description: Gather information about Oracle servers
description:
- Gathers information about Oracle servers.
options:
filter:
description:
- Limit the ... | 8,190 | Python | .py | 220 | 28.595455 | 105 | 0.594905 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,550 | ssh_ping.py | jumpserver_jumpserver/apps/libs/ansible/modules/ssh_ping.py | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: ssh_ping
short_description: Use ssh to probe whether an asset is connectable
description:
- Use ssh to probe whether an asset is connectable
'''
EXAMPLES = '''
- name: >
P... | 1,239 | Python | .py | 47 | 22.914894 | 76 | 0.670638 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,551 | _copyright.html | jumpserver_jumpserver/apps/templates/_copyright.html | {% if not XPACK_ENABLED %}
<strong>Copyright</strong> {{ COPYRIGHT }}
{% endif %}
| 82 | Python | .py | 3 | 26.333333 | 42 | 0.658228 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,552 | filters.py | jumpserver_jumpserver/apps/accounts/filters.py | # -*- coding: utf-8 -*-
#
from django.db.models import Q
from django_filters import rest_framework as drf_filters
from assets.models import Node
from common.drf.filters import BaseFilterSet
from .models import Account, GatheredAccount, ChangeSecretRecord
class AccountFilterSet(BaseFilterSet):
ip = drf_filters.Ch... | 3,046 | Python | .py | 59 | 45.372881 | 102 | 0.702657 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,553 | mixins.py | jumpserver_jumpserver/apps/accounts/mixins.py | from rest_framework.response import Response
from rest_framework import status
from django.utils import translation
from django.utils.translation import gettext_noop
from audits.const import ActionChoices
from common.views.mixins import RecordViewLogMixin
from common.utils import i18n_fmt
class AccountRecordViewLogM... | 2,676 | Python | .py | 64 | 32.328125 | 91 | 0.626682 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,554 | urls.py | jumpserver_jumpserver/apps/accounts/urls.py | # coding:utf-8
from django.urls import path
from rest_framework_bulk.routes import BulkRouter
from . import api
app_name = 'accounts'
router = BulkRouter()
router.register(r'accounts', api.AccountViewSet, 'account')
router.register(r'virtual-accounts', api.VirtualAccountViewSet, 'virtual-account')
router.register(r... | 3,080 | Python | .py | 41 | 71.756098 | 117 | 0.78324 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,555 | apps.py | jumpserver_jumpserver/apps/accounts/apps.py | from django.apps import AppConfig
class AccountsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'accounts'
verbose_name = 'App Accounts'
def ready(self):
from . import signal_handlers # noqa
from . import tasks # noqa
| 286 | Python | .py | 8 | 30.375 | 56 | 0.698182 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,556 | utils.py | jumpserver_jumpserver/apps/accounts/utils.py | import copy
from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from accounts.const import SecretType, DEFAULT_PASSWORD_RULES
from common.utils import ssh_key_gen, random_string
from common.utils import validate_ssh_private_key, parse_ssh_private_key_str
class SecretGenerat... | 2,157 | Python | .py | 49 | 35.77551 | 102 | 0.659605 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,557 | permissions.py | jumpserver_jumpserver/apps/accounts/permissions.py | from rest_framework import permissions
def check_permissions(request):
act = request.data.get('action')
if act == 'push':
code = 'accounts.push_account'
elif act == 'remove':
code = 'accounts.remove_account'
else:
code = 'accounts.verify_account'
return request.user.has_per... | 538 | Python | .py | 14 | 32.214286 | 63 | 0.693642 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,558 | notifications.py | jumpserver_jumpserver/apps/accounts/notifications.py | from django.template.loader import render_to_string
from django.utils.translation import gettext_lazy as _
from accounts.models import ChangeSecretRecord
from common.tasks import send_mail_attachment_async, upload_backup_to_obj_storage
from notifications.notifications import UserMessage
from terminal.models.component.... | 4,596 | Python | .py | 104 | 34.942308 | 114 | 0.635447 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,559 | signal_handlers.py | jumpserver_jumpserver/apps/accounts/signal_handlers.py | from collections import defaultdict
from django.db.models.signals import post_delete
from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django.utils.translation import gettext_noop
from accounts.backends import vault_client
from accounts.const import Source
from audits.... | 3,366 | Python | .py | 72 | 40.652778 | 101 | 0.723129 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,560 | template.py | jumpserver_jumpserver/apps/accounts/models/template.py | from django.db import models
from django.db.models import Count, Q
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from labels.mixins import LabeledMixin
from .account import Account
from .base import BaseAccount, SecretWithRandomMixin
__all__ = ['AccountTemplate', ]
class A... | 3,210 | Python | .py | 76 | 32.5 | 88 | 0.619124 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,561 | account.py | jumpserver_jumpserver/apps/accounts/models/account.py | from django.db import models
from django.utils.translation import gettext_lazy as _
from simple_history.models import HistoricalRecords
from assets.models.base import AbsConnectivity
from common.utils import lazyproperty
from labels.mixins import LabeledMixin
from .base import BaseAccount
from .mixins import VaultMode... | 5,759 | Python | .py | 132 | 34.424242 | 100 | 0.620396 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,562 | __init__.py | jumpserver_jumpserver/apps/accounts/models/__init__.py | from .account import * # noqa
from .base import * # noqa
from .automations import * # noqa
from .template import * # noqa
from .virtual import * # noqa
| 157 | Python | .py | 5 | 30.4 | 34 | 0.703947 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,563 | base.py | jumpserver_jumpserver/apps/accounts/models/base.py | # -*- coding: utf-8 -*-
#
import os
from hashlib import md5
import sshpubkeys
from django.conf import settings
from django.db import models
from django.utils.translation import gettext_lazy as _
from accounts.const import SecretType, SecretStrategy
from accounts.models.mixins import VaultModelMixin, VaultManagerMixin... | 6,034 | Python | .py | 162 | 29.123457 | 109 | 0.645769 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,564 | virtual.py | jumpserver_jumpserver/apps/accounts/models/virtual.py | from django.db import models
from django.utils.translation import gettext_lazy as _
from accounts.const import AliasAccount
from orgs.mixins.models import JMSOrgBaseModel
__all__ = ['VirtualAccount']
from orgs.utils import tmp_to_org
class VirtualAccount(JMSOrgBaseModel):
alias = models.CharField(max_length=12... | 4,025 | Python | .py | 86 | 37.534884 | 111 | 0.644233 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,565 | vault.py | jumpserver_jumpserver/apps/accounts/models/mixins/vault.py | from django.db import models
from django.db.models.signals import post_save
from django.utils.translation import gettext_lazy as _
from common.db import fields
__all__ = ['VaultQuerySetMixin', 'VaultManagerMixin', 'VaultModelMixin']
class VaultQuerySetMixin(models.QuerySet):
def update(self, **kwargs):
... | 3,224 | Python | .py | 75 | 32.386667 | 98 | 0.627757 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,566 | push_account.py | jumpserver_jumpserver/apps/accounts/models/automations/push_account.py | from django.conf import settings
from django.db import models
from django.utils.translation import gettext_lazy as _
from accounts.const import AutomationTypes
from accounts.models import Account
from .base import AccountBaseAutomation
from .change_secret import ChangeSecretMixin
__all__ = ['PushAccountAutomation']
... | 1,933 | Python | .py | 47 | 33.276596 | 88 | 0.66258 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,567 | change_secret.py | jumpserver_jumpserver/apps/accounts/models/automations/change_secret.py | from django.db import models
from django.utils.translation import gettext_lazy as _
from accounts.const import (
AutomationTypes, ChangeSecretRecordStatusChoice
)
from common.db import fields
from common.db.models import JMSBaseModel
from .base import AccountBaseAutomation, ChangeSecretMixin
__all__ = ['ChangeSec... | 2,136 | Python | .py | 42 | 44.547619 | 103 | 0.707153 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,568 | backup_account.py | jumpserver_jumpserver/apps/accounts/models/automations/backup_account.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import uuid
from celery import current_task
from django.db import models
from django.db.models import F
from django.utils.translation import gettext_lazy as _
from accounts.const import AccountBackupType
from common.const.choices import Trigger
from common.db import fie... | 6,290 | Python | .py | 147 | 34.272109 | 110 | 0.650684 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,569 | __init__.py | jumpserver_jumpserver/apps/accounts/models/automations/__init__.py | from .base import *
from .backup_account import *
from .change_secret import *
from .gather_account import *
from .push_account import *
from .verify_account import *
| 167 | Python | .py | 6 | 26.833333 | 29 | 0.782609 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,570 | gather_account.py | jumpserver_jumpserver/apps/accounts/models/automations/gather_account.py | from django.db import models
from django.db.models import Q
from django.utils.translation import gettext_lazy as _
from accounts.const import AutomationTypes, Source
from accounts.models import Account
from orgs.mixins.models import JMSOrgBaseModel
from .base import AccountBaseAutomation
__all__ = ['GatherAccountsAut... | 2,657 | Python | .py | 62 | 34.483871 | 101 | 0.650658 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,571 | base.py | jumpserver_jumpserver/apps/accounts/models/automations/base.py | from django.db import models
from django.utils.translation import gettext_lazy as _
from accounts.const import SSHKeyStrategy
from accounts.models import Account, SecretWithRandomMixin
from accounts.tasks import execute_account_automation_task
from assets.models.automations import (
BaseAutomation as AssetBaseAuto... | 2,966 | Python | .py | 68 | 35.720588 | 86 | 0.679972 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,572 | verify_account.py | jumpserver_jumpserver/apps/accounts/models/automations/verify_account.py | from django.utils.translation import gettext_lazy as _
from accounts.const import AutomationTypes
from .base import AccountBaseAutomation
__all__ = ['VerifyAccountAutomation']
class VerifyAccountAutomation(AccountBaseAutomation):
def save(self, *args, **kwargs):
self.type = AutomationTypes.verify_accoun... | 426 | Python | .py | 10 | 37.9 | 54 | 0.746959 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,573 | template.py | jumpserver_jumpserver/apps/accounts/tasks/template.py | from datetime import datetime
from celery import shared_task
from django.shortcuts import get_object_or_404
from django.utils.translation import gettext_lazy as _
from orgs.utils import tmp_to_root_org, tmp_to_org
@shared_task(
verbose_name=_('Template sync info to related accounts'),
activity_callback=lamb... | 2,467 | Python | .py | 58 | 32.327586 | 97 | 0.610965 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,574 | push_account.py | jumpserver_jumpserver/apps/accounts/tasks/push_account.py | from celery import shared_task
from django.utils.translation import gettext_noop, gettext_lazy as _
from accounts.const import AutomationTypes
from accounts.tasks.common import quickstart_automation_by_snapshot
from common.utils import get_logger
logger = get_logger(__file__)
__all__ = [
'push_accounts_to_assets_... | 1,256 | Python | .py | 30 | 37.566667 | 92 | 0.735029 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,575 | gather_accounts.py | jumpserver_jumpserver/apps/accounts/tasks/gather_accounts.py | # ~*~ coding: utf-8 ~*~
from celery import shared_task
from django.utils.translation import gettext_lazy as _
from django.utils.translation import gettext_noop
from accounts.const import AutomationTypes
from accounts.tasks.common import quickstart_automation_by_snapshot
from assets.models import Node
from common.utils... | 1,310 | Python | .py | 31 | 38.806452 | 95 | 0.75059 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,576 | remove_account.py | jumpserver_jumpserver/apps/accounts/tasks/remove_account.py | import uuid
from collections import defaultdict
from celery import shared_task, current_task
from django.conf import settings
from django.db.models import Count
from django.utils.translation import gettext_noop, gettext_lazy as _
from accounts.const import AutomationTypes
from accounts.models import Account
from acco... | 3,223 | Python | .py | 72 | 39.958333 | 99 | 0.728056 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,577 | vault.py | jumpserver_jumpserver/apps/accounts/tasks/vault.py | from concurrent.futures import ThreadPoolExecutor, as_completed
from datetime import datetime
from celery import shared_task
from django.utils.translation import gettext_lazy as _
from accounts.backends import vault_client
from accounts.models import Account, AccountTemplate
from common.utils import get_logger
from o... | 2,572 | Python | .py | 61 | 32.016393 | 107 | 0.612835 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,578 | backup_account.py | jumpserver_jumpserver/apps/accounts/tasks/backup_account.py | # -*- coding: utf-8 -*-
#
from celery import shared_task
from django.utils.translation import gettext_lazy as _
from common.utils import get_object_or_none, get_logger
from orgs.utils import tmp_to_org, tmp_to_root_org
logger = get_logger(__file__)
def task_activity_callback(self, pid, trigger, *args, **kwargs):
... | 1,261 | Python | .py | 34 | 32.264706 | 80 | 0.71335 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,579 | __init__.py | jumpserver_jumpserver/apps/accounts/tasks/__init__.py | from .automation import *
from .backup_account import *
from .gather_accounts import *
from .push_account import *
from .remove_account import *
from .template import *
from .verify_account import *
| 199 | Python | .py | 7 | 27.428571 | 30 | 0.791667 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,580 | automation.py | jumpserver_jumpserver/apps/accounts/tasks/automation.py | import datetime
from celery import shared_task
from django.db.models import Q
from django.utils import timezone
from django.utils.translation import gettext_lazy as _, gettext_noop
from accounts.const import AutomationTypes
from accounts.tasks.common import quickstart_automation_by_snapshot
from common.const.crontab ... | 4,764 | Python | .py | 105 | 39.438095 | 98 | 0.713055 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,581 | verify_account.py | jumpserver_jumpserver/apps/accounts/tasks/verify_account.py | from celery import shared_task
from django.utils.translation import gettext_lazy as _
from django.utils.translation import gettext_noop
from accounts.const import AutomationTypes
from accounts.tasks.common import quickstart_automation_by_snapshot
from common.utils import get_logger
from orgs.utils import org_aware_fun... | 1,984 | Python | .py | 49 | 35.918367 | 97 | 0.738565 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,582 | common.py | jumpserver_jumpserver/apps/accounts/tasks/common.py | import uuid
from assets.tasks.common import generate_automation_execution_data
from common.const.choices import Trigger
def quickstart_automation_by_snapshot(task_name, tp, task_snapshot=None):
from accounts.models import AutomationExecution
data = generate_automation_execution_data(task_name, tp, task_snaps... | 564 | Python | .py | 13 | 38.615385 | 75 | 0.752747 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,583 | 0002_auto_20220616_0021.py | jumpserver_jumpserver/apps/accounts/migrations/0002_auto_20220616_0021.py | # Generated by Django 4.1.13 on 2024-05-09 03:16
import django.db.models.deletion
from django.db import migrations, models
import common.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('assets', '0001_initial'),
('accounts', '0001_initial'),
]
ope... | 5,883 | Python | .py | 96 | 48.583333 | 438 | 0.603633 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,584 | 0003_automation.py | jumpserver_jumpserver/apps/accounts/migrations/0003_automation.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 = [
('assets', '0001_initial'),
('terminal', '0001_initial'),
... | 5,224 | Python | .py | 110 | 36.945455 | 182 | 0.633516 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,585 | 0001_initial.py | jumpserver_jumpserver/apps/accounts/migrations/0001_initial.py | # Generated by Django 4.1.13 on 2024-05-09 03:16
import uuid
import simple_history.models
from django.db import migrations, models
import common.db.encoder
import common.db.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateMode... | 14,859 | Python | .py | 215 | 52.748837 | 119 | 0.570609 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,586 | 0004_alter_changesecretrecord_account_and_more.py | jumpserver_jumpserver/apps/accounts/migrations/0004_alter_changesecretrecord_account_and_more.py | # Generated by Django 4.1.13 on 2024-08-26 09:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('assets', '0005_myasset'),
('accounts', '0003_automation'),
]
operations = [
migrations.AlterField(... | 1,000 | Python | .py | 25 | 31.28 | 128 | 0.641237 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,587 | vault.py | jumpserver_jumpserver/apps/accounts/const/vault.py | from django.db import models
from django.utils.translation import gettext_lazy as _
__all__ = ['VaultTypeChoices']
class VaultTypeChoices(models.TextChoices):
local = 'local', _('Database')
hcp = 'hcp', _('HCP Vault')
| 229 | Python | .py | 6 | 35.333333 | 54 | 0.718182 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,588 | account.py | jumpserver_jumpserver/apps/accounts/const/account.py | from django.db.models import TextChoices
from django.utils.translation import gettext_lazy as _
class SecretType(TextChoices):
PASSWORD = 'password', _('Password')
SSH_KEY = 'ssh_key', _('SSH key')
ACCESS_KEY = 'access_key', _('Access key')
TOKEN = 'token', _('Token')
API_KEY = 'api_key', _("API k... | 956 | Python | .py | 25 | 33.68 | 70 | 0.621475 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,589 | __init__.py | jumpserver_jumpserver/apps/accounts/const/__init__.py | from .account import *
from .automation import *
from .vault import *
| 70 | Python | .py | 3 | 22.333333 | 25 | 0.776119 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,590 | automation.py | jumpserver_jumpserver/apps/accounts/const/automation.py | from django.db import models
from django.utils.translation import gettext_lazy as _
from assets.const import Connectivity
from common.db.fields import TreeChoices
DEFAULT_PASSWORD_LENGTH = 30
DEFAULT_PASSWORD_RULES = {
'length': DEFAULT_PASSWORD_LENGTH,
'uppercase': True,
'lowercase': True,
'digit': T... | 4,806 | Python | .py | 92 | 37.315217 | 85 | 0.666413 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,591 | template.py | jumpserver_jumpserver/apps/accounts/api/account/template.py | from django_filters import rest_framework as drf_filters
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.response import Response
from accounts import serializers
from accounts.mixins import AccountRecordViewLogMixin
from accounts.models import AccountTemplate
from ac... | 3,039 | Python | .py | 66 | 39.727273 | 87 | 0.723498 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,592 | account.py | jumpserver_jumpserver/apps/accounts/api/account/account.py | from django.shortcuts import get_object_or_404
from rest_framework.decorators import action
from rest_framework.generics import ListAPIView, CreateAPIView
from rest_framework.response import Response
from rest_framework.status import HTTP_200_OK
from accounts import serializers
from accounts.filters import AccountFilt... | 5,726 | Python | .py | 125 | 38.512 | 108 | 0.698086 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,593 | __init__.py | jumpserver_jumpserver/apps/accounts/api/account/__init__.py | from .account import *
from .task import *
from .template import *
from .virtual import *
| 90 | Python | .py | 4 | 21.5 | 23 | 0.767442 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,594 | task.py | jumpserver_jumpserver/apps/accounts/api/account/task.py | from django.db.models import Q
from rest_framework.generics import CreateAPIView
from accounts import serializers
from accounts.models import Account
from accounts.permissions import AccountTaskActionPermission
from accounts.tasks import (
remove_accounts_task, verify_accounts_connectivity_task, push_accounts_to_a... | 2,162 | Python | .py | 52 | 33.75 | 89 | 0.65555 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,595 | virtual.py | jumpserver_jumpserver/apps/accounts/api/account/virtual.py | from django.shortcuts import get_object_or_404
from accounts.models import VirtualAccount
from accounts.serializers import VirtualAccountSerializer
from common.utils import is_uuid
from orgs.mixins.api import OrgBulkModelViewSet
class VirtualAccountViewSet(OrgBulkModelViewSet):
serializer_class = VirtualAccountS... | 662 | Python | .py | 15 | 39.333333 | 61 | 0.746106 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,596 | push_account.py | jumpserver_jumpserver/apps/accounts/api/automations/push_account.py | # -*- coding: utf-8 -*-
#
from accounts import serializers
from accounts.const import AutomationTypes
from accounts.models import PushAccountAutomation, ChangeSecretRecord
from orgs.mixins.api import OrgBulkModelViewSet
from .base import (
AutomationAssetsListApi, AutomationRemoveAssetApi, AutomationAddAssetApi,
... | 2,285 | Python | .py | 50 | 40.96 | 92 | 0.804603 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,597 | gather_accounts.py | jumpserver_jumpserver/apps/accounts/api/automations/gather_accounts.py | # -*- coding: utf-8 -*-
#
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.response import Response
from accounts import serializers
from accounts.const import AutomationTypes
from accounts.filters import GatheredAccountFilterSet
from accounts.models import GatherAccou... | 2,021 | Python | .py | 48 | 37.291667 | 82 | 0.762997 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,598 | change_secret.py | jumpserver_jumpserver/apps/accounts/api/automations/change_secret.py | # -*- coding: utf-8 -*-
#
from rest_framework import status, mixins
from rest_framework.decorators import action
from rest_framework.response import Response
from accounts import serializers
from accounts.const import AutomationTypes
from accounts.filters import ChangeSecretRecordFilterSet
from accounts.models import ... | 4,050 | Python | .py | 88 | 39.954545 | 91 | 0.75 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
40,599 | backup.py | jumpserver_jumpserver/apps/accounts/api/automations/backup.py | # -*- coding: utf-8 -*-
#
from rest_framework import status, viewsets
from rest_framework.response import Response
from accounts import serializers
from accounts.models import (
AccountBackupAutomation, AccountBackupExecution
)
from accounts.tasks import execute_account_backup_task
from common.const.choices import... | 1,447 | Python | .py | 33 | 39.454545 | 86 | 0.758179 | jumpserver/jumpserver | 25,048 | 5,291 | 48 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |