mirror of https://github.com/jumpserver/jumpserver
Merge remote-tracking branch 'origin/v3' into v3
commit
41ee6a64bd
|
@ -64,7 +64,7 @@ class LoginAssetACL(BaseACL, OrgModelMixin):
|
|||
Q(assets__hostname_group__contains=asset.name) |
|
||||
Q(assets__hostname_group__contains='*')
|
||||
)
|
||||
ids = [q.id for q in queryset if contains_ip(asset.ip, q.assets.get('ip_group', []))]
|
||||
ids = [q.id for q in queryset if contains_ip(asset.address, q.assets.get('ip_group', []))]
|
||||
queryset = cls.objects.filter(id__in=ids)
|
||||
return queryset
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class AccountViewSet(OrgBulkModelViewSet):
|
|||
}
|
||||
rbac_perms = {
|
||||
'verify': 'assets.test_account',
|
||||
'partial_update': 'assets.change_assetaccountsecret',
|
||||
'partial_update': 'assets.change_accountsecret',
|
||||
}
|
||||
|
||||
@action(methods=['post'], detail=True, url_path='verify')
|
||||
|
|
|
@ -39,8 +39,11 @@ class GatherAccountsFilter:
|
|||
|
||||
@staticmethod
|
||||
def windows_filter(info):
|
||||
# TODO
|
||||
info = info[4:-2]
|
||||
result = {}
|
||||
for i in info:
|
||||
for username in i.split():
|
||||
result[username] = {}
|
||||
return result
|
||||
|
||||
def run(self, method_id_meta_mapper, info):
|
||||
|
|
|
@ -142,7 +142,7 @@ class IpInFilterBackend(filters.BaseFilterBackend):
|
|||
if not ips:
|
||||
return queryset
|
||||
ip_list = [i.strip() for i in ips.split(',')]
|
||||
queryset = queryset.filter(ip__in=ip_list)
|
||||
queryset = queryset.filter(address__in=ip_list)
|
||||
return queryset
|
||||
|
||||
def get_schema_fields(self, view):
|
||||
|
|
|
@ -113,7 +113,7 @@ class ConnectionTokenAssetSerializer(serializers.ModelSerializer):
|
|||
""" Asset """
|
||||
class Meta:
|
||||
model = Asset
|
||||
fields = ['id', 'name', 'ip', 'protocols', 'org_id']
|
||||
fields = ['id', 'name', 'address', 'protocols', 'org_id']
|
||||
|
||||
|
||||
class ConnectionTokenAccountSerializer(serializers.ModelSerializer):
|
||||
|
|
Loading…
Reference in New Issue