Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
working configuration variables
  • Loading branch information
adamdruppe committed Sep 23, 2014
commit 1663a263801ab2045d606b51904cff007c059397
10 changes: 5 additions & 5 deletions lib/beyondz.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ class CustomAuthenticator < CASServer::Authenticators::Base
def self.setup(options)
raise CASServer::AuthenticatorError, "Authenticator configuration needs server" unless options[:server]

@server = options[:server]
@port = options[:port] ? options[:port].to_i : 80
@ssl = options[:ssl] ? options[:ssl].to_b : false
@@server = options[:server]
@@port = options[:port] ? options[:port].to_i : 80
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should default to 443 if not configured. Login should inherently be secure, so using SSL should be the default.

@@ssl = options[:ssl] ? options[:ssl].to_b : false
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto on above. We should default to true and configure it otherwise for dev setups.

end

def validate(credentials)
http = Net::HTTP.new(@server, @port)
if @ssl
http = Net::HTTP.new(@@server, @@port)
if @@ssl
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE # self-signed cert would fail
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we don't want to have this line in production code, right? We want self-signed certs to fail.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Wed, Sep 24, 2014 at 10:44:22AM -0700, Brian Sadler wrote:

Actually, we don't want to have this line in production code, right? We want self-signed certs to fail.

Probably, as long as we're not using them anymore (I wasn't sure about that). Maybe it should be a config option too.

end
Expand Down