zuora_connect 1.5.302 → 1.5.303

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70d948ee67b1668d35ba394188ff631af51c7edd
4
- data.tar.gz: 07b812c7be3cf5ca81ebd8f24589492f321294b2
3
+ metadata.gz: e9f67787b2f057558f35685a26a1c2bc192060cb
4
+ data.tar.gz: 6741008d64f6d109b82757b0ac4c5b860e4b6360
5
5
  SHA512:
6
- metadata.gz: 419ab8e60210fb1c908764da9d7f1ba8b6919326dee5af5e565f8c261e27c9608642ef7610a338d89860e566db977df34d248cd020fe2ab543646e86f417b5af
7
- data.tar.gz: ccc1f977ff420fd837e41e57d8d84d21532d3a23742862a94bb39404c690e742d9ced481ed0f12009ce2df7cda17a3b013dc43dee38b195d5c856b70c82a40fe
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
- @appinstance.new_session(:session => @appinstance.data_lookup(:session => session))
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
- @appinstance.new_session(:session => @appinstance.data_lookup(:session => session))
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
@@ -1,4 +1,4 @@
1
1
  module ZuoraConnect
2
- VERSION = "1.5.302"
2
+ VERSION = "1.5.303"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.302
4
+ version: 1.5.303
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team