ats 0.1.3 → 0.1.4
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/lib/ats/amp4e/api.rb +13 -5
- data/lib/ats/cli.rb +7 -3
- data/lib/ats/configuration.rb +1 -1
- data/lib/ats/http_api.rb +1 -1
- data/lib/ats/threat_grid/api.rb +13 -5
- data/lib/ats/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e51112c9321e6ed3927f822a200b2ec5482722f62d9b6373f4d5b12cc721a7cc
|
|
4
|
+
data.tar.gz: 0d78ebb5acd77375994b7c9d96fdb2ade67fb0d97c5c550fb643b879c1731e14
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bf31c66e5c7cb1f0b7a57923b4fd9d4e3b8ed1b69dd83f52361b65a1f9f0801fd9cf1362124741268f116512f8c4af635bd275ab99dabc0bcd180fca29694b56
|
|
7
|
+
data.tar.gz: 5e792ed8b04e0b5172fd16e14b413a8ea85ae3fc9ccf8308b94ba4a80a634eba51f380ab53d3f1181eafb2269aa83eb1758c552a3e03bac2d2987bc097f11374
|
data/lib/ats/amp4e/api.rb
CHANGED
|
@@ -44,19 +44,27 @@ module ATS
|
|
|
44
44
|
private
|
|
45
45
|
|
|
46
46
|
def build_uri(relative_url, version:)
|
|
47
|
-
URI.
|
|
47
|
+
URI::Generic.build(host: host, port: port, scheme: scheme, path: "/v#{version}/#{relative_url}")
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
def client_id
|
|
51
|
-
configuration[profile][
|
|
51
|
+
configuration[profile][:amp4e][:client_id]
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def client_secret
|
|
55
|
-
configuration[profile][
|
|
55
|
+
configuration[profile][:amp4e][:client_secret]
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
def
|
|
59
|
-
configuration[profile][
|
|
58
|
+
def host
|
|
59
|
+
configuration[profile][:amp4e][:host]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def scheme
|
|
63
|
+
configuration[profile][:amp4e][:scheme]
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def port
|
|
67
|
+
configuration[profile][:amp4e][:port]
|
|
60
68
|
end
|
|
61
69
|
|
|
62
70
|
def headers
|
data/lib/ats/cli.rb
CHANGED
|
@@ -43,13 +43,17 @@ module ATS
|
|
|
43
43
|
yaml = YAML.dump({
|
|
44
44
|
default: {
|
|
45
45
|
amp4e: {
|
|
46
|
-
api_host: 'https://api.amp.cisco.com',
|
|
47
46
|
client_id: '',
|
|
48
47
|
client_secret: '',
|
|
48
|
+
host: 'api.amp.cisco.com',
|
|
49
|
+
port: 443,
|
|
50
|
+
scheme: 'https',
|
|
49
51
|
},
|
|
50
52
|
threat_grid: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
api_key: '',
|
|
54
|
+
host: 'panacea.threatgrid.com',
|
|
55
|
+
port: 443,
|
|
56
|
+
scheme: 'https',
|
|
53
57
|
},
|
|
54
58
|
}
|
|
55
59
|
})
|
data/lib/ats/configuration.rb
CHANGED
data/lib/ats/http_api.rb
CHANGED
data/lib/ats/threat_grid/api.rb
CHANGED
|
@@ -16,7 +16,7 @@ module ATS
|
|
|
16
16
|
configuration: ATS.configuration
|
|
17
17
|
)
|
|
18
18
|
@http = api
|
|
19
|
-
@profile = profile.
|
|
19
|
+
@profile = profile.to_sym
|
|
20
20
|
@configuration = configuration
|
|
21
21
|
end
|
|
22
22
|
|
|
@@ -53,15 +53,23 @@ module ATS
|
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
def build_uri(relative_url, version:)
|
|
56
|
-
URI.
|
|
56
|
+
URI::Generic.build(host: host, port: port, scheme: scheme, path: "/api/v#{version}/#{relative_url}")
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def api_key
|
|
60
|
-
configuration[profile][
|
|
60
|
+
configuration[profile][:threat_grid][:api_key]
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
def
|
|
64
|
-
configuration[profile][
|
|
63
|
+
def host
|
|
64
|
+
configuration[profile][:threat_grid][:host]
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def scheme
|
|
68
|
+
configuration[profile][:threat_grid][:scheme]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def port
|
|
72
|
+
configuration[profile][:threat_grid][:port]
|
|
65
73
|
end
|
|
66
74
|
end
|
|
67
75
|
end
|
data/lib/ats/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ats
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- mokha
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-03-
|
|
11
|
+
date: 2018-03-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|