zuora_connect 2.0.3c → 2.0.3d
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 +4 -4
- data/lib/zuora_connect/controllers/helpers.rb +17 -4
- data/lib/zuora_connect/version.rb +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: bfd7b54383b6874940e04ea6b555727f24de82fa9e5879e4ebd146cd79b1406c
         | 
| 4 | 
            +
              data.tar.gz: ee6840dabf3ebeb17928f2f1ba17d9537dae7ad5d4a0ae61e4c32db41fdc9097
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: ad40f42fb9adf65ee02d14df4cb61e1de48a720c82c776e2a63de0f891a28873d25e25998629e8aeacbbf1db6f70259bea726f87348cb4a7a0f81c17775575ae
         | 
| 7 | 
            +
              data.tar.gz: 549374f0f04473e9346417b4943b7482baf8ef2998c19dec6c9b9198f2e0dba15d9c5bf7e149c3e375dbb2260afdafa5cbda3150b6ba398698c388e4d2884e9a
         | 
| @@ -43,15 +43,15 @@ module ZuoraConnect | |
| 43 43 | 
             
                        @appinstance = appinstances.first
         | 
| 44 44 | 
             
                      end
         | 
| 45 45 |  | 
| 46 | 
            -
                     | 
| 46 | 
            +
                    else #if request.headers.fetch("Authorization", "").include?("Basic ")
         | 
| 47 47 | 
             
                      authenticate_or_request_with_http_basic do |username, password|
         | 
| 48 48 | 
             
                        @appinstance = ZuoraConnect::AppInstance.where(:token => password).first
         | 
| 49 49 | 
             
                        @appinstance ||= ZuoraConnect::AppInstance.where(:api_token => password).first
         | 
| 50 50 | 
             
                        ZuoraConnect.logger.debug("[#{@appinstance.id}] API REQUEST - Basic Auth") if @appinstance.present?
         | 
| 51 51 | 
             
                        check_instance
         | 
| 52 52 | 
             
                      end
         | 
| 53 | 
            -
                    else
         | 
| 54 | 
            -
             | 
| 53 | 
            +
                    # else
         | 
| 54 | 
            +
                    #   check_instance
         | 
| 55 55 | 
             
                    end
         | 
| 56 56 |  | 
| 57 57 | 
             
                    if @appinstance.present?
         | 
| @@ -106,9 +106,22 @@ module ZuoraConnect | |
| 106 106 | 
             
                    ElasticAPM.set_tag(:trace_id, request.uuid) if defined?(ElasticAPM) && ElasticAPM.running?
         | 
| 107 107 | 
             
                    Thread.current[:appinstance] = nil
         | 
| 108 108 |  | 
| 109 | 
            -
                     | 
| 109 | 
            +
                    #Id identity is blank or identity need to be refreshed. 
         | 
| 110 | 
            +
                    if (session["Identity"].blank? || session["ZuoraCurrentEntity"] != request.headers['ZuoraCurrentEntity']) && request.headers['Zuora-Auth-Token'].present?
         | 
| 111 | 
            +
                      puts cookies['ZSession']
         | 
| 112 | 
            +
                      puts cookies['ZuoraCurrentEntity']
         | 
| 110 113 | 
             
                      puts request.headers['ZuoraCurrentEntity']
         | 
| 111 114 | 
             
                      puts "--------\n\n\n\n\n\n\n\n\n\n\n\n"
         | 
| 115 | 
            +
                      puts request.headers['Zuora-Auth-Token']
         | 
| 116 | 
            +
                      begin
         | 
| 117 | 
            +
                        zuora_client = ZuoraAPI::Login.new(url: "https://#{request.headers["HTTP_X_FORWARDED_HOST"]}", session: cookies['ZSession'])
         | 
| 118 | 
            +
                        identity = zuora_client.rest_call(url: zuora_client.rest_endpoint("identity"))
         | 
| 119 | 
            +
                        session["Identity"] = identity
         | 
| 120 | 
            +
                        session["ZuoraCurrentEntity"] = cookies['ZuoraCurrentEntity']
         | 
| 121 | 
            +
                      rescue => ex
         | 
| 122 | 
            +
                        
         | 
| 123 | 
            +
                        return
         | 
| 124 | 
            +
                      end
         | 
| 112 125 | 
             
                    end
         | 
| 113 126 |  | 
| 114 127 | 
             
                    if params[:app_instance_ids].present? && !params[:app_instance_id].present?
         |