Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #624 (closed defect: fixed)

Opened 9 years ago

Last modified 7 years ago

[PATCH][TEST] Setting user passwords outside of identity doesn't work

Reported by: plewis Owned by: plewis
Priority: normal Milestone: 0.9a5
Component: Identity Version:
Severity: normal Keywords:
Cc: Jeff Watkins, jeff

Description

If you are just working with a TG_User object (or child) outside of a running identity provider, setting the password doesn't work. You can't even create a new model, as password is one of the initializaion parameters.

This creates problems in tests, and when just messing around with the raw models.

Attachments

default_password.diff Download (3.9 KB) - added by plewis 9 years ago.
identity.patch Download (3.0 KB) - added by plewis 9 years ago.
Update for breaking changes in [1037]

Change History

Changed 9 years ago by plewis

comment:1 Changed 9 years ago by plewis

  • Owner changed from anonymous to plewis
  • Status changed from new to assigned
  • Summary changed from Setting user passwords outside of identity doesn't work to [PATCH][TEST] Setting user passwords outside of identity doesn't work

The patch creates an identity provider to hash the password if a provider isn't available. If nothing is configured, it will store the password as plaintext.

comment:2 Changed 9 years ago by simon

  • Cc Jeff Watkins added

comment:3 Changed 9 years ago by plewis

There is another ticket with a patch that treats the same issue [635]. The 635 patch breaks out getting the encryption algorithm into a separate function, whereas the patch in this ticket creates a identity provider just to encrypt the password.

Another option would be to have encrypt_password be a staticmethod of the default identity provider.

comment:4 Changed 9 years ago by anonymous

Er, that should be #635

comment:5 Changed 9 years ago by kevin

  • Status changed from assigned to closed
  • Resolution set to duplicate

I'm going to go with the one in #635. I prefer the idea of making it a function to instantiating an object just for the encryption. Thanks for the patch and the pointer to the other ticket!

comment:6 Changed 9 years ago by kevin

  • Status changed from closed to reopened
  • Resolution duplicate deleted

I changed my mind. After looking at #635 in context, the patch as written was problematic because the encryption algorithm was set at import time. I changed it to set the algorithm on the first call of the encryption function, but that was still uncomfortable because the algorithm was sealed off for any soprovider at that point. So, I've switched to using this patch after all. Committed in [1006].

comment:7 Changed 9 years ago by kevin

  • Status changed from reopened to closed
  • Resolution set to fixed
  • Milestone changed from 0.9 to 0.9a2

Changed 9 years ago by plewis

Update for breaking changes in [1037]

comment:8 Changed 9 years ago by plewis

  • Status changed from closed to reopened
  • Resolution fixed deleted

This error resurfaced with [1037]. Unfortunately, the test didn't catch it. Submitting a new test and patch.

comment:9 Changed 9 years ago by Renzo

Hi, with your last modifies now it's possible to create a new user using the "tg-admin shell", but the problem persists using "tg-admin toolbox".

comment:10 Changed 9 years ago by simon

  • Cc jeff added
  • Milestone changed from 0.9a2 to 0.9a5

comment:11 Changed 9 years ago by plewis

The problems with the toolbox are unrelated to this issue. #771 details the Catwalk issue more thoroughly.

comment:12 Changed 8 years ago by kevin

  • Status changed from reopened to closed
  • Resolution set to fixed

This code changed as part of the identity model yesterday. I just tried setting the password from the shell and it worked fine for me now.

Note: See TracTickets for help on using tickets.