mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
vault: copy arguments of client commands from server counterparts
Copy arguments of vault_{add,mod,archive,retrieve} from vault_{add,mod,archive,retrieve}_internal. Also add missing LDAPCreate arguments to vault_add_internal. This will make it possible to move the commands to ipaclient. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
parent
b09b92831f
commit
4b119e21a2
21
API.txt
21
API.txt
@ -5501,13 +5501,14 @@ output: Output('result', type=[<type 'bool'>])
|
||||
output: Output('summary', type=[<type 'unicode'>, <type 'NoneType'>])
|
||||
output: PrimaryKey('value')
|
||||
command: vault_add
|
||||
args: 1,14,3
|
||||
args: 1,15,3
|
||||
arg: Str('cn', cli_name='name')
|
||||
option: Str('addattr*', cli_name='addattr')
|
||||
option: Flag('all', autofill=True, cli_name='all', default=False)
|
||||
option: Str('description?', cli_name='desc')
|
||||
option: Bytes('ipavaultpublickey?', cli_name='public_key')
|
||||
option: StrEnum('ipavaulttype?', autofill=True, cli_name='type', default=u'symmetric', values=[u'standard', u'symmetric', u'asymmetric'])
|
||||
option: Flag('no_members', autofill=True, default=False)
|
||||
option: Str('password?', cli_name='password')
|
||||
option: Str('password_file?', cli_name='password_file')
|
||||
option: Str('public_key_file?', cli_name='public_key_file')
|
||||
@ -5521,8 +5522,9 @@ output: Entry('result')
|
||||
output: Output('summary', type=[<type 'unicode'>, <type 'NoneType'>])
|
||||
output: PrimaryKey('value')
|
||||
command: vault_add_internal
|
||||
args: 1,11,3
|
||||
args: 1,13,3
|
||||
arg: Str('cn', cli_name='name')
|
||||
option: Str('addattr*', cli_name='addattr')
|
||||
option: Flag('all', autofill=True, cli_name='all', default=False)
|
||||
option: Str('description?', cli_name='desc')
|
||||
option: Bytes('ipavaultpublickey?', cli_name='public_key')
|
||||
@ -5531,6 +5533,7 @@ option: StrEnum('ipavaulttype?', autofill=True, cli_name='type', default=u'symme
|
||||
option: Flag('no_members', autofill=True, default=False)
|
||||
option: Flag('raw', autofill=True, cli_name='raw', default=False)
|
||||
option: Str('service?')
|
||||
option: Str('setattr*', cli_name='setattr')
|
||||
option: Flag('shared?', autofill=True, default=False)
|
||||
option: Str('username?', cli_name='user')
|
||||
option: Str('version?')
|
||||
@ -5635,23 +5638,27 @@ output: ListOfEntries('result')
|
||||
output: Output('summary', type=[<type 'unicode'>, <type 'NoneType'>])
|
||||
output: Output('truncated', type=[<type 'bool'>])
|
||||
command: vault_mod
|
||||
args: 1,18,3
|
||||
args: 1,22,3
|
||||
arg: Str('cn', cli_name='name')
|
||||
option: Str('addattr*', cli_name='addattr')
|
||||
option: Flag('all', autofill=True, cli_name='all', default=False)
|
||||
option: Flag('change_password?', autofill=True, default=False)
|
||||
option: Str('description?', cli_name='desc')
|
||||
option: Bytes('ipavaultpublickey?', cli_name='public_key')
|
||||
option: Bytes('ipavaultsalt?', cli_name='salt')
|
||||
option: Str('ipavaulttype?', cli_name='type')
|
||||
option: Str('delattr*', cli_name='delattr')
|
||||
option: Str('description?', autofill=False, cli_name='desc')
|
||||
option: Bytes('ipavaultpublickey?', autofill=False, cli_name='public_key')
|
||||
option: StrEnum('ipavaulttype?', autofill=False, cli_name='type', default=u'symmetric', values=[u'standard', u'symmetric', u'asymmetric'])
|
||||
option: Str('new_password?', cli_name='new_password')
|
||||
option: Str('new_password_file?', cli_name='new_password_file')
|
||||
option: Flag('no_members', autofill=True, default=False)
|
||||
option: Str('old_password?', cli_name='old_password')
|
||||
option: Str('old_password_file?', cli_name='old_password_file')
|
||||
option: Bytes('private_key?', cli_name='private_key')
|
||||
option: Str('private_key_file?', cli_name='private_key_file')
|
||||
option: Str('public_key_file?', cli_name='public_key_file')
|
||||
option: Flag('raw', autofill=True, cli_name='raw', default=False)
|
||||
option: Flag('rights', autofill=True, default=False)
|
||||
option: Str('service?')
|
||||
option: Str('setattr*', cli_name='setattr')
|
||||
option: Flag('shared?', autofill=True, default=False)
|
||||
option: Str('username?', cli_name='user')
|
||||
option: Str('version?')
|
||||
|
4
VERSION
4
VERSION
@ -90,5 +90,5 @@ IPA_DATA_VERSION=20100614120000
|
||||
# #
|
||||
########################################################
|
||||
IPA_API_VERSION_MAJOR=2
|
||||
IPA_API_VERSION_MINOR=168
|
||||
# Last change: otptoken_yubikey: fix otptoken_add_yubikey arguments
|
||||
IPA_API_VERSION_MINOR=169
|
||||
# Last change: vault: copy arguments of client commands from server counterparts
|
||||
|
@ -895,24 +895,10 @@ def decrypt(data, symmetric_key=None, private_key=None):
|
||||
|
||||
|
||||
@register()
|
||||
class vault_add(PKQuery, Local):
|
||||
class vault_add(Local):
|
||||
__doc__ = _('Create a new vault.')
|
||||
|
||||
takes_options = LDAPCreate.takes_options + vault_options + (
|
||||
Str(
|
||||
'description?',
|
||||
cli_name='desc',
|
||||
doc=_('Vault description'),
|
||||
),
|
||||
StrEnum(
|
||||
'ipavaulttype?',
|
||||
cli_name='type',
|
||||
label=_('Type'),
|
||||
doc=_('Vault type'),
|
||||
values=(u'standard', u'symmetric', u'asymmetric', ),
|
||||
default=u'symmetric',
|
||||
autofill=True,
|
||||
),
|
||||
takes_options = (
|
||||
Str(
|
||||
'password?',
|
||||
cli_name='password',
|
||||
@ -923,11 +909,6 @@ class vault_add(PKQuery, Local):
|
||||
cli_name='password_file',
|
||||
doc=_('File containing the vault password'),
|
||||
),
|
||||
Bytes(
|
||||
'ipavaultpublickey?',
|
||||
cli_name='public_key',
|
||||
doc=_('Vault public key'),
|
||||
),
|
||||
Str( # TODO: use File parameter
|
||||
'public_key_file?',
|
||||
cli_name='public_key_file',
|
||||
@ -935,7 +916,21 @@ class vault_add(PKQuery, Local):
|
||||
),
|
||||
)
|
||||
|
||||
has_output = output.standard_entry
|
||||
def get_args(self):
|
||||
for arg in self.api.Command.vault_add_internal.args():
|
||||
yield arg
|
||||
for arg in super(vault_add, self).get_args():
|
||||
yield arg
|
||||
|
||||
def get_options(self):
|
||||
for option in self.api.Command.vault_add_internal.options():
|
||||
if option.name not in ('ipavaultsalt', 'version'):
|
||||
yield option
|
||||
for option in super(vault_add, self).get_options():
|
||||
yield option
|
||||
|
||||
def _iter_output(self):
|
||||
return self.api.Command.vault_add_internal.output()
|
||||
|
||||
def forward(self, *args, **options):
|
||||
|
||||
@ -1062,7 +1057,7 @@ class vault_add_internal(LDAPCreate):
|
||||
|
||||
NO_CLI = True
|
||||
|
||||
takes_options = vault_options
|
||||
takes_options = LDAPCreate.takes_options + vault_options
|
||||
|
||||
msg_summary = _('Added vault "%(value)s"')
|
||||
|
||||
@ -1208,25 +1203,10 @@ class vault_find(LDAPSearch):
|
||||
|
||||
|
||||
@register()
|
||||
class vault_mod(PKQuery, Local):
|
||||
class vault_mod(Local):
|
||||
__doc__ = _('Modify a vault.')
|
||||
|
||||
takes_options = vault_options + (
|
||||
Str(
|
||||
'description?',
|
||||
cli_name='desc',
|
||||
doc=_('Vault description'),
|
||||
),
|
||||
Str(
|
||||
'ipavaulttype?',
|
||||
cli_name='type',
|
||||
doc=_('Vault type'),
|
||||
),
|
||||
Bytes(
|
||||
'ipavaultsalt?',
|
||||
cli_name='salt',
|
||||
doc=_('Vault salt'),
|
||||
),
|
||||
takes_options = (
|
||||
Flag(
|
||||
'change_password?',
|
||||
doc=_('Change password'),
|
||||
@ -1261,11 +1241,6 @@ class vault_mod(PKQuery, Local):
|
||||
cli_name='private_key_file',
|
||||
doc=_('File containing the old vault private key'),
|
||||
),
|
||||
Bytes(
|
||||
'ipavaultpublickey?',
|
||||
cli_name='public_key',
|
||||
doc=_('New vault public key'),
|
||||
),
|
||||
Str( # TODO: use File parameter
|
||||
'public_key_file?',
|
||||
cli_name='public_key_file',
|
||||
@ -1273,7 +1248,21 @@ class vault_mod(PKQuery, Local):
|
||||
),
|
||||
)
|
||||
|
||||
has_output = output.standard_entry
|
||||
def get_args(self):
|
||||
for arg in self.api.Command.vault_mod_internal.args():
|
||||
yield arg
|
||||
for arg in super(vault_mod, self).get_args():
|
||||
yield arg
|
||||
|
||||
def get_options(self):
|
||||
for option in self.api.Command.vault_mod_internal.options():
|
||||
if option.name not in ('ipavaultsalt', 'version'):
|
||||
yield option
|
||||
for option in super(vault_mod, self).get_options():
|
||||
yield option
|
||||
|
||||
def _iter_output(self):
|
||||
return self.api.Command.vault_mod_internal.output()
|
||||
|
||||
def forward(self, *args, **options):
|
||||
|
||||
@ -1482,10 +1471,10 @@ class vaultconfig_show(Retrieve):
|
||||
|
||||
|
||||
@register()
|
||||
class vault_archive(PKQuery, Local):
|
||||
class vault_archive(Local):
|
||||
__doc__ = _('Archive data into a vault.')
|
||||
|
||||
takes_options = vault_options + (
|
||||
takes_options = (
|
||||
Bytes(
|
||||
'data?',
|
||||
doc=_('Binary data to archive'),
|
||||
@ -1510,7 +1499,24 @@ class vault_archive(PKQuery, Local):
|
||||
),
|
||||
)
|
||||
|
||||
has_output = output.standard_entry
|
||||
def get_args(self):
|
||||
for arg in self.api.Command.vault_archive_internal.args():
|
||||
yield arg
|
||||
for arg in super(vault_archive, self).get_args():
|
||||
yield arg
|
||||
|
||||
def get_options(self):
|
||||
for option in self.api.Command.vault_archive_internal.options():
|
||||
if option.name not in ('nonce',
|
||||
'session_key',
|
||||
'vault_data',
|
||||
'version'):
|
||||
yield option
|
||||
for option in super(vault_archive, self).get_options():
|
||||
yield option
|
||||
|
||||
def _iter_output(self):
|
||||
return self.api.Command.vault_archive_internal.output()
|
||||
|
||||
def forward(self, *args, **options):
|
||||
|
||||
@ -1771,10 +1777,10 @@ class vault_archive_internal(PKQuery):
|
||||
|
||||
|
||||
@register()
|
||||
class vault_retrieve(PKQuery, Local):
|
||||
class vault_retrieve(Local):
|
||||
__doc__ = _('Retrieve a data from a vault.')
|
||||
|
||||
takes_options = vault_options + (
|
||||
takes_options = (
|
||||
Str(
|
||||
'out?',
|
||||
doc=_('File to store retrieved data'),
|
||||
@ -1801,7 +1807,6 @@ class vault_retrieve(PKQuery, Local):
|
||||
),
|
||||
)
|
||||
|
||||
has_output = output.standard_entry
|
||||
has_output_params = (
|
||||
Bytes(
|
||||
'data',
|
||||
@ -1809,6 +1814,22 @@ class vault_retrieve(PKQuery, Local):
|
||||
),
|
||||
)
|
||||
|
||||
def get_args(self):
|
||||
for arg in self.api.Command.vault_retrieve_internal.args():
|
||||
yield arg
|
||||
for arg in super(vault_retrieve, self).get_args():
|
||||
yield arg
|
||||
|
||||
def get_options(self):
|
||||
for option in self.api.Command.vault_retrieve_internal.options():
|
||||
if option.name not in ('session_key', 'version'):
|
||||
yield option
|
||||
for option in super(vault_retrieve, self).get_options():
|
||||
yield option
|
||||
|
||||
def _iter_output(self):
|
||||
return self.api.Command.vault_retrieve_internal.output()
|
||||
|
||||
def forward(self, *args, **options):
|
||||
|
||||
name = args[-1]
|
||||
|
Loading…
Reference in New Issue
Block a user