Closed rbinsztock closed 11 years ago
well, i finally comment the line 56 into sql_encrypted.rb : #$LOG.debug "#{self.class}: [#{user_model}] " + "Connection pool size: #{user_model.connection_pool.instance_variable_get(:@checked_out).length}/#{user_model.connection_pool.instance_variable_get(:@connections).length}"
and it's work now!
:@checked_out was removed from the connection pool object.
Hi,
Thanks for reporting that. I also had that issue. I prepared fix for that but before merging I need to make sure if I understood it correctly.
As far as I understand it, we want to log here information about how many connections we have opened and what is the max pool size, right? Because if so, this code do not provide that anyway. It should be something like that:
"Connection pool size: #{user_model.connection_pool.connections.length}/#{user_model.connection_pool.instance_variable_get(:@size).length}"
Is that correct?
That is correct, though you just want to call:
#{user_model.connection_pool.instance_variable_get(:@size)
Calling length on @size is undefined.
Yes, good point, somehow I miss that one. Ok so I will prepare fix for that.
Thanks for review.
Well, i try to use Two authenticator my LDAP Authenticator works great but now i want to add an SQL one for backup.
The thing is i got only error when i try to connect with it :
oMethodError - undefined method
length' for nil:NilClass: /home/rbi/sites/rubycas-server/lib/casserver/authenticators/sql.rb:83:in
validate' /home/rbi/sites/rubycas-server/lib/casserver/server.rb:443:inblock (2 levels) in <class:Server>' /home/rbi/sites/rubycas-server/lib/casserver/server.rb:435:in
each' /home/rbi/sites/rubycas-server/lib/casserver/server.rb:435:inblock in <class:Server>' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in
call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:inblock in compile!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in
[]' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:inblock (3 levels) in route!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:851:in
route_eval' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:inblock (2 levels) in route!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:872:in
block in process_route' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:incatch' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in
process_route' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:834:inblock in route!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in
each' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:inroute!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:936:in
dispatch!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:inblock in call!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in
block in invoke' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:incatch' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in
invoke' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:incall!' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:755:in
call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:incall' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb:16:in
call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb:17:incall' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:in
call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:incall' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-1.4.1/lib/rack/nulllogger.rb:9:in
call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-1.4.1/lib/rack/head.rb:9:incall' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/showexceptions.rb:21:in
call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:99:incall' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:1389:in
block in call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:1471:insynchronize' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/sinatra-1.3.3/lib/sinatra/base.rb:1389:in
call' /home/rbi/.rvm/gems/ruby-1.9.3-p327@rubycas/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:inservice' /home/rbi/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:138:in
service' /home/rbi/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:94:inrun' /home/rbi/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/server.rb:191:in
block in start_thread'I have try with password in plain text with :
class: CASServer::Authenticators::SQL database: adapter: mysql2 database: rubycas_user username: root password: coucou host: localhost user_table: users username_column: username password_column: password
and another one with encrypted password :
class: CASServer::Authenticators::SQLEncrypted database: adapter: mysql2 database: rubycas_interface username: root password: coucou host: localhost user_table: users username_column: login encrypt_function: 'user.crypted_password == Digest::SHA1.hexdigest("--#{user.salt}--#{@password}--")'
i got the same error for both undefined method "lenght"
one with the SQL adapter and the encrypted one with the SQLencrypted adapater.
Thanks a lot.
My password are stored in SHA1 into my rubycas_interface.