threadfix-cli 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 211f70bf2afa9eeb52ed00045e60efb66d579acdd555216be902f7b3aa63a89e
4
- data.tar.gz: b225cc93ac012b25ef8125eb9eb77fc373ba0f342676e05d0e8f9d0ab9618888
3
+ metadata.gz: '08558fa9c18007a5c1708420a69386e483c226e9e8c556186656a8c35fed4894'
4
+ data.tar.gz: 457ddbb710dfbb0c643ea3d32a1b4efac65756dcb63723fc0652bb7d9de56dc9
5
5
  SHA512:
6
- metadata.gz: f813b8519a5fffbb01e9860e8442bbc4593f5bd751f3b51215f9383edf594344220f8bbdfe288fb79a4b82856cc3307f9de33bd9eb9982edc592628fffa97939
7
- data.tar.gz: 2455dfaae7f91fe92809370180d188d7b8c3664b0e0a9fc9bb54ad7b9cc2a04621eb5e46b005eb50af7a0b82f4b83189538244ce70450e4da141da7ead5780eb
6
+ metadata.gz: 3364224b767303147610b18b165fb82c52351311519631a8b47f55be0991b3cbf45d2d3f35a381282c50649e2b373f771f8b3f8da3a72dec4d1c26e3b7ed08c4
7
+ data.tar.gz: 811b5d28d26cf75c7d9097dadea7be57028537af3ec1df72aa445675422d05e08b305373ae5cdfca2731166110b2091c4397837b554d20676004524f6cc30531
@@ -1,5 +1,5 @@
1
1
  module Threadfix
2
2
  module Cli
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
@@ -3,7 +3,7 @@ module Threadfix
3
3
  module Applications
4
4
  class GetId
5
5
  # https://denimgroup.atlassian.net/wiki/spaces/TDOC/pages/664567813/List+Applications+-+API
6
- API_VERSION='2.7.5'
6
+ API_VERSION='v2.7.5'
7
7
 
8
8
  attr_reader :app_name
9
9
 
@@ -13,6 +13,7 @@ module Threadfix
13
13
 
14
14
  def perform!
15
15
  begin
16
+ puts "GET #{endpoint.to_s}" if ENV['DEBUG']
16
17
  r = RestClient.get(
17
18
  endpoint.to_s,
18
19
  { :accept => "application/json", :Authorization => "APIKEY #{apiKey}" }
@@ -21,15 +22,17 @@ module Threadfix
21
22
 
22
23
  begin
23
24
  body.fetch('object')
24
- .find{ |a| a.fetch('name') == app_name}.fetch('id')
25
+ .find{ |a| a.fetch('name').downcase == app_name.downcase}.fetch('id')
25
26
  rescue => e
26
27
  puts "App '#{app_name}' was not found."
27
28
  nil # return nil if data not found
28
29
  end
29
30
  rescue RestClient::NotFound => e
30
31
  puts "Endpoint not found (using API version: #{API_VERSION})"
32
+ puts e.message if ENG['DEBUG']
31
33
  raise e
32
34
  rescue RestClient::ExceptionWithResponse => e
35
+ puts e.message if ENG['DEBUG']
33
36
  raise e
34
37
  end
35
38
  end
@@ -2,7 +2,7 @@ module Threadfix
2
2
  module Client
3
3
  module Applications
4
4
  class Lookup
5
- API_VERSION='2.5.0.2'
5
+ API_VERSION='v2.5.0.2'
6
6
 
7
7
  attr_reader :team_name, :app_name
8
8
 
@@ -13,6 +13,7 @@ module Threadfix
13
13
 
14
14
  def perform!
15
15
  begin
16
+ puts "GET #{endpoint.to_s}" if ENV['DEBUG']
16
17
  r = RestClient.get(
17
18
  endpoint.to_s,
18
19
  { :accept => "application/json", :Authorization => "APIKEY #{apiKey}" }
@@ -6,7 +6,7 @@ module Threadfix
6
6
  module Client
7
7
  module Scans
8
8
  class Upload
9
- API_VERSION='2.5'
9
+ API_VERSION='v2.5'
10
10
  attr_reader :file_path, :app_id
11
11
 
12
12
  def initialize(options={})
@@ -16,6 +16,7 @@ module Threadfix
16
16
 
17
17
  def perform!
18
18
  begin
19
+ puts "POST #{endpoint.to_s}" if ENV['DEBUG']
19
20
  r = RestClient.post(
20
21
  endpoint.to_s,
21
22
  { file: file },
@@ -26,6 +27,7 @@ module Threadfix
26
27
  puts "Endpoint not found (using API version: #{API_VERSION})"
27
28
  raise e
28
29
  rescue RestClient::ExceptionWithResponse => e
30
+ puts e.message
29
31
  raise e
30
32
  end
31
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: threadfix-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Elliott
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-05 00:00:00.000000000 Z
11
+ date: 2022-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor