casino-test_authenticator 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- data/README.md +3 -1
- data/casino-test_authenticator.gemspec +2 -1
- data/lib/casino/test_authenticator.rb +4 -1
- data/lib/casino/test_authenticator/version.rb +1 -1
- data/spec/casino/test_authenticator_spec.rb +11 -0
- metadata +20 -7
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NTkwMWQ1MTMxOWEyYmM4ZjhmNmE3Y2FiZTExOTM1MGQ5OTlkYWVkYQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e179220dd2bfcac75f30f93839403db54995c3dd
|
4
|
+
data.tar.gz: 367942d2aa1ab165fa947c93dfebc4cc3b56c7b3
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NDE4NTYyZDRlODcwM2ZkZGRmNGE1YTk1YWQ5ODJhZjI4ZWRiY2E5YjlmYTMw
|
11
|
-
Zjk3ZjYxZWJiMGQ1NDZhY2Y2ZWRkNGVkODgxODVjOTNhZTFjMTQ=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MjI1MDFjNGFkYjdiNTY5ZWQ4YjY2N2Q4YTQ4Mzk1NThkYjg3OGI1ZjkwZTll
|
14
|
-
ZWMxNjFhYWQ2YWZkOTI0OWE3NWNjZGNhOGUyMTk2NTJmYmI2YTQzNzE5ZmRl
|
15
|
-
YjYxYWM0OTBlNmU3ZDAxZjZmMTZiY2U4NGVkOTFiNDlhNTRiNDc=
|
6
|
+
metadata.gz: 46125460d6e6e9d45a346f106901c8e45c21d18340c1404af2b09c482d5ae95f0286a13881303680ad9cfffddd82f5db71aefb8a622aaa81a83a539f5af76d88
|
7
|
+
data.tar.gz: 22fe90cd3af7d316c246af0bf26bb5b4ac0007fef397f4299cd37f5a42f0763c4e72c8e065c34798f2d743853137c2ee5712b9801c037f0ff20f6c767d0ea265
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# casino-test_authenticator [](https://travis-ci.org/beezly/casino-test_authenticator) [](https://coveralls.io/r/beezly/casino-test_authenticator)Provides a test authenticator for [CASino](https://github.com/rbCAS/CASino).
|
2
2
|
|
3
|
+
I've written a [blog article](http://beez.ly/2014/05/15/building-a-development-cas-environment-with-casinoapp-and-casino-test_authenticator/) on how to use this with CASinoApp.
|
4
|
+
|
3
5
|
The test authenticator will validate a user if the username and password match.
|
4
6
|
|
5
7
|
**The test authenticator should only be used in environments where you do not care about security**
|
@@ -11,7 +13,7 @@ To use the test authenticator, configure it in your cas.yml:
|
|
11
13
|
authenticator: "Test"
|
12
14
|
options:
|
13
15
|
|
14
|
-
|
16
|
+
The only option is "mail" which will return a mail attribute containg a fake e-mail address for the user.
|
15
17
|
|
16
18
|
## Contributing to casino-test_authenticator
|
17
19
|
|
@@ -22,5 +22,6 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_development_dependency 'simplecov', '~> 0.7'
|
23
23
|
s.add_development_dependency 'coveralls', '~> 0'
|
24
24
|
|
25
|
-
s.add_runtime_dependency 'casino', '
|
25
|
+
s.add_runtime_dependency 'casino', '> 2.0'
|
26
|
+
s.add_runtime_dependency 'faker', '~> 0'
|
26
27
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'casino/authenticator'
|
2
|
+
require 'faker'
|
2
3
|
|
3
4
|
class CASino::TestAuthenticator
|
4
5
|
# @param [Hash] options
|
@@ -26,6 +27,8 @@ class CASino::TestAuthenticator
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def extra_attributes
|
29
|
-
|
30
|
+
attr = {}
|
31
|
+
attr[:mail] = Faker::Internet.email if @options[:mail]
|
32
|
+
attr.length == 0 ? nil : attr
|
30
33
|
end
|
31
34
|
end
|
@@ -18,6 +18,7 @@ describe CASino::TestAuthenticator do
|
|
18
18
|
extra_attributes: nil
|
19
19
|
}
|
20
20
|
end
|
21
|
+
|
21
22
|
end
|
22
23
|
|
23
24
|
context 'when validation fails' do
|
@@ -27,5 +28,15 @@ describe CASino::TestAuthenticator do
|
|
27
28
|
end
|
28
29
|
end
|
29
30
|
|
31
|
+
context 'when a mail attribute is required' do
|
32
|
+
let (:options) { { mail: true } }
|
33
|
+
let (:password) { 'test' }
|
34
|
+
it 'returns a mail attribute' do
|
35
|
+
res = subject.validate(username, password)
|
36
|
+
res.should have_key(:extra_attributes)
|
37
|
+
res[:extra_attributes][:mail].should be_a_kind_of(String)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
30
41
|
end
|
31
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: casino-test_authenticator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Beresford
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -70,16 +70,30 @@ dependencies:
|
|
70
70
|
name: casino
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>'
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '2.0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '>'
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '2.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: faker
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
description: This gem can be used to allow the CASino backend to authenticate without
|
84
98
|
any backend services.
|
85
99
|
email:
|
@@ -91,7 +105,6 @@ files:
|
|
91
105
|
- .gitignore
|
92
106
|
- .rspec
|
93
107
|
- .ruby-gemset
|
94
|
-
- .ruby-version
|
95
108
|
- Gemfile
|
96
109
|
- LICENSE.txt
|
97
110
|
- README.md
|
@@ -112,12 +125,12 @@ require_paths:
|
|
112
125
|
- lib
|
113
126
|
required_ruby_version: !ruby/object:Gem::Requirement
|
114
127
|
requirements:
|
115
|
-
- -
|
128
|
+
- - '>='
|
116
129
|
- !ruby/object:Gem::Version
|
117
130
|
version: '0'
|
118
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
132
|
requirements:
|
120
|
-
- -
|
133
|
+
- - '>='
|
121
134
|
- !ruby/object:Gem::Version
|
122
135
|
version: '0'
|
123
136
|
requirements: []
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.9.3-p194
|