zuora_api 1.7.66 → 1.11.2
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/MIT-LICENSE +20 -0
- data/README.md +9 -0
- data/lib/zuora_api/exceptions.rb +18 -3
- data/lib/zuora_api/login.rb +451 -386
- data/lib/zuora_api/logins/basic.rb +10 -101
- data/lib/zuora_api/logins/oauth.rb +28 -86
- data/lib/zuora_api/version.rb +1 -1
- data/lib/zuora_api.rb +2 -0
- metadata +50 -23
- data/.gitignore +0 -10
- data/.gitlab-ci.yml +0 -63
- data/.rspec +0 -2
- data/.travis.yml +0 -5
- data/CHANGELOG.md +0 -105
- data/Gemfile +0 -4
- data/Gemfile.lock +0 -117
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/zuora_api.gemspec +0 -30
|
@@ -10,113 +10,22 @@ module ZuoraAPI
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def new_session(auth_type: :basic, debug: false, zuora_track_id: nil)
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
super do
|
|
14
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIAuthenticationTypeError.new("Basic Login, does not support Authentication of Type: #{auth_type}") if auth_type != :basic
|
|
15
|
+
raise ZuoraAPI::Exceptions::ZuoraAPIAuthenticationTypeError.new("Request Basic Login but either 'Username' or 'Password' were not passed.") if (self.password.blank? && self.username.blank?)
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
xml['api'].login do
|
|
22
|
-
xml['api'].username self.username
|
|
23
|
-
xml['api'].password self.password
|
|
24
|
-
xml['api'].entityId self.entity_id if !self.entity_id.blank?
|
|
25
|
-
end
|
|
17
|
+
output_xml, input_xml, response = soap_call(timeout_retry: true, skip_session: true, zuora_track_id: zuora_track_id) do |xml|
|
|
18
|
+
xml['api'].login do
|
|
19
|
+
xml['api'].username self.username
|
|
20
|
+
xml['api'].password self.password
|
|
21
|
+
xml['api'].entityId self.entity_id if !self.entity_id.blank?
|
|
26
22
|
end
|
|
27
23
|
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
input_xml = Nokogiri::XML(request.to_xml(:save_with => XML_SAVE_OPTIONS).strip)
|
|
31
|
-
input_xml.xpath('//ns1:session', 'ns1' =>'http://api.zuora.com/').children.remove
|
|
32
|
-
Rails.logger.debug('Connect') {"SOAP XML: #{input_xml.to_xml(:save_with => XML_SAVE_OPTIONS).strip}"} if debug
|
|
33
|
-
|
|
34
|
-
headers = { 'Content-Type' => "text/xml; charset=utf-8" }
|
|
35
|
-
headers['Zuora-Track-Id'] = zuora_track_id if zuora_track_id.present?
|
|
36
24
|
|
|
37
|
-
response_query = HTTParty.post(self.url,:body => request.to_xml(:save_with => XML_SAVE_OPTIONS).strip, :headers => headers, :timeout => 10)
|
|
38
|
-
output_xml = Nokogiri::XML(response_query.body)
|
|
39
|
-
Rails.logger.debug('Connect') {"Response Code: #{response_query.code} SOAP XML: #{output_xml.to_xml(:save_with => XML_SAVE_OPTIONS).strip}"} if debug
|
|
40
|
-
|
|
41
|
-
if !response_query.success?
|
|
42
|
-
self.current_session = nil
|
|
43
|
-
if output_xml.namespaces.size > 0 && output_xml.xpath('//soapenv:Fault').size > 0
|
|
44
|
-
self.current_error = output_xml.xpath('//fns:FaultMessage', 'fns' =>'http://fault.api.zuora.com/').text
|
|
45
|
-
if self.current_error.include?('deactivated')
|
|
46
|
-
self.status = 'Deactivated'
|
|
47
|
-
self.current_error = 'Deactivated user login, please check with Zuora tenant administrator'
|
|
48
|
-
self.errors[:username] = self.current_error
|
|
49
|
-
elsif self.current_error.include?('inactive')
|
|
50
|
-
self.status = 'Inactive'
|
|
51
|
-
self.current_error = 'Inactive user login, please check with Zuora tenant administrator'
|
|
52
|
-
self.errors[:username] = self.current_error
|
|
53
|
-
elsif self.current_error.include?("invalid username or password") || self.current_error.include?("Invalid login. User name and password do not match.")
|
|
54
|
-
self.status = 'Invalid Login'
|
|
55
|
-
self.current_error = 'Invalid login, please check username and password or URL endpoint'
|
|
56
|
-
self.errors[:username] = self.current_error
|
|
57
|
-
self.errors[:password] = self.current_error
|
|
58
|
-
elsif self.current_error.include?('unsupported version')
|
|
59
|
-
self.status = 'Unsupported API Version'
|
|
60
|
-
self.current_error = 'Unsupported API version, please verify URL endpoint'
|
|
61
|
-
self.errors[:url] = self.current_error
|
|
62
|
-
elsif self.current_error.include?('invalid api version')
|
|
63
|
-
self.status = 'Invalid API Version'
|
|
64
|
-
self.current_error = 'Invalid API version, please verify URL endpoint'
|
|
65
|
-
self.errors[:url] = self.current_error
|
|
66
|
-
elsif self.current_error.include?('invalid session')
|
|
67
|
-
self.status = 'Invalid Session'
|
|
68
|
-
self.current_error = 'Session invalid, please update session and verify URL endpoint'
|
|
69
|
-
self.errors[:session] = self.current_error
|
|
70
|
-
elsif self.current_error.include?('Your IP address')
|
|
71
|
-
self.status = 'Restricted IP'
|
|
72
|
-
self.current_error = 'IP restricted, contact Zuora tenant administrator and remove IP restriction'
|
|
73
|
-
self.errors[:base] = self.current_error
|
|
74
|
-
elsif self.current_error.include?('This account has been locked')
|
|
75
|
-
self.status = 'Locked'
|
|
76
|
-
self.current_error = 'Locked user login, please wait or navigate to Zuora to unlock user'
|
|
77
|
-
self.errors[:username] = self.current_error
|
|
78
|
-
elsif self.current_error.include?('Entity not exist:')
|
|
79
|
-
self.status = 'Entity Missing'
|
|
80
|
-
self.errors[:base] = self.current_error
|
|
81
|
-
else
|
|
82
|
-
self.status = 'Unknown'
|
|
83
|
-
self.current_error = output_xml.xpath('//faultstring').text if self.current_error.blank?
|
|
84
|
-
self.errors[:base] = self.current_error
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
else
|
|
88
|
-
self.status = 'Unknown'
|
|
89
|
-
self.current_error = output_xml.xpath('//faultstring').text if self.current_error.blank?
|
|
90
|
-
self.errors[:base] = self.current_error
|
|
91
|
-
end
|
|
92
|
-
else
|
|
93
|
-
#Username & password combo
|
|
94
25
|
retrieved_session = output_xml.xpath('//ns1:Session', 'ns1' =>'http://api.zuora.com/').text
|
|
95
|
-
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("No session found for api call.",
|
|
96
|
-
self.status = 'Active'
|
|
26
|
+
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("No session found for api call.", response) if retrieved_session.blank?
|
|
97
27
|
self.current_session = retrieved_session
|
|
98
|
-
|
|
99
|
-
return self.status
|
|
100
|
-
rescue *(CONNECTION_EXCEPTIONS + CONNECTION_READ_EXCEPTIONS) => ex
|
|
101
|
-
if !tries.zero?
|
|
102
|
-
tries -= 1
|
|
103
|
-
sleep(self.timeout_sleep)
|
|
104
|
-
retry
|
|
105
|
-
else
|
|
106
|
-
if Rails.logger.class.to_s == "Ougai::Logger"
|
|
107
|
-
Rails.logger.error("BasicLogin - Timed out", ex)
|
|
108
|
-
else
|
|
109
|
-
Rails.logger.error("BasicLogin - #{ex.class} Timed out")
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
self.current_error = "Request timed out. Try again"
|
|
113
|
-
self.status = 'Timeout'
|
|
114
|
-
return self.status
|
|
115
|
-
end
|
|
116
|
-
rescue EOFError
|
|
117
|
-
if self.url.match?(/.*services\d{1,}.zuora.com*/)
|
|
118
|
-
self.current_error = "Services tenant '#{self.url.scan(/.*\/\/(services\d{1,}).zuora.com*/).last.first}' is no longer available."
|
|
119
|
-
self.status = 'Not Available'
|
|
28
|
+
self.status = 'Active'
|
|
120
29
|
return self.status
|
|
121
30
|
end
|
|
122
31
|
end
|
|
@@ -12,16 +12,18 @@ module ZuoraAPI
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def new_session(auth_type: nil, zuora_track_id: nil)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
super do
|
|
16
|
+
if auth_type == :bearer
|
|
17
|
+
get_bearer_token(zuora_track_id: zuora_track_id)
|
|
18
|
+
elsif auth_type == :basic
|
|
19
|
+
get_bearer_token(zuora_track_id: zuora_track_id) if self.oauth_expired?
|
|
20
|
+
get_z_session(zuora_track_id: zuora_track_id)
|
|
21
|
+
else
|
|
22
|
+
get_bearer_token(zuora_track_id: zuora_track_id) if self.oauth_expired?
|
|
23
|
+
get_z_session(zuora_track_id: zuora_track_id)
|
|
24
|
+
end
|
|
25
|
+
return self.status
|
|
23
26
|
end
|
|
24
|
-
return self.status
|
|
25
27
|
end
|
|
26
28
|
|
|
27
29
|
def get_active_bearer_token
|
|
@@ -30,59 +32,37 @@ module ZuoraAPI
|
|
|
30
32
|
end
|
|
31
33
|
|
|
32
34
|
def get_z_session(debug: false, zuora_track_id: nil)
|
|
33
|
-
|
|
34
|
-
headers = self.entity_id.present? ? {"Zuora-Entity-Ids" => self.entity_id } : {}
|
|
35
|
+
headers = self.entity_header
|
|
35
36
|
headers['Zuora-Track-Id'] = zuora_track_id if zuora_track_id.present?
|
|
37
|
+
headers['X-Amzn-Trace-Id'] = zuora_track_id if zuora_track_id.present?
|
|
36
38
|
output_json, response = self.rest_call(:url => self.rest_endpoint("connections"), :session_type => :bearer, :headers => headers)
|
|
37
39
|
begin
|
|
38
40
|
self.current_session = response.headers.to_h['set-cookie'][0].split(';')[0].split('=',2)[1].gsub('%3D', '=')
|
|
39
41
|
rescue NoMethodError => ex
|
|
40
|
-
Rails.logger.fatal("Failure Parsing Cookie Headers",
|
|
41
|
-
|
|
42
|
+
Rails.logger.fatal("Failure Parsing Cookie Headers", {
|
|
43
|
+
response: {
|
|
44
|
+
status: response.code,
|
|
45
|
+
params: response.body.to_s,
|
|
46
|
+
headers: response.headers.to_s,
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new("Failure Parsing Cookie Headers", response)
|
|
42
50
|
end
|
|
43
|
-
rescue ZuoraAPI::Exceptions::ZuoraAPISessionError => ex
|
|
44
|
-
if !tries.zero?
|
|
45
|
-
tries -= 1
|
|
46
|
-
Rails.logger.debug {"Session Invalid"}
|
|
47
|
-
self.new_session(auth_type: :bearer)
|
|
48
|
-
retry
|
|
49
|
-
end
|
|
50
|
-
raise ex if errors.include?(ex.class)
|
|
51
|
-
return [output_json, response]
|
|
52
|
-
|
|
53
|
-
rescue ZuoraAPI::Exceptions::ZuoraAPIError, ZuoraAPI::Exceptions::ZuoraAPIRequestLimit, ZuoraAPI::Exceptions::ZuoraAPILockCompetition => ex
|
|
54
|
-
raise ex if errors.include?(ex.class)
|
|
55
|
-
return [output_json, response]
|
|
56
|
-
|
|
57
|
-
rescue *(CONNECTION_EXCEPTIONS + CONNECTION_READ_EXCEPTIONS) => ex
|
|
58
|
-
if !tries.zero?
|
|
59
|
-
tries -= 1
|
|
60
|
-
sleep(self.timeout_sleep)
|
|
61
|
-
retry
|
|
62
|
-
end
|
|
63
|
-
if Rails.logger.class.to_s == "Ougai::Logger"
|
|
64
|
-
Rails.logger.error("OAuthLogin - Timed out", ex)
|
|
65
|
-
else
|
|
66
|
-
Rails.logger.error("OAuthLogin - #{ex.class} Timed out")
|
|
67
|
-
end
|
|
68
|
-
self.current_error = "Request timed out. Try again"
|
|
69
|
-
self.status = 'Timeout'
|
|
70
|
-
return self.status
|
|
71
51
|
end
|
|
72
52
|
|
|
73
53
|
def get_bearer_token(zuora_track_id: nil)
|
|
74
|
-
tries ||= 2
|
|
75
54
|
raise ZuoraAPI::Exceptions::ZuoraAPIAuthenticationTypeError.new("Request Oauth Login but either 'Oauth Client Id' or 'Oauth Secret' were not passed") if self.oauth_client_id.blank? || self.oauth_secret.blank?
|
|
76
55
|
|
|
77
|
-
headers = {
|
|
56
|
+
headers = {"Content-Type" => "application/x-www-form-urlencoded" }
|
|
78
57
|
headers['Zuora-Track-Id'] = zuora_track_id if zuora_track_id.present?
|
|
58
|
+
headers['X-Amzn-Trace-Id'] = zuora_track_id if zuora_track_id.present?
|
|
79
59
|
|
|
80
60
|
output_json, response = self.rest_call(:method => :post,
|
|
81
|
-
:
|
|
82
|
-
:
|
|
83
|
-
:
|
|
84
|
-
:
|
|
85
|
-
:
|
|
61
|
+
url: self.rest_endpoint.chomp('v1/').concat("oauth/token"),
|
|
62
|
+
z_session: false,
|
|
63
|
+
timeout_retry: true,
|
|
64
|
+
headers: headers,
|
|
65
|
+
body: {"client_id"=> self.oauth_client_id, "client_secret"=>self.oauth_secret, "grant_type" =>"client_credentials"}
|
|
86
66
|
)
|
|
87
67
|
|
|
88
68
|
self.bearer_token = output_json["access_token"]
|
|
@@ -92,44 +72,6 @@ module ZuoraAPI
|
|
|
92
72
|
self.status = 'Active'
|
|
93
73
|
|
|
94
74
|
return self.status
|
|
95
|
-
|
|
96
|
-
rescue ZuoraAPI::Exceptions::ZuoraAPIInternalServerError => ex
|
|
97
|
-
raise ex if tries.zero?
|
|
98
|
-
|
|
99
|
-
tries -= 1
|
|
100
|
-
sleep(self.timeout_sleep)
|
|
101
|
-
retry
|
|
102
|
-
rescue ZuoraAPI::Exceptions::ZuoraAPISessionError => ex
|
|
103
|
-
self.bearer_token = nil
|
|
104
|
-
self.oauth_session_expires_at = nil
|
|
105
|
-
self.current_error = ex.message
|
|
106
|
-
case ex.message
|
|
107
|
-
when "Forbidden"
|
|
108
|
-
self.current_error = "The user associated to OAuth credential set has been deactivated."
|
|
109
|
-
self.status = 'Deactivated'
|
|
110
|
-
else
|
|
111
|
-
self.current_error = "Invalid login, please check client ID and Client Secret or URL endpoint"
|
|
112
|
-
self.status = 'Invalid Login'
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
return self.status
|
|
116
|
-
rescue ZuoraAPI::Exceptions::ZuoraAPIError, ZuoraAPI::Exceptions::ZuoraAPIRequestLimit, ZuoraAPI::Exceptions::ZuoraAPILockCompetition => ex
|
|
117
|
-
raise ex
|
|
118
|
-
rescue *(CONNECTION_EXCEPTIONS + CONNECTION_READ_EXCEPTIONS) => ex
|
|
119
|
-
if !tries.zero?
|
|
120
|
-
tries -= 1
|
|
121
|
-
sleep(self.timeout_sleep)
|
|
122
|
-
retry
|
|
123
|
-
else
|
|
124
|
-
if Rails.logger.class.to_s == "Ougai::Logger"
|
|
125
|
-
Rails.logger.error("OAuthLogin - Timed out will retry after #{self.timeout_sleep} seconds", ex)
|
|
126
|
-
else
|
|
127
|
-
Rails.logger.error("OAuthLogin - #{ex.class} Timed out will retry after #{self.timeout_sleep} seconds")
|
|
128
|
-
end
|
|
129
|
-
self.current_error = "Invalid login, please check client ID and Client Secret or URL endpoint"
|
|
130
|
-
self.status = 'Timeout'
|
|
131
|
-
return self.status
|
|
132
|
-
end
|
|
133
75
|
end
|
|
134
76
|
|
|
135
77
|
def oauth_expired?
|
data/lib/zuora_api/version.rb
CHANGED
data/lib/zuora_api.rb
CHANGED
metadata
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zuora_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.11.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Zuora Strategic Solutions Group
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-10-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '0'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - "
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -52,6 +52,20 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '3.0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rspec_junit_formatter
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
55
69
|
- !ruby/object:Gem::Dependency
|
|
56
70
|
name: webmock
|
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -80,6 +94,34 @@ dependencies:
|
|
|
80
94
|
- - ">="
|
|
81
95
|
- !ruby/object:Gem::Version
|
|
82
96
|
version: '0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: simplecov-cobertura
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: ougai
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - ">="
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '0'
|
|
118
|
+
type: :runtime
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '0'
|
|
83
125
|
- !ruby/object:Gem::Dependency
|
|
84
126
|
name: nokogiri
|
|
85
127
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -129,9 +171,6 @@ dependencies:
|
|
|
129
171
|
- - ">="
|
|
130
172
|
- !ruby/object:Gem::Version
|
|
131
173
|
version: 4.1.0
|
|
132
|
-
- - "<"
|
|
133
|
-
- !ruby/object:Gem::Version
|
|
134
|
-
version: '6'
|
|
135
174
|
type: :runtime
|
|
136
175
|
prerelease: false
|
|
137
176
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -139,9 +178,6 @@ dependencies:
|
|
|
139
178
|
- - ">="
|
|
140
179
|
- !ruby/object:Gem::Version
|
|
141
180
|
version: 4.1.0
|
|
142
|
-
- - "<"
|
|
143
|
-
- !ruby/object:Gem::Version
|
|
144
|
-
version: '6'
|
|
145
181
|
description: Gem that provides easy integration to Zuora
|
|
146
182
|
email:
|
|
147
183
|
- connect@zuora.com
|
|
@@ -149,17 +185,9 @@ executables: []
|
|
|
149
185
|
extensions: []
|
|
150
186
|
extra_rdoc_files: []
|
|
151
187
|
files:
|
|
152
|
-
-
|
|
153
|
-
- ".gitlab-ci.yml"
|
|
154
|
-
- ".rspec"
|
|
155
|
-
- ".travis.yml"
|
|
156
|
-
- CHANGELOG.md
|
|
157
|
-
- Gemfile
|
|
158
|
-
- Gemfile.lock
|
|
188
|
+
- MIT-LICENSE
|
|
159
189
|
- README.md
|
|
160
190
|
- Rakefile
|
|
161
|
-
- bin/console
|
|
162
|
-
- bin/setup
|
|
163
191
|
- lib/insights_api/login.rb
|
|
164
192
|
- lib/zuora_api.rb
|
|
165
193
|
- lib/zuora_api/exceptions.rb
|
|
@@ -167,7 +195,6 @@ files:
|
|
|
167
195
|
- lib/zuora_api/logins/basic.rb
|
|
168
196
|
- lib/zuora_api/logins/oauth.rb
|
|
169
197
|
- lib/zuora_api/version.rb
|
|
170
|
-
- zuora_api.gemspec
|
|
171
198
|
homepage: https://connect.zuora.com
|
|
172
199
|
licenses: []
|
|
173
200
|
metadata: {}
|
|
@@ -186,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
186
213
|
- !ruby/object:Gem::Version
|
|
187
214
|
version: '0'
|
|
188
215
|
requirements: []
|
|
189
|
-
rubygems_version: 3.
|
|
216
|
+
rubygems_version: 3.3.7
|
|
190
217
|
signing_key:
|
|
191
218
|
specification_version: 4
|
|
192
219
|
summary: Gem that provides easy integration to Zuora
|
data/.gitignore
DELETED
data/.gitlab-ci.yml
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
image: ruby:2.6
|
|
2
|
-
stages:
|
|
3
|
-
- setup
|
|
4
|
-
- test
|
|
5
|
-
- deploy
|
|
6
|
-
|
|
7
|
-
setup:
|
|
8
|
-
stage: setup
|
|
9
|
-
allow_failure: true
|
|
10
|
-
cache:
|
|
11
|
-
key: gems
|
|
12
|
-
paths:
|
|
13
|
-
- vendor/bundle
|
|
14
|
-
script:
|
|
15
|
-
- apt-get update -qy
|
|
16
|
-
- apt-get install -y nodejs
|
|
17
|
-
- bundle install
|
|
18
|
-
|
|
19
|
-
rubocop-testing:
|
|
20
|
-
stage: test
|
|
21
|
-
allow_failure: true
|
|
22
|
-
script:
|
|
23
|
-
- gem install rubocop
|
|
24
|
-
- rubocop --lint
|
|
25
|
-
|
|
26
|
-
security-testing:
|
|
27
|
-
stage: test
|
|
28
|
-
allow_failure: true
|
|
29
|
-
script:
|
|
30
|
-
- gem install brakeman
|
|
31
|
-
- brakeman
|
|
32
|
-
|
|
33
|
-
rspec-testing:
|
|
34
|
-
stage: test
|
|
35
|
-
script:
|
|
36
|
-
- bundle install
|
|
37
|
-
- rspec
|
|
38
|
-
|
|
39
|
-
rubygems-deploy:
|
|
40
|
-
stage: deploy
|
|
41
|
-
allow_failure: false
|
|
42
|
-
script:
|
|
43
|
-
- echo "deb http://ftp.us.debian.org/debian testing main contrib non-free" >> /etc/apt/sources.list
|
|
44
|
-
- apt-get update
|
|
45
|
-
- apt-get install -y git
|
|
46
|
-
- apt-get clean all
|
|
47
|
-
- gem install dpl
|
|
48
|
-
- if [[ "staging" == $CI_BUILD_REF_SLUG ]];then export VERSION=`git describe --match "[0-9]*\.[0-9]*\.[0-9]*[a-z]" --abbrev=0 --tags HEAD`; fi
|
|
49
|
-
- if [[ "master" == $CI_BUILD_REF_SLUG ]];then export VERSION=`git describe --exclude "[0-9]*\.[0-9]*\.[0-9]*[a-z]" --abbrev=0 --tags HEAD`; fi
|
|
50
|
-
- echo $VERSION
|
|
51
|
-
- sed -i "s/0.0.1/$VERSION/" lib/zuora_api/version.rb
|
|
52
|
-
- git add lib/zuora_api/version.rb
|
|
53
|
-
- git config --global user.email "connect@zuora.com"
|
|
54
|
-
- git config --global user.name "Connect Automation"
|
|
55
|
-
- git commit -m "Automated Version Update $VERSION"
|
|
56
|
-
- bundle install
|
|
57
|
-
- gem install rake
|
|
58
|
-
- version=$(rake install | grep -o 'pkg/zuora_api-.*gem')
|
|
59
|
-
- curl -u $USERNAME:$PASSWORD https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
|
|
60
|
-
- gem push $version
|
|
61
|
-
only:
|
|
62
|
-
- master
|
|
63
|
-
- staging
|
data/.rspec
DELETED
data/.travis.yml
DELETED
data/CHANGELOG.md
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
All notable changes to this project will be documented in this file.
|
|
3
|
-
|
|
4
|
-
## [1.7.07] - 2018-9-10
|
|
5
|
-
### Changed
|
|
6
|
-
- Cookie name for service endpoint integration
|
|
7
|
-
|
|
8
|
-
## [1.7.06] - 2018-8-25
|
|
9
|
-
### Added
|
|
10
|
-
- Retry for 502/503
|
|
11
|
-
- Standard exception for 504
|
|
12
|
-
|
|
13
|
-
## [1.7.05] - 2018-8-25
|
|
14
|
-
### Added
|
|
15
|
-
- Added support for oauth token forbidden
|
|
16
|
-
|
|
17
|
-
## [1.7.02] - 2018-8-23
|
|
18
|
-
### Added
|
|
19
|
-
- Added mulit part support for rest call
|
|
20
|
-
|
|
21
|
-
## [1.7.01] - 2018-8-06
|
|
22
|
-
### Changed
|
|
23
|
-
- Changed library used to determine host
|
|
24
|
-
- Added retry for 504 timouts in file download
|
|
25
|
-
|
|
26
|
-
## [1.7.00] - 2018-8-05
|
|
27
|
-
### Changed
|
|
28
|
-
- Raise proper exception when oauth client is from deactivated user.
|
|
29
|
-
- Support for rails < 6
|
|
30
|
-
|
|
31
|
-
## [1.6.53] - 2018-7-29
|
|
32
|
-
### Changed
|
|
33
|
-
- Don't attempt zsession login if bearer token is bad
|
|
34
|
-
|
|
35
|
-
## [1.6.51 - 1.6.51] - 2018-7-22
|
|
36
|
-
### Changed
|
|
37
|
-
- Retry on address not available.
|
|
38
|
-
|
|
39
|
-
## [1.6.47 - 1.6.48] - 2018-6-26
|
|
40
|
-
### Changed
|
|
41
|
-
- Changed error raise statements when incorrect credentials are supplied to Basic/Oauth Logins
|
|
42
|
-
|
|
43
|
-
## [1.6.45] - 2018-5-30
|
|
44
|
-
### Changed
|
|
45
|
-
- Fix retry so headers are reinstaniated on session failure.
|
|
46
|
-
|
|
47
|
-
## [1.6.41] - 2018-5-30
|
|
48
|
-
### Changed
|
|
49
|
-
- Retry added on SSL connection failure
|
|
50
|
-
|
|
51
|
-
## [1.6.39-1.6.40] - 2018-5-30
|
|
52
|
-
### Changed
|
|
53
|
-
- Added validation to fix bad urls entered into object initialization
|
|
54
|
-
|
|
55
|
-
## [1.6.38] - 2018-5-26
|
|
56
|
-
### Changed
|
|
57
|
-
- HttpParty validation before code extraction
|
|
58
|
-
|
|
59
|
-
## [1.6.37] - 2018-5-23
|
|
60
|
-
### Added
|
|
61
|
-
- Added method to determine rest endpoint domain
|
|
62
|
-
|
|
63
|
-
## [1.6.36] - 2018-5-22
|
|
64
|
-
### Changed
|
|
65
|
-
- Fixed zuora staging 2 endpoint
|
|
66
|
-
|
|
67
|
-
## [1.6.33] - 2018-5-15
|
|
68
|
-
### Changed
|
|
69
|
-
- Added Errno::EHOSTUNREACH to list of retriable error codes
|
|
70
|
-
|
|
71
|
-
## [1.6.32] - 2018-5-14
|
|
72
|
-
### Changed
|
|
73
|
-
- Don't log fatal errors, allow application to decide for file download
|
|
74
|
-
- Don't change api url if the user set a high api url
|
|
75
|
-
|
|
76
|
-
###Removed
|
|
77
|
-
- Force encoding
|
|
78
|
-
|
|
79
|
-
## [1.6.28] - 2018-3-12
|
|
80
|
-
### Added
|
|
81
|
-
- Way to avoid force encoding for filedownload
|
|
82
|
-
|
|
83
|
-
## [1.6.28] - 2018-3-12
|
|
84
|
-
### Added
|
|
85
|
-
- Way to avoid force encoding for filedownload
|
|
86
|
-
|
|
87
|
-
## [1.6.22] - 2019-01-03
|
|
88
|
-
### Changed
|
|
89
|
-
- get_identity method - supports ZSession auth now
|
|
90
|
-
- updated rspecs accordingly
|
|
91
|
-
|
|
92
|
-
## [1.6.18] - 2018-12-06
|
|
93
|
-
### Added
|
|
94
|
-
- zconnect_provider attribute accessor for identifying ZConnect cookies
|
|
95
|
-
- Methods for Hallway integration:
|
|
96
|
-
- get_identity
|
|
97
|
-
- get_full_nav
|
|
98
|
-
- set_nav
|
|
99
|
-
- refresh_nav
|
|
100
|
-
- get_oauth_client
|
|
101
|
-
|
|
102
|
-
### Changed
|
|
103
|
-
- The way environment and region are set
|
|
104
|
-
|
|
105
|
-
|
data/Gemfile
DELETED