Commit Graph

6467 Commits

Author SHA1 Message Date
Petr Vobornik
d212d48015 Debugging Web UI guide 2013-10-16 18:08:17 +02:00
Petr Vobornik
3781d33dbe Phases Guide 2013-10-16 18:08:17 +02:00
Petr Vobornik
cd6a2c431e Configuration for JSDuck documentation generator
Installation: https://github.com/senchalabs/jsduck/wiki/Installation Basically it requires ruby and jsduck gem.

Usage:
$ cd install/ui/doc
$ make

Documentation will be generated into: install/ui/build/code_doc directory
2013-10-16 18:08:17 +02:00
Petr Vobornik
efafd7fe87 Web UI source code annotation
Part of ongoing Web UI documentation effort. Source code is annotated in a way that it can be processed by documentation generator.
2013-10-16 18:08:17 +02:00
Petr Vobornik
3fa304d95e Removal of unused code 2013-10-16 18:08:16 +02:00
Petr Vobornik
b4fc6f4ba8 Load updated Web UI files after server upgrade
Issue:
* There was no caching policy specified.
* -> Browsers use their own default policy.
* -> After upgrade, some Web UI files might have been actualized some not.
* -> With schema change may result into weird bugs in Web UI

Solution considerations:

1. Detect server version change and hard-reload at runtime
Detection is easy. Problem is the reload. Obvious candidate 'window.location.reload(true)' works in Firefox but not in Chrome because expected behavior when parameter is used is not in standard and therefore Chromium/WebKit authors did not implement it.

2. Application Cache
HTML 5 technology which lets web apps to run offline. Besides weird issues with event handlers which I encountered, this would be an ideal candidate. Simple change of manifest file would lead to reload of all files (requires reload of page to used the new files).

Showstopper was usage with untrusted certificate. If user did not add exception for the cert or its CA and would visit the page for a second time, all AJAX calls would fail.

3. Set Expires to now() for everything
Web UI rarely changes so this is an overkill. Setting it to different value is not a solution either. We can't predict when the upgrade will happen and when new Web UI will be needed.

Solution:
* Implemented a mini loader which loads basic resources. Dojo loader takes action after Dojo is loaded.
* The loader adds a version parameter (?v=__NUM_VERSION__) to all requests.
* Version is defined in the loader. It's set to current in `make version-update`.
* All static pages use this loader to fetch their resources.
* Version is also passed to dojo loader as cache-bust for the same effect.
* Expire header was set to 'access time plus 1 year' for /ui folder. Exceptions are HTML files and loader (set to immediate expiration).

Possible issues:
* Images are cached but not requested with version param.
  * Images with version and without are considered different
  * -> We would have to attach version to all URIs - in CSS and in JS. But we should avoid changing jQuery UI CSS.
  * Proposed solution is to change image name when changing image. Image change is done rarely.
* Version is set by build and therefore updated just on server update. It might cause trouble with different update schedule of plugins.
  * No action taken to address this issue yet.
  * We might leave it on plugin devs (own .conf in /etc/httpd/conf.d/)
  * or set expires to now for all plugins
* running `make version-update` is required in order to use static version of UI for testing

https://fedorahosted.org/freeipa/ticket/3798
2013-10-16 18:06:30 +02:00
Martin Basti
c49cf9572a Added warning if cert '/etc/ipa/ca.crt' exists
https://fedorahosted.org/freeipa/ticket/3944
2013-10-16 10:55:23 +02:00
Tomas Babej
ed3d184a7d adtrustinstance: Move attribute definitions from setup to init method
Majority of the attributes set in the setup method can be set in the
__init__ method where they are actually defined (and set to None).

This is true for attributes that hold constant values and for
attributes that have their values derived from api.env dictionary.

Creates a new __setup_default_attributes method, that is called
from within __init__ and setup (in case the passed values for
hostname or domain do not correspond to that what is set in api.env,
doing otherwise could cause unexpected behaviour).

Part of: https://fedorahosted.org/freeipa/ticket/3479
2013-10-14 11:11:17 +02:00
Tomas Babej
d769b124b0 adtrustinstance: Properly handle uninstall of AD trust instance
The uninstall method of the AD trust instance was not called upon
at all in the ipa-server-install --uninstall phase.

This patch makes sure that AD trust instance is unconfigured when
the server is uninstalled.

