freeipa/ipalib
John Dennis bba4ccb3a0 add session manager and cache krb auth
This patch adds a session manager and support for caching
authentication in the session. Major elements of the patch are:

* Add a session manager to support cookie based sessions which
  stores session data in a memcached entry.

* Add ipalib/krb_utils.py which contains functions to parse ccache
  names, format principals, format KRB timestamps, and a KRB_CCache
  class which reads ccache entry and allows one to extract information
  such as the principal, credentials, credential timestamps, etc.

* Move krb constants defined in ipalib/rpc.py to ipa_krb_utils.py so
  that all kerberos items are co-located.

* Modify javascript in ipa.js so that the IPA.command() RPC call
  checks for authentication needed error response and if it receives
  it sends a GET request to /ipa/login URL to refresh credentials.

* Add session_auth_duration config item to constants.py, used to
  configure how long a session remains valid.

* Add parse_time_duration utility to ipalib/util.py. Used to parse the
  session_auth_duration config item.

* Update the default.conf.5 man page to document session_auth_duration
  config item (also added documentation for log_manager config items
  which had been inadvertantly omitted from a previous commit).

* Add SessionError object to ipalib/errors.py

* Move Kerberos protection in Apache config from /ipa to /ipa/xml and
  /ipa/login

* Add SessionCCache class to session.py to manage temporary Kerberos
  ccache file in effect for the duration of an RPC command.

* Adds a krblogin plugin used to implement the /ipa/login
  handler. login handler sets the session expiration time, currently
  60 minutes or the expiration of the TGT, whichever is shorter. It
  also copies the ccache provied by mod_auth_kerb into the session
  data.  The json handler will later extract and validate the ccache
  belonging to the session.

* Refactored the WSGI handlers so that json and xlmrpc could have
  independent behavior, this also moves where create and destroy
  context occurs, now done in the individual handler rather than the
  parent class.

* The json handler now looks up the session data, validates the ccache
  bound to the session, if it's expired replies with authenicated
  needed error.

* Add documentation to session.py. Fully documents the entire process,
  got questions, read the doc.

* Add exclusions to make-lint as needed.
2012-02-09 13:20:45 -06:00
..
plugins Honor default home directory and login shell in user_add 2012-02-09 18:11:57 +01:00
__init__.py Replace float with Decimal 2012-01-20 08:13:44 +01:00
aci.py Fix uninitialized attributes. 2011-04-21 10:41:29 +02:00
backend.py Fix lint false positives. 2011-04-13 15:58:45 +02:00
base.py Change FreeIPA license to GPLv3+ 2010-12-20 17:19:53 -05:00
cli.py Add argument help to CLI 2012-02-06 08:57:07 +01:00
compat.py Fix lint false positives. 2011-04-13 15:58:45 +02:00
config.py Finalize plugin initialization on demand. 2011-11-22 00:52:24 -05:00
constants.py add session manager and cache krb auth 2012-02-09 13:20:45 -06:00
crud.py Fix LDAP object parameter encoding 2011-11-15 13:17:44 +01:00
dn.py Fix attempted write to attribute of read-only object. 2012-01-02 11:51:26 +03:00
encoder.py Replace float with Decimal 2012-01-20 08:13:44 +01:00
errors.py add session manager and cache krb auth 2012-02-09 13:20:45 -06:00
frontend.py Added commands into metadata. 2011-12-06 22:07:35 +00:00
krb_utils.py add session manager and cache krb auth 2012-02-09 13:20:45 -06:00
output.py Display the entries that failed when deleting with --continue. 2011-01-10 10:32:10 -05:00
parameters.py Replace float with Decimal 2012-01-20 08:13:44 +01:00
pkcs10.py Fix assorted bugs found by pylint 2011-01-25 14:01:36 -05:00
plugable.py Restore default log level in server to INFO 2011-12-01 08:34:02 +01:00
request.py Remove deprecated i18n code from ipalib/request and all references to it. 2011-03-01 10:31:36 -05:00
rpc.py add session manager and cache krb auth 2012-02-09 13:20:45 -06:00
session.py add session manager and cache krb auth 2012-02-09 13:20:45 -06:00
text.py Fix regressions introduced by pylint false positive fixes. 2011-05-11 16:50:01 +02:00
util.py add session manager and cache krb auth 2012-02-09 13:20:45 -06:00
x509.py Verify that the external CA certificate files are correct. 2011-08-23 01:23:41 -04:00