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

pulibrary / tigerdata-app / 5205f704-d89d-4c43-8cfa-9e6783edc33a

29 Feb 2024 07:04PM UTC coverage: 60.206% (-29.9%) from 90.092%
5205f704-d89d-4c43-8cfa-9e6783edc33a

push

circleci

jrgriffiniii
Ensuring that the storage usage and storage capacity is retrieved for
Mediaflux Projects and rendered on the "contents" Project View

11 of 34 new or added lines in 4 files covered. (32.35%)

451 existing lines in 34 files now uncovered.

935 of 1553 relevant lines covered (60.21%)

9.47 hits per line

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

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

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

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

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

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

37
      # Authenticates the Mediaflux API using the credentials set within the Rails configuration, and set the token for the API session
38
      # @return [String] the session token generated by the Mediaflux API
39
      def resolve
1✔
UNCOV
40
        @session_token = nil
×
UNCOV
41
        super
×
UNCOV
42
        @session_token = response_session_token
×
43

UNCOV
44
        @http_response
×
45
      end
46

47
      private
1✔
48

49
        def response_session_element
1✔
UNCOV
50
          response_xml.xpath("response/reply/result/session")
×
51
        end
52

53
        def response_session_token
1✔
UNCOV
54
          value = response_session_element.text
×
UNCOV
55
          value.strip
×
56
        end
57

58
        def build_http_request_body(name:)
1✔
UNCOV
59
          super do |xml|
×
UNCOV
60
            xml.args do
×
UNCOV
61
              if @identity_token.nil?
×
UNCOV
62
                xml.domain @domain
×
UNCOV
63
                xml.user @user
×
UNCOV
64
                xml.password @password
×
65
              else
UNCOV
66
                xml.token @identity_token
×
67
              end
68
            end
69
          end
70
        end
71
    end
72
  end
73
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