Re: [gitorious] LDAP auto_register

2012-12-06 Thread Walter Boring
Still no joy?   I'm still not able to use gitorious with this 
configuration.   The save! call is still failing due to the login being the 
email address.



On Tuesday, November 27, 2012 1:34:41 PM UTC-8, Walter Boring wrote:

 The username creates created from the auto_register method's call to

 user.login = transform_username(username)

 That internally calls LDAPConfigurator.transform_username(username)

 Which is
 username.gsub(., -)

 Shouldn't the user.login be set via...

 user.login = build_username(username)

 instead?



 On Tuesday, November 27, 2012 1:19:37 PM UTC-8, Walter Boring wrote:

 ok I tried to set the distinguished_name_template as you described, but 
 it didn't change anything.
 The login member in the user object is still set to 
 walter-boring@hp-com prior to calling save!  which fails the validation.

 Walt

 On Tuesday, November 20, 2012 7:51:03 AM UTC-8, Ken Dreyer wrote:

 On Mon, Nov 19, 2012 at 11:19 AM, Walter Boring wabo...@hemna.com 
 wrote: 
  This is the user record just prior to calling user.save 
  #User id: nil, login: walter-boring@hp-com, email: 
  walter...@hp.com, crypted_password: nil, salt: nil, created_at: 
 nil, 

 Unfortunately @ signs are not currently supported in usernames. You 
 should set hp.com within the distinguished_name_template in the 
 authentication section of gitorious.yml 

 distinguished_name_template: {}@hp.com 

 So your Gitorious username is just walter-boring. 

 That said, I would be happy to test patches to make Gitorious support 
 @ signs in usernames :) Ideally this would allow us to support 
 multi-realm authentication. 

 - Ken 



-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com


Re: [gitorious] LDAP auto_register

2012-12-06 Thread Walter Boring
Well, I resorted to the only option I could at this point and hacked the 
code myself.

It's lame, terrible and a hack of a fix, but at least it seems to work.

root@csim-cloud:/var/www/gitorious/lib:(git::master) # git diff 
gitorious/authentication/ldap_configurator.rb
diff --git a/lib/gitorious/authentication/ldap_configurator.rb 
b/lib/gitorious/authentication/ldap_configurator.rb
index 670af27..7440d8c 100644
--- a/lib/gitorious/authentication/ldap_configurator.rb
+++ b/lib/gitorious/authentication/ldap_configurator.rb
@@ -94,11 +94,12 @@ module Gitorious
   end
 
   def self.transform_username(username)
+username = username.gsub(@hp.com, )
 username.gsub(.,-)
   end
 
   def reverse_username_transformation(username)
-username.gsub(-,.)
+username.gsub(-,.) + @hp.com
   end
 end
   end

On Thursday, December 6, 2012 10:08:17 AM UTC-8, Walter Boring wrote:

 Still no joy?   I'm still not able to use gitorious with this 
 configuration.   The save! call is still failing due to the login being the 
 email address.



 On Tuesday, November 27, 2012 1:34:41 PM UTC-8, Walter Boring wrote:

 The username creates created from the auto_register method's call to

 user.login = transform_username(username)

 That internally calls LDAPConfigurator.transform_username(username)

 Which is
 username.gsub(., -)

 Shouldn't the user.login be set via...

 user.login = build_username(username)

 instead?



 On Tuesday, November 27, 2012 1:19:37 PM UTC-8, Walter Boring wrote:

 ok I tried to set the distinguished_name_template as you described, but 
 it didn't change anything.
 The login member in the user object is still set to 
 walter-boring@hp-com prior to calling save!  which fails the validation.

 Walt

 On Tuesday, November 20, 2012 7:51:03 AM UTC-8, Ken Dreyer wrote:

 On Mon, Nov 19, 2012 at 11:19 AM, Walter Boring wabo...@hemna.com 
 wrote: 
  This is the user record just prior to calling user.save 
  #User id: nil, login: walter-boring@hp-com, email: 
  walter...@hp.com, crypted_password: nil, salt: nil, created_at: 
 nil, 

 Unfortunately @ signs are not currently supported in usernames. You 
 should set hp.com within the distinguished_name_template in the 
 authentication section of gitorious.yml 

 distinguished_name_template: {}@hp.com 

 So your Gitorious username is just walter-boring. 

 That said, I would be happy to test patches to make Gitorious support 
 @ signs in usernames :) Ideally this would allow us to support 
 multi-realm authentication. 

 - Ken 



-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com


Re: [gitorious] LDAP auto_register

2012-12-06 Thread Ken Dreyer
On Thu, Dec 6, 2012 at 2:01 PM, Walter Boring wabor...@hemna.com wrote:
 Well, I resorted to the only option I could at this point and hacked the
 code myself.

Can you let us know what version of the code you are running? It
sounds like this could be a bug in that version.

- Ken

-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com


Re: [gitorious] LDAP auto_register

2012-11-21 Thread Marius MÃ¥rnes Mathiesen
On Tue, Nov 20, 2012 at 08:51:01AM -0700, Ken Dreyer wrote:
 That said, I would be happy to test patches to make Gitorious support
 @ signs in usernames :) Ideally this would allow us to support
 multi-realm authentication.

Ken,
Thanks for investigating this! The feature/rails3 branch does in fact
relax the requirements for a valid username (specifically allowing
dots in usernames), so that would be a good place to start.

From the top of my head I really cannot think of any reasons why we
shouldn't allow @-signs in usernames.

Cheers,
- Marius

-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com