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

pulibrary / tigerdata-app / 7efe1a86-aa29-4caa-b857-e235c8c3959f

22 Nov 2025 01:36AM UTC coverage: 40.628% (-50.7%) from 91.317%
7efe1a86-aa29-4caa-b857-e235c8c3959f

Pull #2234

circleci

carolyncole
Close the custom storage div when a user chooses a preset option
fixes #2115
Pull Request #2234: Close the custom storage div when a user chooses a preset option

1487 of 3660 relevant lines covered (40.63%)

52.24 hits per line

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

92.31
/app/models/mediaflux/logon_request.rb
1
# frozen_string_literal: true
2
module Mediaflux
1✔
3
  class LogonRequest < Request
1✔
4
    # Specifies the logon service within the Mediaflux API
5
    # @return [String]
6
    def self.service
1✔
7
      "system.logon"
608✔
8
    end
9

10
    # Specifies the user domain for the Mediaflux API authentication
11
    # @return [String]
12
    def self.mediaflux_domain
1✔
13
      mediaflux["api_domain"]
304✔
14
    end
15

16
    # Specifies the user for the Mediaflux API authentication
17
    # @return [String]
18
    def self.mediaflux_user
1✔
19
      mediaflux["api_user"]
304✔
20
    end
21

22
    # Specifies the password for the Mediaflux API authentication
23
    # @return [String]
24
    def self.mediaflux_password
1✔
25
      mediaflux["api_password"]
304✔
26
    end
27

28
    def initialize(domain: self.class.mediaflux_domain, user: self.class.mediaflux_user, password: self.class.mediaflux_password, identity_token: nil, token_type: nil)
1✔
29
      @domain = domain
304✔
30
      @user = user
304✔
31
      @password = password
304✔
32
      @identity_token = identity_token
304✔
33
      @token_type = token_type
304✔
34
      super()
304✔
35
    end
36

37
    # Authenticates the Mediaflux API using the credentials set within the Rails configuration,
38
    # and set the token for the API session if the request has not already been resolved
39
    # @return [String] the session token generated by the Mediaflux API
40
    def session_token
1✔
41
      @session_token ||= response_session_token
304✔
42
    end
43

44
    private
1✔
45

46
      class << self
1✔
47
        # The Rails configuration options specifying the Mediaflux server
48
        # @return [Hash]
49
        def mediaflux
1✔
50
          Rails.configuration.mediaflux
912✔
51
        end
52
      end
53

54
      def response_session_element
1✔
55
        response_xml.xpath("response/reply/result/session")
304✔
56
      end
57

58
      def response_session_token
1✔
59
        value = response_session_element.text
304✔
60
        value.strip
304✔
61
      end
62

63
      def build_http_request_body(name:)
1✔
64
        super do |xml|
608✔
65
          xml.args do
608✔
66
            if @identity_token.nil?
608✔
67
              xml.domain @domain
608✔
68
              xml.user @user
608✔
69
              xml.password @password
608✔
70
            else
71
              xml.token do
×
72
                xml.parent.set_attribute("type", @token_type) if @token_type
×
73
                xml.text(@identity_token)
×
74
              end
75
            end
76
            # Include the "app" parameter in the login information.
77
            # This information shows when analyzing sessions via `system.session.all.describe`
78
            # but sadly it does NOT show when running `licence.holder.list`
79
            xml.app "TDWEB"
608✔
80
          end
81
        end
82
      end
83
  end
84
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