The following steps are undertaken:
  * Remove /var/run/samba/krb5cc_samba
  * Remove our keys from /etc/samba/samba.keytab using ipa-rmkeytab
  * Remove /var/lib/samba/*.tdb files

Additionally, we make sure winbind service is stopped from within the
stop() method.

Part of: https://fedorahosted.org/freeipa/ticket/3479
2013-10-14 11:11:17 +02:00
Tomas Babej
45e310ecc4 ipa-adtrust-install: Add warning that we will break existing samba configuration
In case /etc/samba/smb.conf exists and it was not created by ipa-adtrust-install,
print a warning that we will break existing samba configuration and ask for
a confirmation in the interactive mode.

Part of: https://fedorahosted.org/freeipa/ticket/3479
2013-10-14 11:11:17 +02:00
Tomas Babej
4a95a50596 ipa-upgradeconfig: Remove backed up smb.conf
Since we are not able to properly restore the Samba server to the
working state after running ipa-adtrust-install, we should not keep
the smb.conf in the fstore.

This patch makes sure that any backed up smb.conf is removed from
the backup and that this file is not backed up anymore.

Part of: https://fedorahosted.org/freeipa/ticket/3479
2013-10-14 11:11:17 +02:00
Tomas Babej
285ed59889 trusts: Do not create ranges for subdomains in case of POSIX trust
For the AD trusts where the ID range for the root level domain is of
ipa-ad-trust-posix type, do not create a separate ranges for the
subdomains, since POSIX attributes provide global mapping.
2013-10-14 10:09:56 +02:00
Martin Kosek
dfa135e606 Winsync re-initialize should not run memberOf fixup task
Change re-initialize command to consider memberOf fixup task only
for non-winsync replication agreements.

https://fedorahosted.org/freeipa/ticket/3854
2013-10-11 10:08:21 +02:00
Martin Kosek
524a1a8567 Use consistent realm name in cainstance and dsinstance
The installers used custom self.realm_name instead of standard
self.realm defined in Service class. It caused crashes in some cases
when Service class methods expected the self.realm to be filled.

https://fedorahosted.org/freeipa/ticket/3854
2013-10-11 10:08:21 +02:00
Martin Kosek
dbfa7157cc PKI installation on replica failing due to missing proxy conf
Proxy configuration was not detected correctly. Both
ipa-pki-proxy.conf and ipa.conf need to be in place and httpd
restarted to be able to check it's status.

https://fedorahosted.org/freeipa/ticket/3964
2013-10-11 09:50:44 +02:00
Martin Kosek
cb9331ebfc Remove --no-serial-autoincrement
Deprecate this option and do not offer it in installation tools.
Without this option enabled, advanced DNS features like DNSSEC
would not work.

https://fedorahosted.org/freeipa/ticket/3962
2013-10-11 09:47:59 +02:00
Petr Viktorin
5e8aab8558 Add tests for the IntEnum class
The StrEnum and Int tests are restructured to allow sharing the tests.
Individual *Enum tests are separated into methods.
2013-10-09 18:05:37 +02:00
Nathaniel McCallum
88d003c68b Add IntEnum parameter to ipalib 2013-10-09 18:05:37 +02:00
Nathaniel McCallum
4f6580f11d Allow multiple types in Param type validation
Int already needed to take both int and long. This makes the functionality
available for all Param classes.
2013-10-09 18:05:37 +02:00
Nathaniel McCallum
e05dfbd8b4 Add optional_create flag 2013-10-08 16:46:20 +02:00
Petr Viktorin
b54cdab33d test_ipalib.test_crud: Don't use a string in takes_options
Options should be Param subclasses.
2013-10-08 16:46:19 +02:00
Nathaniel McCallum
fd63505f6d Don't special case the Password class in Param.__init__() 2013-10-08 16:14:32 +02:00
Sumit Bose
091e8fac34 Use the right attribute with ipapwd_entry_checks for MagicRegen
There is a special mode to set the ipaNTHash attribute if a RC4 Kerberos
key is available for the corresponding user. This is typically triggered
by samba via the ipa_sam passdb plugin. The principal used by samba to
connect to the IPA directory server has the right to modify ipaNTHash
but no other password attribute. This means that the current check on
the userPassword attribute is too strict for this case and leads to a
failure of the whole operation.

With this patch the access right on ipaNTHash are checked if no other
password operations are requested.
2013-10-08 09:18:57 +02:00
Nathaniel McCallum
12ae6a054a Document no_search in Param flags 2013-10-07 14:00:52 +02:00
Martin Kosek
1480cf1603 Do not allow '%' in DM password
Having '%' in DM password causes pkispawn to crash. Do not allow
users to enter it until pkispawn is fixed.

https://bugzilla.redhat.com/show_bug.cgi?id=953488
2013-10-04 17:41:20 +02:00
Petr Viktorin
80886a50e6 ipapython.nsslib: Name arguments to NSPRError
Previously NSPRError was given arguments in the wrong order.
Fix this by naming the arguments.
2013-10-04 15:49:19 +02:00
Petr Viktorin
c813b8fbd3 Do not fail upgrade if the global anonymous read ACI is not found
This helps forward compatibility: the anon ACI is scheduled for removal.

https://fedorahosted.org/freeipa/ticket/3956
2013-10-04 15:41:56 +02:00
Petr Viktorin
5824a0e14e ipa-client-install: Verify RPC connection with a ping
With old servers, it is possible that xmlclient.connect() succeeds
but commands fail with a Kerberos error.

Verify that commands succeed by sending a ping after connecting.

Follow-up to: https://fedorahosted.org/freeipa/ticket/3931
2013-10-04 15:33:58 +02:00
Petr Viktorin
e01a28b584 ipa-client-install: Use direct RPC instead of api.Command
To make sure the installation works with older servers,
use XML-RPC directly, with a version set explicitly so the request
is not rejected.

RPC was chosen over ldapmodify, because going through the API allows
the server to process the request properly, or even cleanly reject
it if there are incompatible changes in future versions.

https://fedorahosted.org/freeipa/ticket/3931
2013-10-04 15:33:58 +02:00
Petr Viktorin
321e8635ae Update translations from Transifex 2013-10-04 14:51:19 +02:00
Martin Kosek
b1451373c4 Remove faulty DNS memberOf Task
This task was added with a DN colliding with privilege update memberOf
task being run later and caused this task to be ineffective and thus
miss some privilege membership, like "SELinux User Map Administrators"

DNS update plugin do not need to run any task at all as privileges
will be updated later in scope of 55-pbacmemberof.update

https://fedorahosted.org/freeipa/ticket/3877
2013-10-04 14:30:13 +02:00
Petr Viktorin
3a4a7458c7 Add tests for installing with empty PKCS#12 password 2013-10-04 10:27:23 +02:00
Jan Cholasta
194556beb0 Allow PKCS#12 files with empty password in install tools.
https://fedorahosted.org/freeipa/ticket/3897
2013-10-04 10:27:23 +02:00
Jan Cholasta
c123264ac7 Read passwords from stdin when importing PKCS#12 files with pk12util.
This works around pk12util refusing to use empty password files, which prevents
the use of PKCS#12 files with empty password.

https://fedorahosted.org/freeipa/ticket/3897
2013-10-04 10:27:23 +02:00
Martin Kosek
46b3588112 Require new SSSD to pull required AD subdomain fixes 2013-10-04 10:25:31 +02:00
Alexander Bokovoy
d228b1bd70 ipa-kdb: Handle parent-child relationship for subdomains
When MS-PAC information is re-initialized, record also parent-child
relationship between trust root level domain and its subdomains.

Use parent incoming SID black list to check if child domain is not
allowed to access IPA realm.

We also should really use 'cn' of the entry as domain name.
ipaNTTrustPartner has different meaning on wire, it is an index
pointing to the parent domain of the domain and will be 0 for top
level domains or disjoint subdomains of the trust.

Finally, trustdomain-enable and trustdomain-disable commands should
force MS-PAC cache re-initalization in case of black list change.
Trigger that by asking for cross-realm TGT for HTTP service.
2013-10-04 10:25:31 +02:00
Alexander Bokovoy
749111e6c2 KDC: implement transition check for trusted domains
When client principal requests for a ticket for a server principal
and we have to perform transition, check that all three belong to either
our domain or the domains we trust through forest trusts.

In case all three realms (client, transition, and server) match
trusted domains and our domain, issue permission to transition from client
realm to server realm.

Part of https://fedorahosted.org/freeipa/ticket/3909
2013-10-04 10:25:31 +02:00
Alexander Bokovoy
0ab40cdf6b ipasam: for subdomains pick up defaults for missing values
We don't store trust type, attributes, and direction for subdomains
of the existing trust. Since trust is always forest level, these parameters
can be added as defaults when they are missing.
2013-10-04 10:25:31 +02:00
Alexander Bokovoy
f734988e24 trust: integrate subdomains support into trust-add 2013-10-04 10:25:31 +02:00
Alexander Bokovoy
a87813bf42 ipaserver/dcerpc: remove use of trust account authentication
Since FreeIPA KDC supports adding MS-PAC to HTTP/ipa.server principal,
it is possible to use it when talking to the trusted AD DC.

Remove support for authenticating as trust account because it should not
really be used other than within Samba.
2013-10-04 10:25:31 +02:00
Alexander Bokovoy
2d6c7e3adb frontend: report arguments errors with better detail
When reporting argument errors, show also a context -- what is processed,
what is the name of the command.
2013-10-04 10:25:31 +02:00
Alexander Bokovoy
0b29bfde0d trusts: support subdomains in a forest
Add IPA CLI to manage trust domains.

ipa trust-fetch-domains <trust>      -- fetch list of subdomains from AD side and add new ones to IPA
ipa trustdomain-find <trust>         -- show all available domains
ipa trustdomain-del <trust> <domain> -- remove domain from IPA view about <trust>
ipa trustdomain-enable <trust> <domain> -- allow users from trusted domain to access resources in IPA
ipa trustdomain-disable <trust> <domain> -- disable access to resources in IPA from trusted domain

By default all discovered trust domains are allowed to access IPA resources

IPA KDC needs also information for authentication paths to subdomains in case they
are not hierarchical under AD forest trust root. This information is managed via capaths
section in krb5.conf. SSSD should be able to generate it once
ticket https://fedorahosted.org/sssd/ticket/2093 is resolved.

part of https://fedorahosted.org/freeipa/ticket/3909
2013-10-04 10:25:31 +02:00
Alexander Bokovoy
0637f590ed ipaserver/dcerpc.py: populate forest trust information using realmdomains
Use realmdomains information to prepopulate forest trust info. As result,
all additional domains should now be enabled from the beginning, unless they
really conflict with existing DNS domains on AD side.

https://fedorahosted.org/freeipa/ticket/3919
2013-10-04 10:25:31 +02:00
Petr Viktorin
ef2d61faa2 ipatests.test_cmdline.test_help: Re-raise unexpected exceptions on failure
If an exception is expected, but another one is raised, the CLITestContext
raised a generic AssertionError.
Pass through the original exception instead
2013-10-03 19:50:35 +02:00
Petr Vobornik
5c06e27ff9 ipatests.test_integration.host: Add logging to ldap_connect() 2013-10-03 19:50:35 +02:00
Petr Viktorin
f2e8624e76 ipatests.beakerlib_plugin: Add argument of generated tests to test captions
To differentiate between individual tests in BeakerLib output,
the argument needs to be added to the test name. Since Nose
doesn't provide a way to get the argument in a plugin,
a `test_argument` attribute must be added to the test function
to support this, simlarly to how `description` is used to set
individual "docstrings".

Add test_argument to the generated tests in the CA-less suite.
2013-10-03 19:50:35 +02:00
Petr Viktorin
0ad339a731 ipatests.order_plugin: Exclude test generators from the order
Ordered test generators were not announced in plugin hooks, so
e.g. the Beakerlib or collect plugin did not announce them.

Exclude test generators from ordering.
2013-10-03 19:50:35 +02:00
Petr Viktorin
a942ab4f12 ipatests.beakerlib_plugin: Warn instead of failing when some logs are missing 2013-10-03 19:50:35 +02:00
Petr Viktorin
23921f40d9 ipatests.test_integration.test_caless: Fix mkdir_recursive call 2013-10-03 19:50:35 +02:00
Petr Viktorin
3864760c52 test_integration: Add OpenSSHTransport, used if paramiko is not available
This adds a transport that uses /usr/bin/ssh calls to communicate
with remote hosts.
This transport is a bit slower and buffers output more than paramiko,
so it is only used if paramiko is not available, or forced with an
environment variable.

https://fedorahosted.org/freeipa/ticket/3890
2013-10-03 18:57:41 +02:00