Olivier Dony
468ce1b127
[FIX] base_crypt: safer initial crypting of user passwords
...
Avoid locking the full users table unless there is
really at least one user record to crypt.
Avoid using a separate cursor that could create a deadlock
or TransactionRollbackError in the main init() transaction.
bzr revid: odo@openerp.com-20120813145200-cc0gfzz04aundxhw
2012-08-13 16:52:00 +02:00
Olivier Dony
fb346a6de3
[FIX] base_crypt: avoid table lock on res_users during simple auth check
...
Performing a full table lock is potentially very slow
due to the number of tables holding foreign keys towards
res_users, so we should avoid doing that for simple
auth check() calls. The point was only to avoid failing
the update of the last login timestamp, which we don't
actually care much about. So we can replace that with a
simple SELECT FOR UPDATE NOWAIT on that specific user
row and and skip the update in case the LOCK was
not granted
bzr revid: odo@openerp.com-20120813143552-3g3z0q9n1iox8a0b
2012-08-13 16:35:52 +02:00
Xavier Morel
ef603ac337
[IMP] replace manual try:finally:close patterns with 'with closing' ones
...
bzr revid: xmo@openerp.com-20120716065640-qb69ojaljd5z6c39
2012-07-16 08:56:40 +02:00
Xavier Morel
835cb5bcfa
[FIX] concurrency issue when installing base_crypt from web client
...
Basically (and apparently), as base_crypt performs its conversion of
passwords to encrypted passwords a new request arrives and tries to
check its login, blowing up during the update.
* For the conversion, lock the whole table before updating the
passwords, as we need to touch every record anyway we can just put a
big exclusive lock on res_users
* Ideally we'd be able to just lock the relevant row of res_users in
check/_login, but for some reason I don't quite get this does not
work and still yields
> TransactionRollbackError: could not serialize access due to concurrent update
except on the SELECT FOR UPDATE query instead of the UPDATE one. The
docs don't seem to help, and replacing the FOR UPDATE row-level lock
by a table lock works even though they appear pretty much at the
same point. Me no get.
bzr revid: xmo@openerp.com-20120716064903-403pth90kupgfdv3
2012-07-16 08:49:03 +02:00
Xavier Morel
e7f4ebc000
[IMP] move conversion of existing passwords to base_crypt's res.users.init
...
bzr revid: xmo@openerp.com-20120716060524-bxxhu2hrowba2e0y
2012-07-16 08:05:24 +02:00
Olivier Dony
c541f500a3
[FIX] Trunk backport: properly record UTC login date, courtesy of Ian Beardslee
...
lp bug: https://launchpad.net/bugs/967829 fixed
bzr revid: odo@openerp.com-20120331015249-9pvyin8x4tlymois
2012-03-31 03:52:49 +02:00
Kuldeep Joshi (OpenERP)
2b4cf1d63f
[FIX] base_encrypt: unicode convert to utf-8
...
bzr revid: kjo@tinyerp.com-20111018093813-ghtt14ahp470hmd2
2011-10-18 15:08:13 +05:30
Olivier Dony
f36e724804
[IMP] removed remaining method=True params from fields.function
...
Server revision 3495 odo@openerp.com-20110701232328-flgxulxva70vnyxr
removed the need for passing method=True to function fields.
bzr revid: odo@openerp.com-20110705122857-zvzpamu0n24zst1q
2011-07-05 14:28:57 +02:00
P. Christeas
4fe32cf1c6
base_crypt: fix exception, respect res.users active flag
...
After latest Odo's patch, I revisited this code and run base/test_auth.yml
against it. In base_crypt we have to check for "active=true", too.
bzr revid: p_christ@hol.gr-20110502090724-z077apl03mzaxfqt
2011-05-02 12:07:24 +03:00
Olivier Dony
59f6cc2b09
[FIX] base_crypt: double-check to prevent blank passwords
...
bzr revid: odo@openerp.com-20110428155111-ut91pv47u7blya3q
2011-04-28 17:51:11 +02:00
Sbh (OpenERP)
f786e59a17
[Fix]base_crypt: Fix
...
bzr revid: sbh@tinyerp.com-20110113115001-9n9ne9ugwz0yrcsp
2011-01-13 17:20:01 +05:30
Sbh (OpenERP)
1f5d01d1ea
[MERGE] Merge xrg branch for lp:700682
...
bzr revid: sbh@tinyerp.com-20110113114504-y7gqxiyd1g0um9xr
2011-01-13 17:15:04 +05:30
Olivier Dony
723861933c
[FIX] base_crypt: use hashlib.md5 instead of md5.md5 for python 2.5+
...
This also takes care of the DeprecationWarning for Python 2.5+
bzr revid: odo@openerp.com-20110112223436-9ian2damgzh0qoev
2011-01-12 23:34:36 +01:00
Julien Thewys
c9fc809271
[FIX] do not encrypt empty password
...
bzr revid: jth@openerp.com-20110112150518-qup0i5efc4g4xcep
2011-01-12 16:05:18 +01:00
Julien Thewys
4448a67b49
[REF] cosmetic
...
bzr revid: jth@openerp.com-20110112150136-kzaw52txf5rwadrx
2011-01-12 16:01:36 +01:00
Sbh (OpenERP)
922f7caae0
[Fix] Fix buildbot warning
...
bzr revid: sbh@tinyerp.com-20101230060952-p0ehq3mgx7cpbfqw
2010-12-30 11:39:52 +05:30
Vo Minh Thu
fd845c7960
[IMP] base_crypt: the salt cache is on the per db res.users object.
...
bzr revid: vmt@openerp.com-20101228142740-qkhsrnyabjhgsdnx
2010-12-28 15:27:40 +01:00
P. Christeas
6fa81844d2
base_crypt: improve. close cursors, use hashlib, update login date
...
bzr revid: p_christ@hol.gr-20101228132637-oe86bgxujv17tiz2
2010-12-28 15:26:37 +02:00
P. Christeas
6eb0e8e8aa
Merge remote branch 'rebzr/vmt-base-crypt' into tmp-base-crypt
...
Conflicts:
base_crypt/crypt.py
bzr revid: p_christ@hol.gr-20101228113527-phhl69vkj7dudvx3
2010-12-28 13:35:27 +02:00
P. Christeas
774983d16d
base_crypt: small changes, rearrange, to help merging with vmt's branch
...
bzr revid: p_christ@hol.gr-20101228104100-0cl0veaor9iv8q5n
2010-12-28 12:41:00 +02:00
P. Christeas
b102ade21f
base_crypt: Fix login(), close the cursor.
...
bzr revid: p_christ@hol.gr-20101228095210-utld4macqsodsbx4
2010-12-28 11:52:10 +02:00
P. Christeas
72ad853a20
Base_crypt: fix the login algorithm.
...
bzr revid: p_christ@hol.gr-20101228095210-9tynwynx8cn2pgs2
2010-12-28 11:52:10 +02:00
P. Christeas
bb5680dcfd
Base crypt: adapt to new server API
...
Now, login() and check() lie in res.users class.
bzr revid: p_christ@hol.gr-20101228095210-k0ih0a2bibgloc7v
2010-12-28 11:52:10 +02:00
P. Christeas
a5c654f098
Base crypt: fix, again. We must raise Exc. not return.
...
bzr revid: p_christ@hol.gr-20101228094831-a543jrneb9znpvnz
2010-12-28 11:48:31 +02:00
P. Christeas
04a4cf4a32
Base_crypt: fix password check, again.
...
bzr revid: p_christ@hol.gr-20101228094831-c8hvqdl34ircxhr3
2010-12-28 11:48:31 +02:00
P. Christeas
6846791c64
Base_crypt: adapt to security fix of server
...
bzr revid: p_christ@hol.gr-20101228094831-z6c334w8b15v2xfq
2010-12-28 11:48:31 +02:00
P. Christeas
85f7655cfe
Base_crypt: only use latin letters, not intl ones.
...
bzr revid: p_christ@hol.gr-20101228094831-dzypbxuut66t0cnc
2010-12-28 11:48:31 +02:00
P. Christeas
cbbd367c00
base_crypt: write query with %s
...
bzr revid: p_christ@hol.gr-20101228094831-ci5zz12y37miby0g
2010-12-28 11:48:31 +02:00
Vo Minh Thu
0e7f74342a
[IMP] base_crypt: caches are per db.
...
bzr revid: vmt@openerp.com-20101227161234-kmg2gp1mvpav0qpb
2010-12-27 17:12:34 +01:00
Vo Minh Thu
d3d48fd151
[IMP] base_crypt: make sure to also clear the salt cache.
...
bzr revid: vmt@openerp.com-20101227111111-4xw1bkjij343jzpm
2010-12-27 12:11:11 +01:00
Vo Minh Thu
911666b362
[IMP] base_crypt: use the uid_cache and only the login method makes sure all passwords are hashed.
...
bzr revid: vmt@openerp.com-20101226122129-s3yqozd5822t3mfs
2010-12-26 13:21:29 +01:00
Vo Minh Thu
e9c8d9ce77
[IMP] base_crypt: encrypting all passwords at the first check.
...
bzr revid: vmt@openerp.com-20101223163100-ib3qf9i4kiqkpn77
2010-12-23 17:31:00 +01:00
Vo Minh Thu
a0640060f5
[IMP] base_crypt: uses the existing password column (making it a stored function field).
...
bzr revid: vmt@openerp.com-20101223155013-20wd0vxgug1we02b
2010-12-23 16:50:13 +01:00
Vo Minh Thu
0594c0c96f
[IMP] base_crypt: access, login, and check are now methods of the users class (changes for v6).
...
bzr revid: vmt@openerp.com-20101222161841-lwgycpyq6c81vfv3
2010-12-22 17:18:41 +01:00
ksa (Open ERP)
756ab060bb
[IMP]:Remove print statement
...
bzr revid: vmt@openerp.com-20100706051058-q29kpyy7s80i0e9h
2010-07-06 10:40:58 +05:30
Mantavya Gajjar
0232413678
[MERGE]: merging from same branch
...
bzr revid: vmt@openerp.com-20091125141435-vsxil5iy8pa69jgj
2009-11-25 19:44:35 +05:30
Husen Daudi
f522b77574
Improve code to check cache (reference: HMO)
...
bzr revid: hda@tinyerp.com-20080611070322-smrboaciwsho7env
2008-06-11 07:03:22 +00:00
Husen Daudi
e830358b25
Add copyrights
...
bzr revid: hda@tinyerp.com-20080529044607-09pqwt6ihm3j62go
2008-05-29 04:46:07 +00:00
Husen Daudi
b495cec9d1
Module for password encryption.
...
bzr revid: hda@tinyerp.com-20080528030338-7izwvtmmmizg9sp5
2008-05-28 03:03:38 +00:00