mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-14 06:19:17 +00:00
perf: rename ad to ds
This commit is contained in:
@@ -139,17 +139,25 @@ class Account(AbsConnectivity, LabeledMixin, BaseAccount, JSONFilterMixin):
|
||||
return self.id
|
||||
|
||||
@lazyproperty
|
||||
def ad_domain(self):
|
||||
def ds_id(self):
|
||||
if self.username.startswith('@'):
|
||||
return None
|
||||
if self.platform.category == 'ad':
|
||||
return self.asset.ad.domain_name
|
||||
if self.platform.category == 'ds':
|
||||
return self.asset.directoryservice.id
|
||||
return None
|
||||
|
||||
@lazyproperty
|
||||
def ds_domain(self):
|
||||
if self.username.startswith('@'):
|
||||
return None
|
||||
if self.ds_id:
|
||||
return self.asset.ds.domain_name
|
||||
return None
|
||||
|
||||
@lazyproperty
|
||||
def full_username(self):
|
||||
if self.ad_domain:
|
||||
return '{}@{}'.format(self.username, self.ad_domain)
|
||||
if self.ds_domain:
|
||||
return '{}@{}'.format(self.username, self.ds_domain)
|
||||
return self.username
|
||||
|
||||
@lazyproperty
|
||||
|
@@ -241,7 +241,7 @@ class AccountSerializer(AccountCreateUpdateSerializerMixin, BaseAccountSerialize
|
||||
'date_change_secret', 'change_secret_status'
|
||||
]
|
||||
fields = BaseAccountSerializer.Meta.fields + [
|
||||
'su_from', 'asset', 'version', "ad_domain",
|
||||
'su_from', 'asset', 'version', 'ds_domain',
|
||||
'source', 'source_id', 'secret_reset',
|
||||
] + AccountCreateUpdateSerializerMixin.Meta.fields + automation_fields
|
||||
read_only_fields = BaseAccountSerializer.Meta.read_only_fields + automation_fields
|
||||
|
@@ -87,7 +87,7 @@ class BaseAccountSerializer(
|
||||
"username": {
|
||||
"help_text": _(
|
||||
"* If no username is required for authentication, enter null. "
|
||||
"For AD accounts, use the format username@domain."
|
||||
"For DS accounts, use the format username@domain."
|
||||
)
|
||||
},
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ class VirtualAccountSerializer(serializers.ModelSerializer):
|
||||
'username': {'label': _('Username')},
|
||||
'secret_from_login': {
|
||||
'help_text': _(
|
||||
'Current only support login from AD/LDAP. Secret priority: '
|
||||
'Current only support login from DS/LDAP. Secret priority: '
|
||||
'Same account in asset secret > Login secret > Manual input. <br/ >'
|
||||
'For security, please set config CACHE_LOGIN_PASSWORD_ENABLED to true'
|
||||
)
|
||||
|
Reference in New Issue
Block a user