mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipa-passwd: add OTP support
https://fedorahosted.org/freeipa/ticket/4262 Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
3
API.txt
3
API.txt
@@ -2409,10 +2409,11 @@ output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDA
|
||||
output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None)
|
||||
output: PrimaryKey('value', None, None)
|
||||
command: passwd
|
||||
args: 3,1,3
|
||||
args: 3,2,3
|
||||
arg: Str('principal', autofill=True, cli_name='user', primary_key=True)
|
||||
arg: Password('password')
|
||||
arg: Password('current_password', autofill=True, confirm=False)
|
||||
option: Password('otp?', confirm=False)
|
||||
option: Str('version?', exclude='webui')
|
||||
output: Output('result', <type 'bool'>, None)
|
||||
output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), None)
|
||||
|
||||
4
VERSION
4
VERSION
@@ -89,5 +89,5 @@ IPA_DATA_VERSION=20100614120000
|
||||
# #
|
||||
########################################################
|
||||
IPA_API_VERSION_MAJOR=2
|
||||
IPA_API_VERSION_MINOR=93
|
||||
# Last change: mbasti - New record type added: DLV
|
||||
IPA_API_VERSION_MINOR=94
|
||||
# Last change: pvoborni - Add OTP option to passwd command
|
||||
|
||||
@@ -89,6 +89,14 @@ class passwd(Command):
|
||||
),
|
||||
)
|
||||
|
||||
takes_options = (
|
||||
Password('otp?',
|
||||
label=_('OTP'),
|
||||
doc=_('One Time Password'),
|
||||
confirm=False,
|
||||
),
|
||||
)
|
||||
|
||||
has_output = output.standard_value
|
||||
msg_summary = _('Changed password for "%(value)s"')
|
||||
|
||||
@@ -121,7 +129,8 @@ class passwd(Command):
|
||||
if current_password == MAGIC_VALUE:
|
||||
ldap.modify_password(entry_attrs.dn, password)
|
||||
else:
|
||||
ldap.modify_password(entry_attrs.dn, password, current_password)
|
||||
otp = options.get('otp')
|
||||
ldap.modify_password(entry_attrs.dn, password, current_password, otp)
|
||||
|
||||
return dict(
|
||||
result=True,
|
||||
|
||||
Reference in New Issue
Block a user