mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
validate mutually exclusive options in vault-add
https://fedorahosted.org/freeipa/ticket/5195 Reviewed-By: Tomas Babej <tbabej@redhat.com>
This commit is contained in:
parent
196ef09bd2
commit
7d7ffb6252
@ -597,6 +597,18 @@ class vault_add(PKQuery, Local):
|
||||
if 'public_key_file' in options:
|
||||
del options['public_key_file']
|
||||
|
||||
if vault_type != u'symmetric' and (password or password_file):
|
||||
raise errors.MutuallyExclusiveError(
|
||||
reason=_('Password can be specified only for '
|
||||
'symmetric vault')
|
||||
)
|
||||
|
||||
if vault_type != u'asymmetric' and (public_key or public_key_file):
|
||||
raise errors.MutuallyExclusiveError(
|
||||
reason=_('Public key can be specified only for '
|
||||
'asymmetric vault')
|
||||
)
|
||||
|
||||
if self.api.env.in_server:
|
||||
backend = self.api.Backend.ldap2
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user