veracodecli 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbfae178c0940aff20095e2eee1e9b032a77fc12
4
- data.tar.gz: 09cebe5d2b8fdb4b48172558c5c7a5552c85bf1b
3
+ metadata.gz: 6b1eadeb69c56dcd7fba697d4bc871b6fbe8b823
4
+ data.tar.gz: f4d460942b21466b58ae62f487430766bf387daa
5
5
  SHA512:
6
- metadata.gz: 7d1e9b93d8b72aa9e5b5a771efbb5f9ad4e36c0707e55772d1e15c4c9f272f6cd4ca608e5bcebbe05d3ddf3918d401c7540ae0c1a0df7c24c55fe3b06c170768
7
- data.tar.gz: 81a9ddb04a4b9cc81c8c8be8e4a071eb87f4f54826abc9c5d75af0ef9fdb9bd67aa6034634c5c2d747e034dde9e734138c269d83cae44aa5138785e8dde85c93
6
+ metadata.gz: df058a0156daaf9f954c08982e10ede1ecd397ec669eef92e82d7e75a0ec841f49759325ad447cfd65f61e7e55033f27dc6984111201688caf263f53df848643
7
+ data.tar.gz: d8e044ecab2aac57e3fd3addcd5c47e5f5902eff56c15db59e55980d51bae8467879b17b562df0b1384a78816b80d31059528155da2d9edb96187a23f8e48f87
@@ -3,19 +3,27 @@ require 'active_support/core_ext/hash'
3
3
  require 'rest-client'
4
4
  require 'yaml'
5
5
  require_relative 'settings'
6
+ require_relative 'log'
6
7
 
7
8
  module VeracodeApiBase
8
9
  def veracode_api_request(api_call, api_version: '4.0', **params)
9
10
  begin
10
- RestClient.post "https://#{Settings.veracode_username}:#{Settings.veracode_password}@analysiscenter.veracode.com/api/#{api_version}/#{api_call}", { params: params }
11
+ response = RestClient.post "https://#{Settings.veracode_username}:#{Settings.veracode_password}@analysiscenter.veracode.com/api/#{api_version}/#{api_call}", { params: params }
12
+ log = ResponseLogger.new "/home/#{ENV['USER']/veracodecli_data}"
13
+ log.log response.body
11
14
  rescue
12
15
  abort '401: Unauthorized. Veracode API call Failed, please check your veracode credentials or whitelisted IPs'
13
16
  end
17
+ response
14
18
  end
15
19
 
16
20
  def get_repo_archive(url)
17
21
  directory = "/tmp/sast_clone"
18
- `git clone #{url} #{directory}/sast_clone`
22
+ if Dir.exists?(directory)
23
+ `cd #{directory}; git pull`
24
+ else
25
+ `git clone #{url} #{directory}/sast_clone`
26
+ end
19
27
  `cd /tmp; zip -r sast_upload.zip sast_clone`
20
28
  # `git archive --remote #{url} --format=tar -o #{directory}/sast_upload.tar master`
21
29
  end
data/veracodecli.gemspec CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "veracodecli"
9
- s.version = "1.0.4"
9
+ s.version = "1.0.5"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: veracodecli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - isaiah thiessen