From add4d8d2cd8a7cc9e9e625291f22b6e1a6e1994c Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 23 Feb 2022 15:47:12 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=BD=95=E5=83=8F=20api=20=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/api/session.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/terminal/api/session.py b/apps/terminal/api/session.py index 6bc76bd81..7c4c79ee9 100644 --- a/apps/terminal/api/session.py +++ b/apps/terminal/api/session.py @@ -164,8 +164,8 @@ class SessionReplayViewSet(AsyncApiMixin, viewsets.ViewSet): download_cache_key = "SESSION_REPLAY_DOWNLOAD_{}" session = None rbac_perms = { - 'create': 'terminal.upload_session', - 'retrieve': 'terminal.download_session', + 'create': 'terminal.upload_sessionreplay', + 'retrieve': 'terminal.download_sessionreplay', } def create(self, request, *args, **kwargs): From e76eec530f4625ee458434f9e02946aaba37149c Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 23 Feb 2022 17:06:07 +0800 Subject: [PATCH 2/7] =?UTF-8?q?perf:=20=E6=B7=BB=E5=8A=A0migrations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0018_auto_20220223_1642.py | 18 ++++++++++++++ .../migrations/0087_auto_20220223_1642.py | 18 ++++++++++++++ apps/common/migrations/0007_permission.py | 24 +++++++++++++++++++ apps/common/models.py | 9 +++++++ apps/jumpserver/api.py | 2 +- .../migrations/0025_auto_20220223_1642.py | 18 ++++++++++++++ apps/rbac/builtin.py | 1 + .../migrations/0044_auto_20220223_1642.py | 18 ++++++++++++++ 8 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 apps/applications/migrations/0018_auto_20220223_1642.py create mode 100644 apps/assets/migrations/0087_auto_20220223_1642.py create mode 100644 apps/common/migrations/0007_permission.py create mode 100644 apps/common/models.py create mode 100644 apps/perms/migrations/0025_auto_20220223_1642.py create mode 100644 apps/terminal/migrations/0044_auto_20220223_1642.py diff --git a/apps/applications/migrations/0018_auto_20220223_1642.py b/apps/applications/migrations/0018_auto_20220223_1642.py new file mode 100644 index 000000000..5f3af1455 --- /dev/null +++ b/apps/applications/migrations/0018_auto_20220223_1642.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.14 on 2022-02-23 08:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('applications', '0017_auto_20220217_2135'), + ] + + operations = [ + migrations.AlterField( + model_name='application', + name='type', + field=models.CharField(choices=[('mysql', 'MySQL'), ('oracle', 'Oracle'), ('postgresql', 'PostgreSQL'), ('mariadb', 'MariaDB'), ('sqlserver', 'SQLServer'), ('redis', 'Redis'), ('mongodb', 'MongoDB'), ('chrome', 'Chrome'), ('mysql_workbench', 'MySQL Workbench'), ('vmware_client', 'vSphere Client'), ('custom', 'Custom'), ('k8s', 'Kubernetes')], max_length=16, verbose_name='Type'), + ), + ] diff --git a/apps/assets/migrations/0087_auto_20220223_1642.py b/apps/assets/migrations/0087_auto_20220223_1642.py new file mode 100644 index 000000000..c2a1b020f --- /dev/null +++ b/apps/assets/migrations/0087_auto_20220223_1642.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.14 on 2022-02-23 08:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('assets', '0086_auto_20220217_2135'), + ] + + operations = [ + migrations.AlterField( + model_name='systemuser', + name='protocol', + field=models.CharField(choices=[('ssh', 'SSH'), ('rdp', 'RDP'), ('telnet', 'Telnet'), ('vnc', 'VNC'), ('mysql', 'MySQL'), ('oracle', 'Oracle'), ('mariadb', 'MariaDB'), ('postgresql', 'PostgreSQL'), ('sqlserver', 'SQLServer'), ('redis', 'Redis'), ('mongodb', 'MongoDB'), ('k8s', 'K8S')], default='ssh', max_length=16, verbose_name='Protocol'), + ), + ] diff --git a/apps/common/migrations/0007_permission.py b/apps/common/migrations/0007_permission.py new file mode 100644 index 000000000..8794b7c5b --- /dev/null +++ b/apps/common/migrations/0007_permission.py @@ -0,0 +1,24 @@ +# Generated by Django 3.1.14 on 2022-02-23 08:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('common', '0006_auto_20190304_1515'), + ] + + operations = [ + migrations.CreateModel( + name='Permission', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ], + options={ + 'permissions': [('view_resourcestatistics', 'Can view resource statistics')], + }, + ), + ] diff --git a/apps/common/models.py b/apps/common/models.py new file mode 100644 index 000000000..e716113cd --- /dev/null +++ b/apps/common/models.py @@ -0,0 +1,9 @@ +from django.db import models +from django.utils.translation import gettext_lazy as _ + + +class Permission(models.Model): + class Meta: + permissions = [ + ('view_resourcestatistics', _('Can view resource statistics')) + ] diff --git a/apps/jumpserver/api.py b/apps/jumpserver/api.py index 8edc35e76..d69d27c68 100644 --- a/apps/jumpserver/api.py +++ b/apps/jumpserver/api.py @@ -214,7 +214,7 @@ class DatesLoginMetricMixin: class IndexApi(DatesLoginMetricMixin, APIView): http_method_names = ['get'] rbac_perms = { - 'GET': 'view_auditview' + 'GET': 'common.view_resourcestatistics' } def get(self, request, *args, **kwargs): diff --git a/apps/perms/migrations/0025_auto_20220223_1642.py b/apps/perms/migrations/0025_auto_20220223_1642.py new file mode 100644 index 000000000..120039e40 --- /dev/null +++ b/apps/perms/migrations/0025_auto_20220223_1642.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.14 on 2022-02-23 08:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('perms', '0024_auto_20220217_2135'), + ] + + operations = [ + migrations.AlterField( + model_name='applicationpermission', + name='type', + field=models.CharField(choices=[('mysql', 'MySQL'), ('oracle', 'Oracle'), ('postgresql', 'PostgreSQL'), ('mariadb', 'MariaDB'), ('sqlserver', 'SQLServer'), ('redis', 'Redis'), ('mongodb', 'MongoDB'), ('chrome', 'Chrome'), ('mysql_workbench', 'MySQL Workbench'), ('vmware_client', 'vSphere Client'), ('custom', 'Custom'), ('k8s', 'Kubernetes')], max_length=16, verbose_name='Type'), + ), + ] diff --git a/apps/rbac/builtin.py b/apps/rbac/builtin.py index 71f7d0bc4..6d8d2490f 100644 --- a/apps/rbac/builtin.py +++ b/apps/rbac/builtin.py @@ -4,6 +4,7 @@ from .const import Scope, system_exclude_permissions, org_exclude_permissions auditor_perms = ( + ('common', 'permission', 'view', 'resourcestatistics'), ('audits', '*', '*', '*'), ('rbac', 'menupermission', 'view', 'auditview'), ('terminal', 'session', '*', '*'), diff --git a/apps/terminal/migrations/0044_auto_20220223_1642.py b/apps/terminal/migrations/0044_auto_20220223_1642.py new file mode 100644 index 000000000..463312f8e --- /dev/null +++ b/apps/terminal/migrations/0044_auto_20220223_1642.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.14 on 2022-02-23 08:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('terminal', '0043_auto_20220217_2135'), + ] + + operations = [ + migrations.AlterField( + model_name='session', + name='protocol', + field=models.CharField(choices=[('ssh', 'ssh'), ('rdp', 'rdp'), ('vnc', 'vnc'), ('telnet', 'telnet'), ('mysql', 'mysql'), ('oracle', 'oracle'), ('mariadb', 'mariadb'), ('sqlserver', 'sqlserver'), ('postgresql', 'postgresql'), ('redis', 'redis'), ('mongodb', 'MongoDB'), ('k8s', 'kubernetes')], db_index=True, default='ssh', max_length=16), + ), + ] From a1d15ef20668083299149e1b9465e8d1bf450c47 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 23 Feb 2022 17:09:09 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E7=BB=88=E6=96=AD=E4=BC=9A=E8=AF=9DAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/api/task.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/terminal/api/task.py b/apps/terminal/api/task.py index 937ed2faf..c7e1a2681 100644 --- a/apps/terminal/api/task.py +++ b/apps/terminal/api/task.py @@ -12,7 +12,6 @@ from .. import serializers from terminal.utils import is_session_approver from orgs.utils import tmp_to_root_org - __all__ = ['TaskViewSet', 'KillSessionAPI', 'KillSessionForTicketAPI'] logger = logging.getLogger(__file__) @@ -45,6 +44,11 @@ class KillSessionAPI(APIView): 'POST': 'terminal.terminate_session' } + def post(self, request, *args, **kwargs): + session_ids = request.data + validated_session = kill_sessions(session_ids, request.user) + return Response({"ok": validated_session}) + class KillSessionForTicketAPI(APIView): permission_classes = (IsAuthenticated, ) @@ -61,4 +65,3 @@ class KillSessionForTicketAPI(APIView): validated_session = kill_sessions(session_ids, request.user) return Response({"ok": validated_session}) - From 291f2b0e135bdc15b172a009175830eac986aab8 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Wed, 23 Feb 2022 18:28:23 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=87=BA=E7=8E=B0=E6=9C=8D=E5=8A=A1=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/models/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/users/models/user.py b/apps/users/models/user.py index e40aedf17..f99434745 100644 --- a/apps/users/models/user.py +++ b/apps/users/models/user.py @@ -341,7 +341,7 @@ class RoleMixin: @classmethod def get_org_users(cls, org=None): - queryset = cls.objects.all() + queryset = cls.get_nature_users() if org is None: org = current_org if not org.is_root(): From 8604b9019f7d10b0c52f080d88cadf61b50451d7 Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Wed, 23 Feb 2022 16:14:19 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0018_auto_20220223_1539.py | 18 ++++++++++++++++++ .../migrations/0087_auto_20220223_1539.py | 18 ++++++++++++++++++ .../migrations/0025_auto_20220223_1539.py | 18 ++++++++++++++++++ .../migrations/0044_auto_20220223_1539.py | 18 ++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 apps/applications/migrations/0018_auto_20220223_1539.py create mode 100644 apps/assets/migrations/0087_auto_20220223_1539.py create mode 100644 apps/perms/migrations/0025_auto_20220223_1539.py create mode 100644 apps/terminal/migrations/0044_auto_20220223_1539.py diff --git a/apps/applications/migrations/0018_auto_20220223_1539.py b/apps/applications/migrations/0018_auto_20220223_1539.py new file mode 100644 index 000000000..637d8cb86 --- /dev/null +++ b/apps/applications/migrations/0018_auto_20220223_1539.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.13 on 2022-02-23 07:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('applications', '0017_auto_20220217_2135'), + ] + + operations = [ + migrations.AlterField( + model_name='application', + name='type', + field=models.CharField(choices=[('mysql', 'MySQL'), ('oracle', 'Oracle'), ('postgresql', 'PostgreSQL'), ('mariadb', 'MariaDB'), ('sqlserver', 'SQLServer'), ('redis', 'Redis'), ('mongodb', 'MongoDB'), ('chrome', 'Chrome'), ('mysql_workbench', 'MySQL Workbench'), ('vmware_client', 'vSphere Client'), ('custom', 'Custom'), ('k8s', 'Kubernetes')], max_length=16, verbose_name='Type'), + ), + ] diff --git a/apps/assets/migrations/0087_auto_20220223_1539.py b/apps/assets/migrations/0087_auto_20220223_1539.py new file mode 100644 index 000000000..6c3302e51 --- /dev/null +++ b/apps/assets/migrations/0087_auto_20220223_1539.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.13 on 2022-02-23 07:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('assets', '0086_auto_20220217_2135'), + ] + + operations = [ + migrations.AlterField( + model_name='systemuser', + name='protocol', + field=models.CharField(choices=[('ssh', 'SSH'), ('rdp', 'RDP'), ('telnet', 'Telnet'), ('vnc', 'VNC'), ('mysql', 'MySQL'), ('oracle', 'Oracle'), ('mariadb', 'MariaDB'), ('postgresql', 'PostgreSQL'), ('sqlserver', 'SQLServer'), ('redis', 'Redis'), ('mongodb', 'MongoDB'), ('k8s', 'K8S')], default='ssh', max_length=16, verbose_name='Protocol'), + ), + ] diff --git a/apps/perms/migrations/0025_auto_20220223_1539.py b/apps/perms/migrations/0025_auto_20220223_1539.py new file mode 100644 index 000000000..47d3487c7 --- /dev/null +++ b/apps/perms/migrations/0025_auto_20220223_1539.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.13 on 2022-02-23 07:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('perms', '0024_auto_20220217_2135'), + ] + + operations = [ + migrations.AlterField( + model_name='applicationpermission', + name='type', + field=models.CharField(choices=[('mysql', 'MySQL'), ('oracle', 'Oracle'), ('postgresql', 'PostgreSQL'), ('mariadb', 'MariaDB'), ('sqlserver', 'SQLServer'), ('redis', 'Redis'), ('mongodb', 'MongoDB'), ('chrome', 'Chrome'), ('mysql_workbench', 'MySQL Workbench'), ('vmware_client', 'vSphere Client'), ('custom', 'Custom'), ('k8s', 'Kubernetes')], max_length=16, verbose_name='Type'), + ), + ] diff --git a/apps/terminal/migrations/0044_auto_20220223_1539.py b/apps/terminal/migrations/0044_auto_20220223_1539.py new file mode 100644 index 000000000..a1557b008 --- /dev/null +++ b/apps/terminal/migrations/0044_auto_20220223_1539.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.13 on 2022-02-23 07:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('terminal', '0043_auto_20220217_2135'), + ] + + operations = [ + migrations.AlterField( + model_name='session', + name='protocol', + field=models.CharField(choices=[('ssh', 'ssh'), ('rdp', 'rdp'), ('vnc', 'vnc'), ('telnet', 'telnet'), ('mysql', 'mysql'), ('oracle', 'oracle'), ('mariadb', 'mariadb'), ('sqlserver', 'sqlserver'), ('postgresql', 'postgresql'), ('redis', 'redis'), ('mongodb', 'MongoDB'), ('k8s', 'kubernetes')], db_index=True, default='ssh', max_length=16), + ), + ] From bbf32501613b407865b1c15aaddeb70caf5b95a6 Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Wed, 23 Feb 2022 14:43:47 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/users/api/user.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/users/api/user.py b/apps/users/api/user.py index 7fcd29f18..dc818a5cb 100644 --- a/apps/users/api/user.py +++ b/apps/users/api/user.py @@ -23,7 +23,6 @@ from ..models import User from ..signals import post_user_create from ..filters import UserFilter - logger = get_logger(__name__) __all__ = [ 'UserViewSet', 'UserChangePasswordApi', @@ -40,7 +39,7 @@ class UserViewSet(CommonApiMixin, UserQuerysetMixin, BulkModelViewSet): 'invite': InviteSerializer, } ordering_fields = ('name',) - ordering = ('name', ) + ordering = ('name',) rbac_perms = { 'suggestion': 'users.match_user', 'invite': 'users.invite_user', @@ -52,6 +51,19 @@ class UserViewSet(CommonApiMixin, UserQuerysetMixin, BulkModelViewSet): queryset = super().get_queryset().prefetch_related('groups') return queryset + def list(self, request, *args, **kwargs): + queryset = self.filter_queryset(self.get_queryset()) + + page = self.paginate_queryset(queryset) + if page is not None: + page = self.set_users_roles_for_cache(page) + serializer = self.get_serializer(page, many=True) + return self.get_paginated_response(serializer.data) + + queryset = self.set_users_roles_for_cache(queryset) + serializer = self.get_serializer(queryset, many=True) + return Response(serializer.data) + @staticmethod def set_users_roles_for_cache(queryset): # Todo: 未来有机会用 SQL 实现 @@ -80,11 +92,6 @@ class UserViewSet(CommonApiMixin, UserQuerysetMixin, BulkModelViewSet): u.system_roles.cache_set(system_roles) return queryset_list - def filter_queryset(self, queryset): - queryset = super().filter_queryset(queryset) - queryset_list = self.set_users_roles_for_cache(queryset) - return queryset_list - def perform_create(self, serializer): users = serializer.save() if isinstance(users, User): From 9c3fd59ef4e968b91dd55ceb2d5ebca42d334efa Mon Sep 17 00:00:00 2001 From: xinwen Date: Tue, 22 Feb 2022 19:02:17 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E7=99=BB=E5=BD=95=E7=9A=84=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/api/session.py | 41 +--------------------------------- apps/terminal/urls/api_urls.py | 1 - 2 files changed, 1 insertion(+), 41 deletions(-) diff --git a/apps/terminal/api/session.py b/apps/terminal/api/session.py index 7c4c79ee9..334a19cf4 100644 --- a/apps/terminal/api/session.py +++ b/apps/terminal/api/session.py @@ -3,7 +3,6 @@ import os import tarfile -from django.db.models import F, Max from django.shortcuts import get_object_or_404, reverse from django.utils.translation import ugettext as _ from django.utils.encoding import escape_uri_path @@ -16,7 +15,6 @@ from rest_framework.permissions import IsAuthenticated from rest_framework import generics from common.utils import data_to_json -from assets.models import Asset from common.const.http import GET from common.utils import get_logger, get_object_or_none from common.mixins.api import AsyncApiMixin @@ -30,11 +28,10 @@ from ..utils import find_session_replay_local, download_session_replay from ..models import Session from .. import serializers from terminal.utils import is_session_approver -from assets.serializers import AssetSerializer __all__ = [ 'SessionViewSet', 'SessionReplayViewSet', 'SessionJoinValidateAPI', - 'MySessionAPIView', 'MySessionAssetAPIView', + 'MySessionAPIView', ] logger = get_logger(__name__) @@ -51,42 +48,6 @@ class MySessionAPIView(generics.ListAPIView): return qs -class MySessionAssetAPIView(generics.ListAPIView): - queryset = Asset.objects.all() - permission_classes = (IsAuthenticated, ) - serializer_class = AssetSerializer - - def list(self, request, *args, **kwargs): - with tmp_to_root_org(): - user = self.request.user - - asset_ids = Session.objects.filter(user_id=user.id).exclude( - asset_id='' # xrdp bug 没有提交 asset_id,已修复,但要兼容旧数据 - ).values_list('asset_id').annotate( - max_date_start=Max(F('date_start')) - ).order_by('-max_date_start').values_list('asset_id', flat=True) - page = self.paginate_queryset(asset_ids) - if page is not None: - serializer = self._to_serializer(page) - return self.get_paginated_response(serializer.data) - - serializer = self._to_serializer(asset_ids) - return Response(serializer.data) - - def _to_serializer(self, asset_ids): - assets_qs = Asset.objects.filter(id__in=list(asset_ids)) - serializer_cls = self.get_serializer_class() - if hasattr(serializer_cls, 'setup_eager_loading'): - assets_qs = serializer_cls.setup_eager_loading(assets_qs) - - id_asset_map = {str(asset.id): asset for asset in assets_qs} - assets = [] - for i in asset_ids: - assets.append(id_asset_map[i]) - serializer = self.get_serializer(assets, many=True) - return serializer - - class SessionViewSet(OrgBulkModelViewSet): model = Session serializer_classes = { diff --git a/apps/terminal/urls/api_urls.py b/apps/terminal/urls/api_urls.py index f03ba083a..9366332e2 100644 --- a/apps/terminal/urls/api_urls.py +++ b/apps/terminal/urls/api_urls.py @@ -24,7 +24,6 @@ router.register(r'session-sharings', api.SessionSharingViewSet, 'session-sharing router.register(r'session-join-records', api.SessionJoinRecordsViewSet, 'session-sharing-record') urlpatterns = [ - path('my-login-assets/', api.MySessionAssetAPIView.as_view(), name='my-login-asset'), path('my-sessions/', api.MySessionAPIView.as_view(), name='my-session'), path('terminal-registrations/', api.TerminalRegistrationApi.as_view(), name='terminal-registration'), path('registration/', api.TerminalRegistrationApi.as_view(), name='registration'),