wordjelly-auth 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b199d8283db1ec9e2b8451159115e043feb55f424a4e69de8cb0de7484e0cbd9
|
4
|
+
data.tar.gz: 378d09b649d232430e4e5b672d7400967d8aeda836bdeb93ae991c6b41bbb08a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7bd3556b2fc44d5c910bc8a9c3cc0d983f0ef44c5fc16c274d9753ce165f8dce0c40d07c6f85a38a446f2de27f77db049f7ca2ce40aab8a756867b3e1f0c595
|
7
|
+
data.tar.gz: 3ce91e1f22f2855372084e00cdb83e3c46790c79c908076798eadeec849219ab8c8e555ba6a69f83d38b0ba102a08172e9c7a947861ade369cedc07e3c8ce2da
|
@@ -72,6 +72,7 @@ module Auth::Concerns::DeviseConcern
|
|
72
72
|
|
73
73
|
def set_client
|
74
74
|
|
75
|
+
puts "came to set client -------!!!!!!!!!!!!! "
|
75
76
|
if session[:client]
|
76
77
|
|
77
78
|
|
@@ -107,7 +108,7 @@ module Auth::Concerns::DeviseConcern
|
|
107
108
|
|
108
109
|
if session[:client] = Auth::Client.find_valid_api_key_and_app_id(api_key, current_app_id)
|
109
110
|
|
110
|
-
|
111
|
+
puts "found valid client."
|
111
112
|
request.env["omniauth.model"] = path
|
112
113
|
|
113
114
|
self.m_client = Auth::Client.find_valid_api_key_and_app_id(api_key, current_app_id)
|
@@ -142,7 +143,7 @@ module Auth::Concerns::DeviseConcern
|
|
142
143
|
#render :nothing => true , :status => :unauthorized
|
143
144
|
head :unauthorized
|
144
145
|
else
|
145
|
-
|
146
|
+
puts " -------- have A VALID CLIENT WITH JSON --------- "
|
146
147
|
end
|
147
148
|
end
|
148
149
|
else
|
@@ -189,7 +190,6 @@ module Auth::Concerns::DeviseConcern
|
|
189
190
|
|
190
191
|
protect_json_request
|
191
192
|
|
192
|
-
|
193
193
|
end
|
194
194
|
|
195
195
|
##used only in render, redirect in DeviseController.class_eval
|
@@ -31,11 +31,11 @@ module Auth::Concerns::TokenConcern
|
|
31
31
|
end
|
32
32
|
|
33
33
|
|
34
|
-
puts "the tconditions become:"
|
35
|
-
puts TCONDITIONS
|
34
|
+
#puts "the tconditions become:"
|
35
|
+
#puts TCONDITIONS
|
36
36
|
|
37
|
-
puts "the last fallback becomes:"
|
38
|
-
puts LAST_FALLBACK
|
37
|
+
#puts "the last fallback becomes:"
|
38
|
+
#puts LAST_FALLBACK
|
39
39
|
#LAST_FALLBACK = :devise unless defined? LAST_FALLBACK
|
40
40
|
|
41
41
|
|
@@ -45,17 +45,17 @@ module Auth::Concerns::TokenConcern
|
|
45
45
|
## how many models are defined in the preinitializer
|
46
46
|
auth_resources_count = Auth.configuration.auth_resources.size
|
47
47
|
|
48
|
-
puts "auth_resources count:"
|
49
|
-
puts auth_resources_count.to_s
|
48
|
+
#puts "auth_resources count:"
|
49
|
+
#puts auth_resources_count.to_s
|
50
50
|
res = Auth.configuration.auth_resources.keys[0]
|
51
|
-
puts "the TCONDITIONS ARE: #{self::TCONDITIONS}"
|
51
|
+
#puts "the TCONDITIONS ARE: #{self::TCONDITIONS}"
|
52
52
|
#acts_as_token_authentication_handler_for(res.constantize,Auth.configuration.auth_resources[res].merge({:fallback => self::LAST_FALLBACK}).merge(self::TCONDITIONS || {}))
|
53
53
|
|
54
54
|
## if we have more than one auth resource model.
|
55
55
|
if auth_resources_count > 1
|
56
56
|
## take all of them except the last, and add the fallback as none to them.
|
57
57
|
## also merge the controller level conditions defined above.
|
58
|
-
puts "there is more than one."
|
58
|
+
#puts "there is more than one."
|
59
59
|
Auth.configuration.auth_resources.keys.slice(0,auth_resources_count - 1).each do |res|
|
60
60
|
|
61
61
|
acts_as_token_authentication_handler_for(res.constantize,Auth.configuration.auth_resources[res].merge({:fallback => :none}).merge(self::TCONDITIONS))
|
@@ -76,7 +76,7 @@ module Auth::Concerns::TokenConcern
|
|
76
76
|
#puts "the action is: #{action_name}"
|
77
77
|
#puts res.to_s
|
78
78
|
#puts "conditions are:"
|
79
|
-
|
79
|
+
|
80
80
|
acts_as_token_authentication_handler_for(res.constantize,Auth.configuration.auth_resources[res].merge({:fallback => self::LAST_FALLBACK}).merge(self::TCONDITIONS || {}))
|
81
81
|
#puts "crosses token auth handler"
|
82
82
|
end
|
@@ -491,13 +491,13 @@ module SimpleTokenAuthentication
|
|
491
491
|
additional_identifiers = entity.get_additional_identifiers_from_headers(self)
|
492
492
|
|
493
493
|
#puts "additional_identifiers"
|
494
|
-
puts additional_identifiers
|
494
|
+
#puts additional_identifiers
|
495
495
|
|
496
496
|
app_id_value = additional_identifiers["X-User-Aid"]
|
497
497
|
user_es_value = additional_identifiers["X-User-Es"]
|
498
498
|
token = entity.get_token_from_params_or_headers(self)
|
499
499
|
|
500
|
-
#puts "token:#{token}"
|
500
|
+
#puts "token is :#{token}"
|
501
501
|
|
502
502
|
if token
|
503
503
|
|
@@ -509,11 +509,11 @@ module SimpleTokenAuthentication
|
|
509
509
|
#puts user_es_value.to_s
|
510
510
|
return nil if (app_id_value.blank? || user_es_value.blank?)
|
511
511
|
|
512
|
-
## sanitize the values incoming to leave only letters and numbers.
|
512
|
+
## sanitize the values incoming to leave only letters and numbers and fucking underscores.
|
513
513
|
|
514
|
-
app_id_value = app_id_value.gsub(/[^0-9a-
|
514
|
+
app_id_value = app_id_value.gsub(/[^0-9a-z_]/i, '')
|
515
515
|
|
516
|
-
user_es_value = user_es_value.gsub(/[^0-9a-
|
516
|
+
user_es_value = user_es_value.gsub(/[^0-9a-z_]/i, '')
|
517
517
|
|
518
518
|
## fails if there are no alphanumeric characters left in the string.
|
519
519
|
#puts "the user es vale is: #{user_es_value}"
|
@@ -533,7 +533,7 @@ module SimpleTokenAuthentication
|
|
533
533
|
|
534
534
|
if records.size > 0
|
535
535
|
#puts "the records size is:"
|
536
|
-
|
536
|
+
##puts records.size.to_s
|
537
537
|
#puts "found such a record.!!!!!!!!!!!!"
|
538
538
|
r = records.first
|
539
539
|
#puts r.attributes.to_s
|
data/lib/auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wordjelly-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bhargav
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|