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 +4 -4
- data/lib/veracodecli/api.rb +10 -2
- data/veracodecli.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b1eadeb69c56dcd7fba697d4bc871b6fbe8b823
|
4
|
+
data.tar.gz: f4d460942b21466b58ae62f487430766bf387daa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df058a0156daaf9f954c08982e10ede1ecd397ec669eef92e82d7e75a0ec841f49759325ad447cfd65f61e7e55033f27dc6984111201688caf263f53df848643
|
7
|
+
data.tar.gz: d8e044ecab2aac57e3fd3addcd5c47e5f5902eff56c15db59e55980d51bae8467879b17b562df0b1384a78816b80d31059528155da2d9edb96187a23f8e48f87
|
data/lib/veracodecli/api.rb
CHANGED
@@ -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
|
-
|
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