veracodecli 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/veracodecli/api.rb +7 -2
- data/lib/veracodecli/log.rb +2 -1
- 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: 13aaf51ec3dd98078195872eab8c378cc29589ff
|
4
|
+
data.tar.gz: 68a4ba69ec7b596afef5187120d127c4c01e5dee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a5824f88c723ecdfde7792a430576b33752540e93688b04cc4f195617d1edbb07cf5734cdbd5c4632dc7858a7ca5b540ac884b9dcef3bcc499c4384c813e8bd
|
7
|
+
data.tar.gz: f9f86ac0c46e269daea6bcd8bf6804862d678162254f18dd92383dcb27be484ebf974d49a1f587bda576434c3e2ced12eb6f5afaa5d70c4a6304ecc2e093c646
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.8
|
data/lib/veracodecli/api.rb
CHANGED
@@ -10,7 +10,7 @@ module VeracodeApiBase
|
|
10
10
|
begin
|
11
11
|
response = RestClient.post "https://#{Settings.veracode_username}:#{Settings.veracode_password}@analysiscenter.veracode.com/api/#{api_version}/#{api_call}", { params: params }
|
12
12
|
log = ResponseLogger.new "/home/#{ENV['USER']/veracodecli_data}"
|
13
|
-
log.log api_call, response.body
|
13
|
+
log.log api_call, response.code, response.body
|
14
14
|
rescue
|
15
15
|
abort '401: Unauthorized. Veracode API call Failed, please check your veracode credentials or whitelisted IPs'
|
16
16
|
end
|
@@ -45,7 +45,12 @@ module VeracodeApiScan
|
|
45
45
|
|
46
46
|
def create_app_profile(app_name, business_criticality, business_unit, team)
|
47
47
|
create_app_response = veracode_api_request 'createapp.do', app_name: app_name, business_criticality: business_criticality, business_unit: business_unit, teams: team
|
48
|
-
create_app_response.body.scan(/app_id=\"(.+)\" app_name=\"#{app_name}\"/)
|
48
|
+
app_id = create_app_response.body.scan(/app_id=\"(.+)\" app_name=\"#{app_name}\"/)
|
49
|
+
if app_id.emtpy?
|
50
|
+
fail 'createapp failed. Make sure you have supplied the correct parameters.'
|
51
|
+
else
|
52
|
+
app_id[0][0]
|
53
|
+
end
|
49
54
|
end
|
50
55
|
|
51
56
|
def upload_file(app_id, archive_path)
|
data/lib/veracodecli/log.rb
CHANGED
@@ -6,9 +6,10 @@ class ResponseLogger
|
|
6
6
|
@path = log_path
|
7
7
|
end
|
8
8
|
|
9
|
-
def log(call, response)
|
9
|
+
def log(call, code, response)
|
10
10
|
log = File.open "#{@path}/veracodecli.log", 'a+'
|
11
11
|
log.write "#{call} called @ #{timestamp}"
|
12
|
+
log.write "HTTP #{code}"
|
12
13
|
log.write response
|
13
14
|
log.write "\n"
|
14
15
|
log.close
|
data/veracodecli.gemspec
CHANGED