[Freeipa-devel] [freeipa PR#1836][closed] [Backport][ipa-4-6] certprofile: reject config with multiple profileIds

2018-04-19 Thread rcritten via FreeIPA-devel
   URL: https://github.com/freeipa/freeipa/pull/1836
Author: rcritten
 Title: #1836: [Backport][ipa-4-6] certprofile: reject config with multiple 
profileIds
Action: closed

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1836/head:pr1836
git checkout pr1836
___
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org


[Freeipa-devel] [freeipa PR#1837][closed] [Backport][ipa-4-6] ACL: Allow hosts to remove services they manage

2018-04-19 Thread rcritten via FreeIPA-devel
   URL: https://github.com/freeipa/freeipa/pull/1837
Author: rcritten
 Title: #1837: [Backport][ipa-4-6] ACL: Allow hosts to remove services they 
manage
Action: closed

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1837/head:pr1837
git checkout pr1837
___
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org


[Freeipa-devel] [freeipa PR#1838][opened] ui_tests: extend test_user suite

2018-04-19 Thread Rezney via FreeIPA-devel
   URL: https://github.com/freeipa/freeipa/pull/1838
Author: Rezney
 Title: #1838: ui_tests: extend test_user suite
Action: opened

PR body:
"""
ui_tests: extend test_user suite

Extend WebUI test_user suite with the following test cases:

test_add_user_special
test_user_misc
test_ssh_keys
test_add_delete_undo_reset
test_disable_delete_admin
test_login_without_username

https://pagure.io/freeipa/issue/7507
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1838/head:pr1838
git checkout pr1838
From 83d11b8233db91a3d61555f4a0c111378e1d1ba4 Mon Sep 17 00:00:00 2001
From: Michal Reznik 
Date: Thu, 19 Apr 2018 15:19:37 +0200
Subject: [PATCH 1/3] ui_tests: extend test_user suite

Extend WebUI test_user suite with the following test cases:

test_add_user_special
test_user_misc
test_ssh_keys
test_add_delete_undo_reset
test_disable_delete_admin
test_login_without_username

https://pagure.io/freeipa/issue/7507
---
 ipatests/test_webui/data_user.py | 155 ++
 ipatests/test_webui/test_user.py | 443 ++-
 2 files changed, 593 insertions(+), 5 deletions(-)

diff --git a/ipatests/test_webui/data_user.py b/ipatests/test_webui/data_user.py
index c5ed796c7b..87048bba5b 100644
--- a/ipatests/test_webui/data_user.py
+++ b/ipatests/test_webui/data_user.py
@@ -17,6 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see .
 
+
 ENTITY = 'user'
 
 PKEY = 'itest-user'
@@ -35,17 +36,67 @@
 'mod': [
 ('textbox', 'givenname', 'OtherName'),
 ('textbox', 'sn', 'OtherSurname'),
+('textbox', 'initials', 'NOS'),
+('textbox', 'loginshell', '/bin/csh'),
+('textbox', 'homedirectory', '/home/alias'),
 ('multivalued', 'telephonenumber', [
 ('add', '123456789'),
 ('add', '987654321'),
 ]),
+('multivalued', 'mail', [
+('add', 'o...@ipa.test'),
+('add', 't...@ipa.test'),
+('add', 'th...@ipa.test'),
+]),
+('multivalued', 'pager', [
+('add', '1234567'),
+('add', '7654321'),
+]),
+('multivalued', 'mobile', [
+('add', '001123456'),
+('add', '001654321'),
+]),
+('multivalued', 'facsimiletelephonenumber', [
+('add', '1122334'),
+('add', '4332211'),
+]),
+('textbox', 'street', 'Wonderwall ave.'),
+('textbox', 'l', 'Atlantis'),
+('textbox', 'st', 'Universe'),
+('textbox', 'postalcode', '61600'),
+('multivalued', 'carlicense', [
+('add', 'ZLA-1336'),
+]),
+('textbox', 'ou', 'QE'),
 ('combobox', 'manager', 'admin'),
+('textbox', 'employeenumber', '123'),
+('textbox', 'employeetype', 'contractor'),
+('textbox', 'preferredlanguage', 'Spanish'),
 ],
 'mod_v': [
 ('textbox', 'givenname', 'OtherName'),
 ('textbox', 'sn', 'OtherSurname'),
+('textbox', 'initials', 'NOS'),
+('textbox', 'loginshell', '/bin/csh'),
+('textbox', 'homedirectory', '/home/alias'),
+('label', 'krbmaxrenewableage', '604800'),
+('label', 'krbmaxticketlife', '86400'),
 ('multivalued', 'telephonenumber', ['123456789', '987654321']),
+('multivalued', 'mail', ['o...@ipa.test', 't...@ipa.test',
+ 'th...@ipa.test']),
+('multivalued', 'pager', ['1234567', '7654321']),
+('multivalued', 'mobile', ['001123456', '001654321']),
+('multivalued', 'facsimiletelephonenumber', ['1122334', '4332211']),
+('textbox', 'street', 'Wonderwall ave.'),
+('textbox', 'l', 'Atlantis'),
+('textbox', 'st', 'Universe'),
+('textbox', 'postalcode', '61600'),
+('multivalued', 'carlicense', ['ZLA-1336']),
+('textbox', 'ou', 'QE'),
 ('combobox', 'manager', 'admin'),
+('textbox', 'employeenumber', '123'),
+('textbox', 'employeetype', 'contractor'),
+('textbox', 'preferredlanguage', 'Spanish'),
 ],
 }
 
@@ -71,6 +122,8 @@
 ('textbox', 'givenname', 'Name3'),
 ('textbox', 'sn', 'Surname3'),
 ('checkbox', 'noprivate', None),
+('password', 'userpassword', 'Supersecret123'),
+('password', 'userpassword2', 'Supersecret123'),
 ]
 }
 
@@ -85,3 +138,105 @@
 ('combobox', 'gidnumber', '7'),
 ]
 }
+
+PKEY5 = '1spe.cial_us-er$'
+DATA5 = {
+'pkey': PKEY5,
+'add': [
+('textbox', 'uid', PKEY5),
+('textbox', 'givenname', 'S$p|e>c--i_a%l_'),
+('textbox', 'sn', '%U?e+r'),
+('password', 'userpassword', '!!!@@@###$$$'),
+('password', 'userpassword2', '!!!@@@###$$$'),
+]
+}
+
+PKEY6 = 'itest-user' * 5
+DATA6 = {

[Freeipa-devel] [freeipa PR#1837][opened] [Backport][ipa-4-6] ACL: Allow hosts to remove services they manage

2018-04-19 Thread rcritten via FreeIPA-devel
   URL: https://github.com/freeipa/freeipa/pull/1837
Author: rcritten
 Title: #1837: [Backport][ipa-4-6] ACL: Allow hosts to remove services they 
manage
Action: opened

PR body:
"""
This PR was opened automatically because PR #1829 was pushed to master and 
backport to ipa-4-6 is required.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1837/head:pr1837
git checkout pr1837
From 01f1a90fbafd95dd38ef50b7ad34655e41584bb3 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy 
Date: Wed, 18 Apr 2018 13:05:41 +0300
Subject: [PATCH] ACL: Allow hosts to remove services they manage

Allow hosts to delete services they own. This is an ACL that complements
existing one that allows to create services on the same host.

Add a test that creates a host and then attempts to create and delete a
service using its own host keytab.

Fixes: https://pagure.io/freeipa/issue/7486
---
 install/updates/20-aci.update   |  3 ++-
 ipatests/test_xmlrpc/test_service_plugin.py | 28 
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/install/updates/20-aci.update b/install/updates/20-aci.update
index dec2e16ee4..bab3141445 100644
--- a/install/updates/20-aci.update
+++ b/install/updates/20-aci.update
@@ -120,10 +120,11 @@ add:aci: (targetfilter="(|(objectclass=ipaHost)(objectclass=ipaService))")(targe
 dn: $SUFFIX
 add:aci:(targetattr = "usercertificate")(version 3.0;acl "selfservice:Users can manage their own X.509 certificates";allow (write) userdn = "ldap:///self;;)
 
-# Hosts can add their own services
+# Hosts can add and delete their own services
 dn: cn=services,cn=accounts,$SUFFIX
 remove:aci: (target = "ldap:///krbprincipalname=*/($$dn)@$REALM,cn=services,cn=accounts,$SUFFIX")(targetfilter = "(objectClass=ipaKrbPrincipal)")(version 3.0;acl "Hosts can add own services"; allow(add) userdn="ldap:///fqdn=($$dn),cn=computers,cn=accounts,$SUFFIX";)
 add:aci: (target = "ldap:///krbprincipalname=*/($$dn)@$REALM,cn=services,cn=accounts,$SUFFIX")(targetfilter = "(objectClass=ipaService)")(version 3.0;acl "Hosts can add own services"; allow(add) userdn="ldap:///fqdn=($$dn),cn=computers,cn=accounts,$SUFFIX";)
+add:aci: (target = "ldap:///krbprincipalname=*/($$dn)@$REALM,cn=services,cn=accounts,$SUFFIX")(targetfilter = "(objectClass=ipaService)")(version 3.0;acl "Hosts can delete own services"; allow(delete) userdn="ldap:///fqdn=($$dn),cn=computers,cn=accounts,$SUFFIX";)
 
 # CIFS service on the master can manage ID ranges
 dn: cn=ranges,cn=etc,$SUFFIX
diff --git a/ipatests/test_xmlrpc/test_service_plugin.py b/ipatests/test_xmlrpc/test_service_plugin.py
index 6985f75ee4..c910269df3 100644
--- a/ipatests/test_xmlrpc/test_service_plugin.py
+++ b/ipatests/test_xmlrpc/test_service_plugin.py
@@ -31,6 +31,7 @@
 
 from ipatests.test_xmlrpc.tracker.service_plugin import ServiceTracker
 from ipatests.test_xmlrpc.tracker.host_plugin import HostTracker
+from ipatests.util import change_principal, host_keytab
 
 import base64
 from ipapython.dn import DN
@@ -1343,3 +1344,30 @@ def test_update_indicator(self, indicators_host, indicators_service):
 updates={u'krbprincipalauthind': u'radius'},
 expected_updates={u'krbprincipalauthind': [u'radius']}
 )
+
+
+@pytest.fixture(scope='function')
+def managing_host(request):
+tracker = HostTracker(name=u'managinghost2', fqdn=fqdn2)
+return tracker.make_fixture(request)
+
+
+@pytest.fixture(scope='function')
+def managed_service(request):
+tracker = ServiceTracker(
+name=u'managed-service', host_fqdn=fqdn2)
+return tracker.make_fixture(request)
+
+
+@pytest.mark.tier1
+class TestManagedServices(XMLRPC_test):
+def test_managed_service(
+self, managing_host, managed_service):
+""" Add a host and then add a service as a host
+Finally, remove the service as a host """
+managing_host.ensure_exists()
+with host_keytab(managing_host.name) as keytab_filename:
+with change_principal(managing_host.attrs['krbcanonicalname'][0],
+  keytab=keytab_filename):
+managed_service.create()
+managed_service.delete()
___
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org


[Freeipa-devel] [freeipa PR#1829][closed] ACL: Allow hosts to remove services they manage

2018-04-19 Thread rcritten via FreeIPA-devel
   URL: https://github.com/freeipa/freeipa/pull/1829
Author: abbra
 Title: #1829: ACL: Allow hosts to remove services they manage
Action: closed

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1829/head:pr1829
git checkout pr1829
___
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org


[Freeipa-devel] [freeipa PR#1836][opened] [Backport][ipa-4-6] certprofile: reject config with multiple profileIds

2018-04-19 Thread rcritten via FreeIPA-devel
   URL: https://github.com/freeipa/freeipa/pull/1836
Author: rcritten
 Title: #1836: [Backport][ipa-4-6] certprofile: reject config with multiple 
profileIds
Action: opened

PR body:
"""
This PR was opened automatically because PR #1830 was pushed to master and 
backport to ipa-4-6 is required.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1836/head:pr1836
git checkout pr1836
From b4ec44ea811d1f2d61ca7da19f96185efa43b9e0 Mon Sep 17 00:00:00 2001
From: Fraser Tweedale 
Date: Wed, 18 Apr 2018 17:10:10 +1000
Subject: [PATCH 1/2] certprofile: reject config with multiple profileIds

In certprofile-import if the config file contains two profileId
directives with different values, with the first matching the
profile ID CLI argument and the second differing, the profile gets
imported under the second ID.  This leads to:

- failure to enable the profile
- failure to add the IPA "tracking" certprofile object
- inability to delete the misnamed profile from Dogtag (via ipa CLI)

To avert this scenario, detect and reject profile configurations
where profileId is specified multiple times (whether or not the
values differ).

https://pagure.io/freeipa/issue/7503
---
 ipaserver/plugins/certprofile.py | 23 +--
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/ipaserver/plugins/certprofile.py b/ipaserver/plugins/certprofile.py
index 4eab09f24f..5e8dbca046 100644
--- a/ipaserver/plugins/certprofile.py
+++ b/ipaserver/plugins/certprofile.py
@@ -236,14 +236,25 @@ def pre_callback(self, ldap, dn, entry, entry_attrs, *keys, **options):
 ca_enabled_check(self.api)
 context.profile = options['file']
 
-match = self.PROFILE_ID_PATTERN.search(options['file'])
-if match is None:
+matches = self.PROFILE_ID_PATTERN.findall(options['file'])
+if len(matches) == 0:
 # no profileId found, use CLI value as profileId.
 context.profile = u'profileId=%s\n%s' % (keys[0], context.profile)
-elif keys[0] != match.group(1):
-raise errors.ValidationError(name='file',
-error=_("Profile ID '%(cli_value)s' does not match profile data '%(file_value)s'")
-% {'cli_value': keys[0], 'file_value': match.group(1)}
+elif len(matches) > 1:
+raise errors.ValidationError(
+name='file',
+error=_(
+"Profile data specifies profileId multiple times: "
+"%(values)s"
+) % dict(values=matches)
+)
+elif keys[0] != matches[0]:
+raise errors.ValidationError(
+name='file',
+error=_(
+"Profile ID '%(cli_value)s' "
+"does not match profile data '%(file_value)s'"
+) % dict(cli_value=keys[0], file_value=matches[0])
 )
 return dn
 

From 50b1d1965b16da45683420130576e8f63b852320 Mon Sep 17 00:00:00 2001
From: Fraser Tweedale 
Date: Wed, 18 Apr 2018 19:35:49 +1000
Subject: [PATCH 2/2] certprofile: add tests for config profileId scenarios

Update the certprofile tests to cover the various scenarios
concerning the profileId property in the profile configuration.
The scenarios now explicitly tested are:

- profileId not specified (should succeed)
- mismatched profileId property (should fail)
- multiple profileId properties (should fail)
- one profileId property, matching given ID (should succeed)

https://pagure.io/freeipa/issue/7503
---
 .../test_xmlrpc/data/caIPAserviceCert_mod.cfg.tmpl |  1 -
 ipatests/test_xmlrpc/test_certprofile_plugin.py| 33 ++
 ipatests/test_xmlrpc/tracker/certprofile_plugin.py | 11 ++--
 3 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/ipatests/test_xmlrpc/data/caIPAserviceCert_mod.cfg.tmpl b/ipatests/test_xmlrpc/data/caIPAserviceCert_mod.cfg.tmpl
index cff1544627..f9e8ce441d 100644
--- a/ipatests/test_xmlrpc/data/caIPAserviceCert_mod.cfg.tmpl
+++ b/ipatests/test_xmlrpc/data/caIPAserviceCert_mod.cfg.tmpl
@@ -1,6 +1,5 @@
 auth.instance_id=raCertAuth
 classId=caEnrollImpl
-profileId=caIPAserviceCert_mod
 visible=false
 desc=This certificate profile is for enrolling server certificates with IPA-RA agent authentication.
 enable=true
diff --git a/ipatests/test_xmlrpc/test_certprofile_plugin.py b/ipatests/test_xmlrpc/test_certprofile_plugin.py
index 1b3edda89c..7cefd0a8d7 100644
--- a/ipatests/test_xmlrpc/test_certprofile_plugin.py
+++ b/ipatests/test_xmlrpc/test_certprofile_plugin.py
@@ -222,3 +222,36 @@ class TestImportFromXML(XMLRPC_test):
 def test_import_xml(self, xmlprofile):
 with pytest.raises(errors.ExecutionError):
 xmlprofile.ensure_exists()
+
+
+# The initial user_profile configuration does not specify profileId.
+# This is fine (it gets derived from the profile-id CLI 

[Freeipa-devel] [freeipa PR#1830][closed] certprofile: reject config with multiple profileIds

2018-04-19 Thread rcritten via FreeIPA-devel
   URL: https://github.com/freeipa/freeipa/pull/1830
Author: frasertweedale
 Title: #1830: certprofile: reject config with multiple profileIds
Action: closed

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1830/head:pr1830
git checkout pr1830
___
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org


[Freeipa-devel] [freeipa PR#1835][opened] [Backport][ipa-4-6] WebUI test :: Updated existing test_group

2018-04-19 Thread Rezney via FreeIPA-devel
   URL: https://github.com/freeipa/freeipa/pull/1835
Author: Rezney
 Title: #1835: [Backport][ipa-4-6] WebUI test :: Updated existing test_group
Action: opened

PR body:
"""
This PR was opened automatically because PR #1728 was pushed to master and 
backport to ipa-4-6 is required.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1835/head:pr1835
git checkout pr1835
From 1cf1b30d5e45918e6e70c647b9a5dfdf8bd5fd2b Mon Sep 17 00:00:00 2001
From: Varun Mylaraiah 
Date: Thu, 5 Apr 2018 13:21:51 +0530
Subject: [PATCH 1/2] WebUI tests: Extend user group tests with more scenarios

1) Extended webui group automation test with below scenarios
	Scenarios
	 *Add user group with invalid names
	 *Add multiple groups records at one shot
	 *Select and delete multiple records
	 *Find and delete records etc...
2) Improved add_record method to support additional use cases:
	 *confirm by additional buttons: 'Add', 'Add and add another', 'Add and Edit,' 'Cancel'
	 *add multiple records in one call (uses 'Add and add another' behavior)

https://pagure.io/freeipa/issue/7485

Signed-off-by: Varun Mylaraiah 
---
 ipatests/test_webui/data_group.py |  38 
 ipatests/test_webui/test_group.py | 185 --
 ipatests/test_webui/ui_driver.py  | 117 
 3 files changed, 273 insertions(+), 67 deletions(-)

diff --git a/ipatests/test_webui/data_group.py b/ipatests/test_webui/data_group.py
index 517f98f04b..7ef4edd390 100644
--- a/ipatests/test_webui/data_group.py
+++ b/ipatests/test_webui/data_group.py
@@ -78,3 +78,41 @@
 ('textbox', 'gidnumber', '7'),
 ]
 }
+
+PKEY7 = ''
+DATA7 = {
+'pkey': PKEY7,
+'add': [
+('textbox', 'cn', PKEY7),
+('textarea', 'description', 'Empty Group name'),
+]
+}
+
+PKEY8 = ';test-gr@up'
+DATA8 = {
+'pkey': PKEY8,
+'add': [
+('textbox', 'cn', PKEY8),
+('textarea', 'description', 'Invalid Group name'),
+]
+}
+
+PKEY9 = 'itest-group9'
+DATA9 = {
+'pkey': PKEY9,
+'add': [
+('textbox', 'cn', PKEY9),
+('textarea', 'description', 'test-group9 desc'),
+('radio', 'type', 'nonposix'),
+]
+}
+
+PKEY10 = 'itest-group10'
+DATA10 = {
+'pkey': PKEY10,
+'add': [
+('textbox', 'cn', PKEY10),
+('textarea', 'description', 'test-group10 desc'),
+('radio', 'type', 'nonposix'),
+]
+}
diff --git a/ipatests/test_webui/test_group.py b/ipatests/test_webui/test_group.py
index db9acef345..fc1a3a2d97 100644
--- a/ipatests/test_webui/test_group.py
+++ b/ipatests/test_webui/test_group.py
@@ -31,6 +31,12 @@
 import ipatests.test_webui.data_sudo as sudo
 import pytest
 
+try:
+from selenium.webdriver.common.keys import Keys
+from selenium.webdriver.common.action_chains import ActionChains
+except ImportError:
+pass
+
 
 @pytest.mark.tier1
 class test_group(UI_driver):
@@ -75,6 +81,118 @@ def test_group_types(self):
 def check_posix_enabled(self, enabled):
 self.assert_disabled("[name=gidnumber]", negative=enabled)
 
+@screenshot
+def test_add_group_negative(self):
+"""
+Negative test for adding groups
+"""
+self.init_app()
+
+self.empty_group_name()
+self.invalid_group_name()
+self.duplicate_group_name()
+self.tailing_spaces_in_group_description()
+self.leading_spaces_in_group_description()
+
+def empty_group_name(self):
+self.navigate_to_entity(group.ENTITY)
+self.facet_button_click('add')
+self.dialog_button_click('add')
+elem = self.find(".widget[name='cn']")
+self.assert_field_validation_required(elem)
+self.dialog_button_click('cancel')
+
+def invalid_group_name(self):
+expected_error = 'may only include letters, numbers, _, -, . and $'
+pkey = ';test-gr@up'
+self.navigate_to_entity(group.ENTITY)
+self.facet_button_click('add')
+self.fill_input('cn', pkey)
+elem = self.find(".widget[name='cn']")
+self.assert_field_validation(expected_error, parent=elem)
+self.dialog_button_click('cancel')
+
+def duplicate_group_name(self):
+pkey = 'editors'
+expected_error = 'group with name "editors" already exists'
+self.navigate_to_entity(group.ENTITY)
+self.facet_button_click('add')
+self.fill_input('cn', pkey)
+self.cancel_retry_dialog(expected_error)
+
+def tailing_spaces_in_group_description(self):
+pkey = 'itest_group0'
+desc = 'with_trailing_space '
+expected_error = 'invalid \'desc\': Leading and trailing ' \
+ 'spaces are not allowed'
+self.navigate_to_entity(group.ENTITY)
+self.facet_button_click('add')
+self.fill_input('cn', pkey)
+self.fill_textarea('description', desc)
+

[Freeipa-devel] [freeipa PR#1728][closed] WebUI test :: Updated existing test_group

2018-04-19 Thread Rezney via FreeIPA-devel
   URL: https://github.com/freeipa/freeipa/pull/1728
Author: varunmylaraiah
 Title: #1728: WebUI test :: Updated existing test_group
Action: closed

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1728/head:pr1728
git checkout pr1728
___
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org


[Freeipa-devel] [freeipa PR#1782][closed] webui: refresh complex pages after modification

2018-04-19 Thread Rezney via FreeIPA-devel
   URL: https://github.com/freeipa/freeipa/pull/1782
Author: pvoborni
 Title: #1782: webui: refresh complex pages after modification
Action: closed

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1782/head:pr1782
git checkout pr1782
___
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org


[Freeipa-devel] [freeipa PR#1834][opened] [Backport][ipa-4-6] webui: refresh complex pages after modification

2018-04-19 Thread Rezney via FreeIPA-devel
   URL: https://github.com/freeipa/freeipa/pull/1834
Author: Rezney
 Title: #1834: [Backport][ipa-4-6] webui: refresh complex pages after 
modification
Action: opened

PR body:
"""
This PR was opened automatically because PR #1782 was pushed to master and 
backport to ipa-4-6 is required.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1834/head:pr1834
git checkout pr1834
From 5f96d9a76c0c8757a7304a9497b8a648d458312c Mon Sep 17 00:00:00 2001
From: Petr Vobornik 
Date: Thu, 5 Apr 2018 13:56:00 +0200
Subject: [PATCH] webui: refresh complex pages after modification

Details facet for user, hosts, service, user override entities require
complex reload as they gather information from multiple sources - e.g.
all of them do cert-find. On update only $entity-mod is execute and its
result doesn't have all information required for refresh of the page
therefore some fields are missing or empty.

This patch modifies the facets to do full refresh instead of default
load and thus the pages will have all required info.

https://pagure.io/freeipa/issue/5776
---
 install/ui/src/freeipa/host.js| 6 ++
 install/ui/src/freeipa/idviews.js | 6 ++
 install/ui/src/freeipa/service.js | 6 ++
 install/ui/src/freeipa/user.js| 5 +
 4 files changed, 23 insertions(+)

diff --git a/install/ui/src/freeipa/host.js b/install/ui/src/freeipa/host.js
index acecff1e5b..8aa1ef9d8c 100644
--- a/install/ui/src/freeipa/host.js
+++ b/install/ui/src/freeipa/host.js
@@ -518,6 +518,12 @@ IPA.host.details_facet = function(spec, no_init) {
 return that.entity.name+'_show_'+that.get_pkey();
 };
 
+that.update_on_success = function(data, text_status, xhr) {
+that.on_update.notify();
+that.nofify_update_success();
+that.refresh();
+};
+
 if (!no_init) that.init_details_facet();
 
 return that;
diff --git a/install/ui/src/freeipa/idviews.js b/install/ui/src/freeipa/idviews.js
index 0511820e2b..b0ee8b5a03 100644
--- a/install/ui/src/freeipa/idviews.js
+++ b/install/ui/src/freeipa/idviews.js
@@ -450,6 +450,12 @@ idviews.id_override_user_details_facet = function(spec) {
 return batch;
 };
 
+that.update_on_success = function(data, text_status, xhr) {
+that.on_update.notify();
+that.nofify_update_success();
+that.refresh();
+};
+
 return that;
 };
 
diff --git a/install/ui/src/freeipa/service.js b/install/ui/src/freeipa/service.js
index c798d2999f..93808b0122 100644
--- a/install/ui/src/freeipa/service.js
+++ b/install/ui/src/freeipa/service.js
@@ -500,6 +500,12 @@ IPA.service.details_facet = function(spec, no_init) {
 return batch;
 };
 
+that.update_on_success = function(data, text_status, xhr) {
+that.on_update.notify();
+that.nofify_update_success();
+that.refresh();
+};
+
 if (!no_init) that.init_details_facet();
 
 return that;
diff --git a/install/ui/src/freeipa/user.js b/install/ui/src/freeipa/user.js
index 6b2bf196c3..30ab40fb33 100644
--- a/install/ui/src/freeipa/user.js
+++ b/install/ui/src/freeipa/user.js
@@ -621,6 +621,11 @@ IPA.user.details_facet = function(spec, no_init) {
 return batch;
 };
 
+that.update_on_success = function(data, text_status, xhr) {
+that.on_update.notify();
+that.nofify_update_success();
+that.refresh();
+};
 
 if (!no_init) that.init_details_facet();
 
___
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org