zuora_connect 1.5.302 → 1.5.303
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9f67787b2f057558f35685a26a1c2bc192060cb
|
4
|
+
data.tar.gz: 6741008d64f6d109b82757b0ac4c5b860e4b6360
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f58f186f08efb88e09ab849285df46404505189018190bb5956cf8ad71d3b4914f55c66533ca94815b027bb83c9e3d53020b0feaf59409b1392ceed03707f42a
|
7
|
+
data.tar.gz: fdda48ded2e264ac032ea3b661f3e00485ce42046ab299429f5f565c7f3e365beb3744cf63cb91bf5c1abf54e6aef107db48aa616a5da57722d6360f74cc882f
|
@@ -627,6 +627,18 @@ module ZuoraConnect
|
|
627
627
|
end
|
628
628
|
### END Aggregate Grouping Helping Methods #####
|
629
629
|
|
630
|
+
# Overide this method to avoid the new session call for api requests that use the before filter authenticate_app_api_request.
|
631
|
+
# This can be usefull for apps that dont need connect metadata call, or credentials, to operate for api requests
|
632
|
+
def new_session_for_api_requests(params: {})
|
633
|
+
return true
|
634
|
+
end
|
635
|
+
|
636
|
+
# Overide this method to avoid the new session call for ui requests that use the before filter authenticate_connect_app_request.
|
637
|
+
# This can be usefull for apps that dont need connect metadata call, or credentials, to operate for ui requests
|
638
|
+
def new_session_for_ui_requests(params: {})
|
639
|
+
return true
|
640
|
+
end
|
641
|
+
|
630
642
|
def reload_attributes(selected_attributes)
|
631
643
|
raise "Attibutes must be array" if selected_attributes.class != Array
|
632
644
|
value_attributes = self.class.unscoped.where(:id=>id).select(selected_attributes).first.attributes
|
@@ -38,7 +38,9 @@ module ZuoraConnect
|
|
38
38
|
#Call .data_lookup with the current session to retrieve session. In some cases session may be stored/cache in redis
|
39
39
|
#so data lookup provides a model method that can be overriden per app.
|
40
40
|
if params[:controller] != 'zuora_connect/api/v1/app_instance' && params[:action] != 'drop'
|
41
|
-
|
41
|
+
if @appinstance.new_session_for_ui_requests(:params => params)
|
42
|
+
@appinstance.new_session(:session => @appinstance.data_lookup(:session => session))
|
43
|
+
end
|
42
44
|
end
|
43
45
|
PaperTrail.whodunnit = session["#{@appinstance.id}::user::email"] if defined?(PaperTrail) && session["#{@appinstance.id}::user::email"].present?
|
44
46
|
begin
|
@@ -147,7 +149,9 @@ module ZuoraConnect
|
|
147
149
|
#API ONLY
|
148
150
|
def check_instance
|
149
151
|
if @appinstance.present?
|
150
|
-
|
152
|
+
if @appinstance.new_session_for_api_requests(:params => params)
|
153
|
+
@appinstance.new_session(:session => @appinstance.data_lookup(:session => session))
|
154
|
+
end
|
151
155
|
Thread.current[:appinstance] = @appinstance
|
152
156
|
PaperTrail.whodunnit = "API User" if defined?(PaperTrail)
|
153
157
|
return true
|