12 Commits

Author SHA1 Message Date
Dolph Mathews
431e50a785 utf-8 encode user keys in memcache (bug 1056373)
Change-Id: I026dd4282742213e69c7aa02e109439b07a73c8e
2012-09-25 19:21:38 +00:00
Adam Young
150413cc4b List tokens for memcached backend
Creates and updates an index of tokens in a memcache entry keyed
by the user id

Bug 1046905

Change-Id: If11d6b87b0a8ae5f8349f1ebb31790e943c70fbf
2012-09-06 16:33:17 -04:00
Dolph Mathews
7c93e8407d Removed unused imports
Change-Id: I203a1256cb4395ad330c19a14870171420daa065
2012-08-29 14:40:52 -05:00
Maru Newby
7b70818954 PKI Token revocation
Co-authored-by: Adam Young <ayoung@redhat.com>

Token revocations are captured in the backends,

During upgrade, all previous tickets are defaulted to valid.

Revocation list returned as a signed document and can be fetched in an admin context via HTTP

Change config values for enable diable PKI

In the auth_token middleware,  the revocation list is fetched prior
to validating tokens. Any tokens that are on the revocation list
will be treated as invalid.

Added in PKI token tests that check the same logic as the UUID tests.
Sample data for the tests is read out of the signing directory.

dropped number on sql scripts to pass tests.

Also fixes 1031373

Bug 1037683

Change-Id: Icef2f173e50fe3cce4273c161f69d41259bf5d23
2012-08-16 15:07:31 -04:00
Zhongyue Luo
c79d93bfbc Keystone should use openstack.common.timeutils
Implements blueprint use-common-timeutils

1. Edit openstack-common.conf and import keystone/openstack/common/timeutils.py
2. Replace datetime.utcnow with timeutils.utcnow
3. Replace utils.isotime with timeutils.isotime
4. Remove utils.isotime in common/utils.py and datetime related unittest

Change-Id: I4f5a63a368fde8787a0dc0a817c940de685b9ca2
2012-06-29 06:38:49 +08:00
Mark McLoughlin
4cd2945740 Fix expired token tests
Fixes bug #983800

The expiration timestamps are expressed in UTC time, so ensure:

 1) The timestamp of the token created by the test is UTC time (i.e.
    utcnow() vs now())

 2) The expiration check in the dummy memcache client properly
    accounts for UTC (i.e. utctimetuple() vs timetuple())

Change-Id: Ie7356456f79ab5a8070a79771bb7d210b1cedd47
2012-04-23 19:48:23 +01:00
Joe Heck
dee81534cb making all use of time follow datetime.utcnow()
fixes bug 954057

Change-Id: I14fa475dc03410b8843ab028d30fbc8802c4be30
2012-03-13 13:53:44 -07:00
Monty Taylor
8d7189f117 Added Apache 2.0 License information.
Fixes bug 932819

Change-Id: I58e0c2ad704e2e8ff1924a01791694a5e02a154b
2012-02-15 17:48:33 -08:00
Brian Waldon
71436dbf18 Add token expiration
* Config option token.expiration defines amount of time tokens should be valid
* Fixes bug 928545

Change-Id: I3dff7a1ebf03bb44fc6e5247f976baea0581de08
2012-02-14 14:18:50 -08:00
Brian Waldon
e1a9a1f06f Handle unicode keys in memcache token backend
* Cast keys to str in memcache backend
* Emulate encoding error in fake memcache client
* Fixes bug 931746

Change-Id: I13bc573d4aca6849b1b8128ab55823545d5a3a11
2012-02-14 11:23:21 -08:00
Brian Waldon
2c18314e7c Add TokenNotFound exception
* raise TokenNotFound from token backends on get/delete when token doesn't exist

Change-Id: Ic9aba7911088c30c20fe62501a05d75232f2d8b9
2012-02-10 10:20:16 -08:00
Jesse Andrews
05b2583dfa Add memcache token backend
* tests use a fake memcache client
* fixes bug 928040

Change-Id: I7c24e7829ee91fcf719eb4f338cf0ce2a0fa6bbd
2012-02-08 14:37:35 -08:00