torizon_audit 0.0.5 → 0.0.7
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/torizon_audit.rb +11 -10
- 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: 81e7af01773e1433fc7489de22aefafd31c56ad3fb12cca4dd310152ce80026d
|
4
|
+
data.tar.gz: f0a52dd55c34c9d3e8ce31ccda1eb5f897c7bc51b96d7fdc8d784b7ec5b2c5f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f79fd5c4a081a9a118f6750780d9f1b5d678c96c67f1a44d473c90c63c9604de2ebb1ce585548ec4a6f3dc84f0b3822aa04edcda0085178f7ebc252ce25dc723
|
7
|
+
data.tar.gz: 9314b8818b0d597fc72261d4bfca3d9dbf154cb8ff32ce9a84998218f6846b7573f9a9d48c8cc24192ba409556c3edae879c068c95dd3b3de89c0f548d660c7c
|
data/lib/torizon_audit.rb
CHANGED
@@ -24,7 +24,7 @@ class Query
|
|
24
24
|
|
25
25
|
def initialize(maxNumLogs = 10000)
|
26
26
|
@query = {
|
27
|
-
"from" => 0,
|
27
|
+
"from" => 0,
|
28
28
|
"size" => maxNumLogs,
|
29
29
|
"query" => {
|
30
30
|
"bool" => {
|
@@ -80,7 +80,7 @@ end
|
|
80
80
|
class Audit
|
81
81
|
@@actionsMap = {
|
82
82
|
"api/v1/user_repo/targets$" => {"PUT" => "Upload signed targets.json"},
|
83
|
-
"api/v1/user_repo/targets/.*" => {"PUT" => "Create
|
83
|
+
"api/v1/user_repo/targets/.*" => {"PUT" => "Create TUF target", "POST" => "Create TUF target", "PATCH" => "Modify TUF target", "DELETE" => "Delete TUF target"},
|
84
84
|
"api/v1/user_repo/trusted\-delegations/.*/remote/refresh" => {"PUT" => "Refresh remote delegation"},
|
85
85
|
"api/v1/user_repo/trusted\-delegations/.*" => {"PUT" => "Create or modify trusted-delegations"},
|
86
86
|
"api/v1/user_repo/delegations/.*" => {"PUT" => "Create or modify delegation metadata"},
|
@@ -106,14 +106,15 @@ class Audit
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def findAction(method, uri)
|
109
|
-
@@actionsMap.
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
109
|
+
_, m = @@actionsMap.find do |uriPattern, methodActions|
|
110
|
+
uri.match(uriPattern) && methodActions.key?(method)
|
111
|
+
end
|
112
|
+
|
113
|
+
if m.nil?
|
114
|
+
"Unknown Action"
|
115
|
+
else
|
116
|
+
m[method]
|
117
|
+
end
|
117
118
|
end
|
118
119
|
|
119
120
|
def userActions(from, to, namespace, dropUnknownActions = true)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torizon_audit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Clouser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Fetch user actions from torizon platform
|
14
14
|
email: ben.clouser@toradex.com
|