From 19dd2ed758210e859a5b0085de558cf13ba09104 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 25 Aug 2015 18:25:50 +0200 Subject: [PATCH] vault: change default vault type to symmetric https://fedorahosted.org/freeipa/ticket/5251 Reviewed-By: Martin Basti --- API.txt | 8 ++++---- VERSION | 4 ++-- ipalib/plugins/vault.py | 11 ++++++++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/API.txt b/API.txt index 9a0a4b090..afd5017be 100644 --- a/API.txt +++ b/API.txt @@ -5411,7 +5411,7 @@ option: Str('addattr*', cli_name='addattr', exclude='webui') option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui') option: Str('description?', cli_name='desc') option: Bytes('ipavaultpublickey?', cli_name='public_key') -option: Str('ipavaulttype?', cli_name='type') +option: StrEnum('ipavaulttype?', autofill=True, cli_name='type', default=u'symmetric', values=(u'standard', u'symmetric', u'asymmetric')) option: Str('password?', cli_name='password') option: Str('password_file?', cli_name='password_file') option: Str('public_key_file?', cli_name='public_key_file') @@ -5431,7 +5431,7 @@ option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui option: Str('description', attribute=True, cli_name='desc', multivalue=False, required=False) option: Bytes('ipavaultpublickey', attribute=True, cli_name='public_key', multivalue=False, required=False) option: Bytes('ipavaultsalt', attribute=True, cli_name='salt', multivalue=False, required=False) -option: StrEnum('ipavaulttype', attribute=True, autofill=True, cli_name='type', default=u'standard', multivalue=False, required=False, values=(u'standard', u'symmetric', u'asymmetric')) +option: StrEnum('ipavaulttype', attribute=True, autofill=True, cli_name='type', default=u'symmetric', multivalue=False, required=False, values=(u'standard', u'symmetric', u'asymmetric')) option: Flag('no_members', autofill=True, default=False, exclude='webui') option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui') option: Str('service?') @@ -5522,7 +5522,7 @@ arg: Str('criteria?', noextrawhitespace=False) option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui') option: Str('cn', attribute=True, autofill=False, cli_name='name', maxlength=255, multivalue=False, pattern='^[a-zA-Z0-9_.-]+$', primary_key=True, query=True, required=False) option: Str('description', attribute=True, autofill=False, cli_name='desc', multivalue=False, query=True, required=False) -option: StrEnum('ipavaulttype', attribute=True, autofill=False, cli_name='type', default=u'standard', multivalue=False, query=True, required=False, values=(u'standard', u'symmetric', u'asymmetric')) +option: StrEnum('ipavaulttype', attribute=True, autofill=False, cli_name='type', default=u'symmetric', multivalue=False, query=True, required=False, values=(u'standard', u'symmetric', u'asymmetric')) option: Flag('no_members', autofill=True, default=False, exclude='webui') option: Flag('pkey_only?', autofill=True, default=False) option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui') @@ -5571,7 +5571,7 @@ option: Str('delattr*', cli_name='delattr', exclude='webui') option: Str('description', attribute=True, autofill=False, cli_name='desc', multivalue=False, required=False) option: Bytes('ipavaultpublickey', attribute=True, autofill=False, cli_name='public_key', multivalue=False, required=False) option: Bytes('ipavaultsalt', attribute=True, autofill=False, cli_name='salt', multivalue=False, required=False) -option: StrEnum('ipavaulttype', attribute=True, autofill=False, cli_name='type', default=u'standard', multivalue=False, required=False, values=(u'standard', u'symmetric', u'asymmetric')) +option: StrEnum('ipavaulttype', attribute=True, autofill=False, cli_name='type', default=u'symmetric', multivalue=False, required=False, values=(u'standard', u'symmetric', u'asymmetric')) option: Flag('no_members', autofill=True, default=False, exclude='webui') option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui') option: Flag('rights', autofill=True, default=False) diff --git a/VERSION b/VERSION index 751c6c793..d3073e52e 100644 --- a/VERSION +++ b/VERSION @@ -90,5 +90,5 @@ IPA_DATA_VERSION=20100614120000 # # ######################################################## IPA_API_VERSION_MAJOR=2 -IPA_API_VERSION_MINOR=153 -# Last change: edewata - Added support for changing vault encryption. +IPA_API_VERSION_MINOR=154 +# Last change: pvoborni - change default vault type to 'symmetric' diff --git a/ipalib/plugins/vault.py b/ipalib/plugins/vault.py index 18436e399..483da5f0e 100644 --- a/ipalib/plugins/vault.py +++ b/ipalib/plugins/vault.py @@ -100,6 +100,7 @@ EXAMPLES: Add a standard vault: ipa vault-add [--user |--service |--shared] + --type standard """) + _(""" Add a symmetric vault: ipa vault-add @@ -310,7 +311,7 @@ class vault(LDAPObject): label=_('Type'), doc=_('Vault type'), values=(u'standard', u'symmetric', u'asymmetric', ), - default=u'standard', + default=u'symmetric', autofill=True, ), Bytes( @@ -577,10 +578,14 @@ class vault_add(PKQuery, Local): cli_name='desc', doc=_('Vault description'), ), - Str( + StrEnum( 'ipavaulttype?', cli_name='type', + label=_('Type'), doc=_('Vault type'), + values=(u'standard', u'symmetric', u'asymmetric', ), + default=u'symmetric', + autofill=True, ), Str( 'password?', @@ -608,7 +613,7 @@ class vault_add(PKQuery, Local): def forward(self, *args, **options): - vault_type = options.get('ipavaulttype', u'standard') + vault_type = options.get('ipavaulttype') password = options.get('password') password_file = options.get('password_file') public_key = options.get('ipavaultpublickey')