mirror of https://github.com/jumpserver/jumpserver
feat: 将redis_acl协议合并到redis协议中
parent
aaaa87dd60
commit
9b2e1e08d8
|
@ -19,7 +19,6 @@ from ..tasks import (
|
|||
push_system_user_to_assets_manual, test_system_user_connectivity_manual,
|
||||
push_system_user_to_assets
|
||||
)
|
||||
from ..filters import ProtocolInFilterBackend
|
||||
|
||||
logger = get_logger(__file__)
|
||||
__all__ = [
|
||||
|
@ -41,7 +40,6 @@ class SystemUserViewSet(SuggestionMixin, OrgBulkModelViewSet):
|
|||
'type': ['exact', 'in'],
|
||||
}
|
||||
search_fields = filterset_fields
|
||||
extra_filter_backends = [ProtocolInFilterBackend]
|
||||
serializer_class = serializers.SystemUserSerializer
|
||||
serializer_classes = {
|
||||
'default': serializers.SystemUserSerializer,
|
||||
|
|
|
@ -149,13 +149,3 @@ class IpInFilterBackend(filters.BaseFilterBackend):
|
|||
)
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
class ProtocolInFilterBackend(filters.BaseFilterBackend):
|
||||
def filter_queryset(self, request, queryset, view):
|
||||
protocols = request.query_params.get('protocols')
|
||||
if not protocols:
|
||||
return queryset
|
||||
protocol_list = [i.strip() for i in protocols.split(',')]
|
||||
queryset = queryset.filter(protocol__in=protocol_list)
|
||||
return queryset
|
||||
|
|
|
@ -30,7 +30,6 @@ class ProtocolMixin:
|
|||
vnc = 'vnc', 'VNC'
|
||||
mysql = 'mysql', 'MySQL'
|
||||
redis = 'redis', 'Redis'
|
||||
redis_acl = 'redis_acl', 'Redis ACL'
|
||||
oracle = 'oracle', 'Oracle'
|
||||
mariadb = 'mariadb', 'MariaDB'
|
||||
postgresql = 'postgresql', 'PostgreSQL'
|
||||
|
@ -46,7 +45,7 @@ class ProtocolMixin:
|
|||
Protocol.rdp
|
||||
]
|
||||
APPLICATION_CATEGORY_DB_PROTOCOLS = [
|
||||
Protocol.mysql, Protocol.redis, Protocol.redis_acl, Protocol.oracle,
|
||||
Protocol.mysql, Protocol.redis, Protocol.oracle,
|
||||
Protocol.mariadb, Protocol.postgresql, Protocol.sqlserver
|
||||
]
|
||||
APPLICATION_CATEGORY_CLOUD_PROTOCOLS = [
|
||||
|
|
|
@ -30,7 +30,6 @@ class Session(OrgModelMixin):
|
|||
TELNET = 'telnet', 'telnet'
|
||||
MYSQL = 'mysql', 'mysql'
|
||||
REDIS = 'redis', 'redis'
|
||||
REDIS_ACL = 'redis_acl', 'redis acl'
|
||||
ORACLE = 'oracle', 'oracle'
|
||||
MARIADB = 'mariadb', 'mariadb'
|
||||
SQLSERVER = 'sqlserver', 'sqlserver'
|
||||
|
@ -164,7 +163,7 @@ class Session(OrgModelMixin):
|
|||
@property
|
||||
def db_protocols(self):
|
||||
_PROTOCOL = self.PROTOCOL
|
||||
return [_PROTOCOL.MYSQL, _PROTOCOL.MARIADB, _PROTOCOL.REDIS, _PROTOCOL.REDIS_ACL,
|
||||
return [_PROTOCOL.MYSQL, _PROTOCOL.MARIADB, _PROTOCOL.REDIS,
|
||||
_PROTOCOL.ORACLE, _PROTOCOL.POSTGRESQL, _PROTOCOL.SQLSERVER]
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in New Issue