els_token 1.2.0 → 1.2.1
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.
- data/lib/els_token.rb +19 -18
- data/lib/els_token/version.rb +1 -1
- metadata +2 -2
data/lib/els_token.rb
CHANGED
@@ -128,7 +128,9 @@ module ElsToken
|
|
128
128
|
# method that chains is_cookie_token_valid?
|
129
129
|
# then get_token_identity
|
130
130
|
def get_identity(token, options ={})
|
131
|
-
|
131
|
+
options = els_options.dup.merge(options)
|
132
|
+
Rails.logger.debug(options)
|
133
|
+
return fake_id(options) if options.has_key?('faker')
|
132
134
|
begin
|
133
135
|
if is_token_valid?(token, options)
|
134
136
|
get_token_identity(token, options)
|
@@ -173,23 +175,22 @@ module ElsToken
|
|
173
175
|
els_options.has_key? 'faker'
|
174
176
|
end
|
175
177
|
|
176
|
-
def fake_id
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
@fake_id
|
178
|
+
def fake_id(options ={})
|
179
|
+
options = els_options.dup.merge(options)
|
180
|
+
Rails.logger.debug("getting fake id")
|
181
|
+
id = ElsIdentity.new
|
182
|
+
id.instance_variable_set("@roles",options['faker']['roles'])
|
183
|
+
id.instance_variable_set("@mail",options['faker']['mail'])
|
184
|
+
id.instance_variable_set("@last_name",options['faker']['last_name'])
|
185
|
+
id.instance_variable_set("@first_name",options['faker']['first_name'])
|
186
|
+
id.instance_variable_set("@uac",options['faker']['uac'])
|
187
|
+
id.instance_variable_set("@dn",options['faker']['dn'])
|
188
|
+
id.instance_variable_set("@common_name",options['faker']['common_name'])
|
189
|
+
id.instance_variable_set("@employee_number",options['faker']['employee_number'])
|
190
|
+
id.instance_variable_set("@display_name",options['faker']['display_name'])
|
191
|
+
id.instance_variable_set("@token_id",options['faker']['token_id'])
|
192
|
+
id.instance_variable_set("@user_status",options['faker']['user_status'])
|
193
|
+
id
|
193
194
|
end
|
194
195
|
end
|
195
196
|
|
data/lib/els_token/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: els_token
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-16 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A simple plugin to assist ELS token validation
|
15
15
|
email:
|