• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / tigerdata-app / e091d009-5a3a-4ffa-a23a-daa4e1d7e0e7

21 Oct 2025 09:38PM UTC coverage: 79.122% (-8.2%) from 87.292%
e091d009-5a3a-4ffa-a23a-daa4e1d7e0e7

push

circleci

web-flow
Bump vite from 5.4.20 to 5.4.21 in the npm_and_yarn group across 1 directory (#2062)

Bumps the npm_and_yarn group with 1 update in the / directory:
[vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).

Updates `vite` from 5.4.20 to 5.4.21
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/vitejs/vite/releases">vite's
releases</a>.</em></p>
<blockquote>
<h2>v5.4.21</h2>
<p>Please refer to <a
href="https://github.com/vitejs/vite/blob/v5.4.21/packages/vite/CHANGELOG.md">CHANGELOG.md</a>
for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/vitejs/vite/blob/v5.4.21/packages/vite/CHANGELOG.md">vite's
changelog</a>.</em></p>
<blockquote>
<h2><!-- raw HTML omitted -->5.4.21 (2025-10-20)<!-- raw HTML omitted
--></h2>
<ul>
<li>fix(dev): trim trailing slash before <code>server.fs.deny</code>
check (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/20968">#20968</a>)
(<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/20970">#20970</a>)
(<a
href="https://github.com/vitejs/vite/commit/<a class=hub.com/pulibrary/tigerdata-app/commit/cad1d31d0635dd8fd4ddfe6e5a92eb9ff13cd06c">cad1d31d0<a href="https://github.com/pulibrary/tigerdata-app/commit/b45666a26476ff4bf99d2a0465a0b5ebbdf98838">&quot;&gt;cad1d31&lt;/a&gt;),
closes &lt;a
href=&quot;https://redirect.github.com/vitejs/vite/issues/20968&quot;&gt;#20968&lt;/a&gt;
&lt;a
href=&quot;https://redirect.github.com/vitejs/vite/issues/20970">#20970</a></li>
<li>chore: update CHANGELOG (<a
href="https://github.com/vitejs/vite/commit/<a class="double-link" href="https://github.com/pulibrary/tigerdata-app/commit/ca88ed7398288ce0c60176ac9a6392f10654c67c">ca88ed739</a><a href="https://github.com/pulibrary/tigerdata-app/commit/b45666a26476ff4bf99d2a0465a0b5ebbdf98838">&quot;&gt;ca88ed7&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;/details&gt;
&lt;details&gt;
&lt;summary&gt;Commits&lt;/summary&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a
href=&quot;https://github.com/vitejs/vite/commit/</a><a class="double-link" href="https://github.com/pulibrary/tigerdata-app/commit/adce3c22c64cc9d44cc8f45cc92b543e3e4bf385">adce3c22c">adce3c2
release: v5.4.21
  • cad1d31 fix(dev): trim trailing slash before server.fs.deny check (
  • 2380 of 3008 relevant lines covered (79.12%)

    148.71 hits per line

    Source File
    Press 'n' to go to next uncovered line, 'b' for previous

    87.65
    /app/models/mediaflux/request.rb
    1
    # frozen_string_literal: true
    
    2
    module Mediaflux
    
    2✔
    3
        class Request
    
    2✔
    4
    
    
    5
          # As this is an abstract class, this should be overridden to specify the Mediaflux API service
    
    6
          def self.service
    
    2✔
    7
            raise(NotImplementedError, "#{self} is an abstract class, please override #{self}.service")
    
    ×
    8
          end
    
    9
    
    
    10
          # The default request URL path for the Mediaflux API
    
    11
          # @return [String]
    
    12
          def self.request_path
    
    2✔
    13
            "/__mflux_svc__"
    
    3,327✔
    14
          end
    
    15
    
    
    16
          def self.uri
    
    2✔
    17
            # Setting the URI to the Ansible build or Docker build of mediaflux depending on the environment
    
    18
            URI("#{Connection.transport}://#{Connection.host}:#{Connection.port}#{request_path}")
    
    1,664✔
    19
          end
    
    20
    
    
    21
          # Constructs a new HTTP POST request for usage with the Mediaflux API
    
    22
          # @return [Net::HTTP::Post]
    
    23
          def self.build_post_request
    
    2✔
    24
            Net::HTTP::Post.new(request_path)
    
    1,663✔
    25
          end
    
    26
    
    
    27
          # The default XML namespace which should be used for building the XML
    
    28
          #   Document transmitted in the body of the HTTP request
    
    29
          # @return [String]
    
    30
          def self.default_xml_namespace
    
    2✔
    31
            "tigerdata"
    
    43✔
    32
          end
    
    33
    
    
    34
          def self.default_xml_namespace_uri
    
    2✔
    35
            "http://tigerdata.princeton.edu"
    
    43✔
    36
          end
    
    37
    
    
    38
          # Constructs and memoizes a new instance of the Net::HTTP::Persistent object at the level of the Class
    
    39
          # @returns http_client [Net::HTTP::Persistent] HTTP client for transmitting requests to the Mediaflux server API
    
    40
          def self.find_or_create_http_client
    
    2✔
    41
            HttpConnection.instance.http_client
    
    1,663✔
    42
          end
    
    43
    
    
    44
          attr_reader :session_token
    
    2✔
    45
    
    
    46
          # Constructor
    
    47
          # @param file [File] any upload file required for the POST request
    
    48
          # @param session_token [String] the API token for the authenticated session
    
    49
          # @param http_client [Net::HTTP::Persistent] HTTP client for transmitting requests to the Mediaflux server API
    
    50
          def initialize(file: nil, session_token: nil, http_client: nil)
    
    2✔
    51
            @http_client = http_client || self.class.find_or_create_http_client
    
    1,663✔
    52
            @file = file
    
    1,663✔
    53
            @session_token = session_token
    
    1,663✔
    54
          end
    
    55
    
    
    56
          # Resolves the HTTP request against the Mediaflux API
    
    57
          # @return [Net::HTTP]
    
    58
          def resolve
    
    2✔
    59
            @http_response = @http_client.request self.class.uri, http_request
    
    1,663✔
    60
          end
    
    61
    
    
    62
          # Determines whether or not the request has been resolved
    
    63
          # @return [Boolean]
    
    64
          def resolved?
    
    2✔
    65
            @http_response.present?
    
    2,262✔
    66
          end
    
    67
    
    
    68
          # Resolves the HTTP request, and returns the XML Document parsed from the response body
    
    69
          # @return [Nokogiri::XML::Document]
    
    70
          def response_xml
    
    2✔
    71
            resolve unless resolved?
    
    2,262✔
    72
            Rails.logger.debug(response_body)
    
    2,262✔
    73
            @response_xml ||= Nokogiri::XML.parse(response_body)
    
    2,262✔
    74
            Rails.logger.debug(@response_xml)
    
    2,262✔
    75
            if @response_xml.xpath("//message").text == "session is not valid"
    
    2,262✔
    76
              raise Mediaflux::SessionExpired, "Session expired for token #{session_token}"
    
    ×
    77
            end
    
    78
    
    
    79
            @response_xml
    
    2,262✔
    80
          end
    
    81
    
    
    82
          # The response body of the mediaflux call
    
    83
          def response_body
    
    2✔
    84
            @response_body ||= http_response.body
    
    3,845✔
    85
          end
    
    86
    
    
    87
          def error?
    
    2✔
    88
            response_error.present?
    
    651✔
    89
          end
    
    90
    
    
    91
          def response_error
    
    2✔
    92
            xml = response_xml
    
    653✔
    93
            return nil if xml.xpath("/response/reply/error").count == 0
    
    653✔
    94
            error = {
    
    95
              title: xml.xpath("/response/reply/error").text,
    
    1✔
    96
              message: xml.xpath("/response/reply/message").text
    
    97
            }
    
    98
            Rails.logger.error "MediaFlux error: #{error[:title]}, #{error[:message]}"
    
    1✔
    99
            error
    
    1✔
    100
          end
    
    101
    
    
    102
          delegate :to_s, to: :response_xml
    
    2✔
    103
    
    
    104
          def xml_payload( name: self.class.service)
    
    2✔
    105
            body = build_http_request_body(name: )
    
    3,326✔
    106
            xml_payload = body.to_xml
    
    3,326✔
    107
          end
    
    108
    
    
    109
          # The output of this routine can be passed to xtoshell in aterm.  The output of which can be sent to service.execute
    
    110
          # @param [String] name name of the service this request will send
    
    111
          # @return [String] xml that can be passed to xtoshell without manipulation
    
    112
          def xtoshell_xml( name: self.class.service)
    
    2✔
    113
            xml_builder = build_http_request_body(name: )
    
    ×
    114
            xml_builder.doc.xpath("//request/service/@session").remove
    
    ×
    115
            xml = xml_builder.to_xml(:save_with => Nokogiri::XML::Node::SaveOptions::AS_XML | Nokogiri::XML::Node::SaveOptions::NO_DECLARATION)
    
    ×
    116
            xml.strip.gsub("\"","'").gsub("<args>","").gsub("</args>","")
    
    ×
    117
          end
    
    118
    
    
    119
          # This method is used for transforming iso8601 dates to dates that MediaFlux likes
    
    120
          # Take a string like "2024-02-26T10:33:11-05:00" and convert this string to "22-FEB-2024 13:57:19"
    
    121
          def self.format_date_for_mediaflux(iso8601_date)
    
    2✔
    122
            return if iso8601_date.nil?
    
    ×
    123
            Time.format_date_for_mediaflux(iso8601_date)
    
    ×
    124
          end
    
    125
    
    
    126
          private
    
    2✔
    127
    
    
    128
            def http_request
    
    2✔
    129
              @http_request ||= build_http_request(name: self.class.service, form_file: @file)
    
    1,663✔
    130
            end
    
    131
    
    
    132
            def http_response
    
    2✔
    133
              @http_response ||= resolve
    
    1,581✔
    134
            end
    
    135
    
    
    136
            def build_http_request_body(name:)
    
    2✔
    137
              args = { name: name }
    
    3,326✔
    138
                                                    # must use @session_token here instead of session_token
    
    139
                                                    #  for login to not go into an infinaite loop
    
    140
              args[:session] = session_token unless @session_token.nil?
    
    3,326✔
    141
    
    
    142
              Nokogiri::XML::Builder.new(namespace_inheritance: false) do |xml|
    
    3,326✔
    143
                xml.request do
    
    3,326✔
    144
                  xml.service(**args) do
    
    3,326✔
    145
                    yield xml if block_given?
    
    3,326✔
    146
                  end
    
    147
                end
    
    148
              end
    
    149
            end
    
    150
    
    
    151
            # rubocop:disable Metrics/MethodLength
    
    152
            def build_http_request(name:, form_file: nil)
    
    2✔
    153
              request = self.class.build_post_request
    
    1,663✔
    154
    
    
    155
              log_xml_request(xml_payload)
    
    1,663✔
    156
              if form_file.nil?
    
    1,663✔
    157
                request["Content-Type"] = "text/xml; charset=utf-8"
    
    1,663✔
    158
                request.body = xml_payload(name:)
    
    1,663✔
    159
              else
    
    160
                request["Content-Type"] = "multipart/form-data"
    
    ×
    161
                request.set_form({ "request" => xml_payload,
    
    ×
    162
                                   "nb-data-attachments" => "1",
    
    163
                                   "file_0" => form_file },
    
    164
                              "multipart/form-data",
    
    165
                              "charset" => "UTF-8")
    
    166
              end
    
    167
    
    
    168
              request
    
    1,663✔
    169
            end
    
    170
          # rubocop:enable Metrics/MethodLength
    
    171
    
    
    172
          def log_xml_request(xml_payload)
    
    2✔
    173
            password_element = xml_payload.match(/\<password\>.*\<\/password\>/)
    
    1,663✔
    174
            if password_element.nil?
    
    1,663✔
    175
              Rails.logger.debug(xml_payload)
    
    824✔
    176
            else
    
    177
              # Don't log the password
    
    178
              Rails.logger.debug(xml_payload.gsub(password_element.to_s, "<password>***</password>"))
    
    839✔
    179
            end
    
    180
          end
    
    181
        end
    
    182
    end
    
    STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
    ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

    © 2025 Coveralls, Inc