casino 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,7 +21,7 @@ module CASino
21
21
 
22
22
  def authenticators
23
23
  @authenticators ||= begin
24
- CASino.config.authenticators.each do |name, auth|
24
+ CASino.config[:authenticators].each do |name, auth|
25
25
  next unless auth.is_a?(Hash)
26
26
 
27
27
  authenticator = if auth[:class]
@@ -30,7 +30,7 @@ module CASino
30
30
  load_authenticator(auth[:authenticator])
31
31
  end
32
32
 
33
- CASino.config.authenticators[name] = authenticator.new(auth[:options])
33
+ CASino.config[:authenticators][name] = authenticator.new(auth[:options])
34
34
  end
35
35
  end
36
36
  end
@@ -0,0 +1,29 @@
1
+ require 'io/console'
2
+
3
+ namespace :casino do
4
+ namespace :authentication do
5
+ desc 'Test authentication.'
6
+ task test: :environment do |task, args|
7
+ include CASino::ProcessorConcern::Authentication
8
+ print "Username: "
9
+ username = STDIN.gets.chomp
10
+ print "Password (won't be shown): "
11
+ password = STDIN.noecho(&:gets).chomp
12
+ 2.times { puts }
13
+ puts "Testing credentials against #{authenticators.length} authenticators"
14
+ authenticators.each do |authenticator_name, authenticator|
15
+ puts "'#{authenticator_name}' (#{authenticator.class}):"
16
+ print ' '
17
+ begin
18
+ if data = authenticator.validate(username, password)
19
+ p data
20
+ else
21
+ puts "Invalid credentials"
22
+ end
23
+ rescue CASino::Authenticator::AuthenticatorError => e
24
+ puts "#{e}"
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -1,3 +1,3 @@
1
1
  module CASino
2
- VERSION = '3.0.3'
2
+ VERSION = '3.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: casino
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-08-27 00:00:00.000000000 Z
14
+ date: 2014-10-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: capybara
@@ -413,6 +413,7 @@ files:
413
413
  - lib/casino/engine.rb
414
414
  - lib/casino/inflections.rb
415
415
  - lib/casino/tasks.rb
416
+ - lib/casino/tasks/authentication.rake
416
417
  - lib/casino/tasks/cleanup.rake
417
418
  - lib/casino/tasks/service_rule.rake
418
419
  - lib/casino/tasks/user.rake