Skip to content

Error when SQLAuthlogic authenticator has no encryptor_options #72

@bitaxis

Description

@bitaxis

I have configured rubycas-server to use the Authlogic authenticator. I found that in config.yml, if I don't specify any encryptor_options in the authenticator section, then CASServer::Authenticators::SQLAuthlogic#validate errors out with the following:

NoMethodError - undefined method `each' for nil:NilClass:
/home/bitaxis/.rvm/gems/ruby-1.9.2-p290/gems/rubycas-server-1.0.1/lib/casserver/authenticators/sql_authlogic.rb:69:in `validate'
/home/bitaxis/.rvm/gems/ruby-1.9.2-p290/gems/rubycas-server-1.0.1/lib/casserver/server.rb:444:in `block (2 levels) in <class:Server>'
/home/bitaxis/.rvm/gems/ruby-1.9.2-p290/gems/rubycas-server-1.0.1/lib/casserver/server.rb:436:in `each'
/home/bitaxis/.rvm/gems/ruby-1.9.2-p290/gems/rubycas-server-1.0.1/lib/casserver/server.rb:436:in `block in <class:Server>'

The reason is simple, as @options[:encryptor_options] evaluates to nil when no encryptor_options are specified.

One fix is modifying line 69 to be as follows:

(@options[:encryptor_options] || []).each do |name, value|   

I've tested this fix locally, and it works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions