mihari 7.5.0 → 7.6.0

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
  SHA256:
3
- metadata.gz: 71b5cf7cdeb320c813848b90973908a3999c839f742b9307ae819c1fbf20829b
4
- data.tar.gz: 18b06e35086d2888016d6d1fd7a61c9e62f72e31f6a384e0c1a96f4fde8ab592
3
+ metadata.gz: aa05d5cca592eb276667bc95e7c7a88c12be39bb547ffb4f3bac810f9e5a72a6
4
+ data.tar.gz: 81a9a73171dbb4c5171893cb23cc47963fcfef38d441cfebd37005e6e6dc6202
5
5
  SHA512:
6
- metadata.gz: 2861d810f7ade8e177fd343e706c55a4ef64f734c3f19ae324a58d29c2992b3a11ccc8ad6d6735dff9831b15ce552305e3981c72b9326d55b83f621154f9d2f9
7
- data.tar.gz: edf9f41d660252298cb5909eec731a6ca39968eab5d73c3d6eca3d55f8b452337ee22898427e9165312881058f6e2ba474d6f548aac922431c1b483b7a9c9746
6
+ metadata.gz: d6623c5441e14cf967987c2341349e9973922fdb18dc5d9c3473bcc8fbc7aaf813f9a48c8384331e49a4ada370ebd270d3cd68cbc7dcc6481f1bb886b0923109
7
+ data.tar.gz: 0d112b4740054b7afe79effff48016b8549bf6ef45b337ba43b44fba13f162f7cc8b5f2bfe653bfacf4bb356c2f1b32c7a5964be174d028b877372d642aedfea
data/Rakefile CHANGED
@@ -55,17 +55,21 @@ namespace :build do
55
55
 
56
56
  puts "Swagger doc is built in #{elapsed}s"
57
57
  end
58
+
59
+ desc "Build frontend assets"
60
+ task :frontend do
61
+ # Build frontend assets
62
+ sh "cd frontend && npm install && npm run docs && npm run build-only"
63
+ # Copy built assets into ./lib/web/public/
64
+ sh "rm -rf ./lib/mihari/web/public/"
65
+ sh "mkdir -p ./lib/mihari/web/public/"
66
+ sh "cp -r frontend/dist/* ./lib/mihari/web/public"
67
+ end
58
68
  end
59
69
 
60
70
  task :build do
61
71
  Rake::Task["build:swagger"].invoke
62
-
63
- # Build ReDocs docs & frontend assets
64
- sh "cd frontend && npm install && npm run docs && npm run build-only"
65
- # Copy built assets into ./lib/web/public/
66
- sh "rm -rf ./lib/mihari/web/public/"
67
- sh "mkdir -p ./lib/mihari/web/public/"
68
- sh "cp -r frontend/dist/* ./lib/mihari/web/public"
72
+ Rake::Task["build:frontend"].invoke
69
73
  end
70
74
 
71
75
  # require it later enables doing pre-build step (= build the frontend app)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "7.5.0"
4
+ VERSION = "7.6.0"
5
5
  end
@@ -52,7 +52,7 @@ module Mihari
52
52
  end
53
53
 
54
54
  desc "Delete an alert", {
55
- success: {code: 204, model: Entities::Message},
55
+ success: {code: 204},
56
56
  failure: [{code: 404, model: Entities::ErrorMessage}],
57
57
  summary: "Delete an alert"
58
58
  }
@@ -60,11 +60,9 @@ module Mihari
60
60
  requires :id, type: Integer
61
61
  end
62
62
  delete "/:id" do
63
- status 204
64
-
65
63
  id = params["id"].to_i
66
64
  result = Services::AlertDestroyer.result(id)
67
- return present({message: ""}, with: Entities::Message) if result.success?
65
+ return if result.success?
68
66
 
69
67
  case result.failure
70
68
  when ActiveRecord::RecordNotFound
@@ -87,7 +87,7 @@ module Mihari
87
87
  end
88
88
 
89
89
  desc "Delete an artifact", {
90
- success: {code: 204, model: Entities::Message},
90
+ success: {code: 204},
91
91
  failure: [{code: 404, model: Entities::ErrorMessage}],
92
92
  summary: "Delete an artifact"
93
93
  }
@@ -99,7 +99,7 @@ module Mihari
99
99
 
100
100
  id = params["id"].to_i
101
101
  result = Services::ArtifactDestroyer.result(id)
102
- return present({message: ""}, with: Entities::Message) if result.success?
102
+ return if result.success?
103
103
 
104
104
  case result.failure
105
105
  when ActiveRecord::RecordNotFound
@@ -15,12 +15,7 @@ module Mihari
15
15
  }
16
16
  get "/" do
17
17
  configs = Services::ConfigSearcher.call
18
- present(
19
- {
20
- results: configs
21
- },
22
- with: Entities::Configs
23
- )
18
+ present({results: configs}, with: Entities::Configs)
24
19
  end
25
20
  end
26
21
  end
@@ -167,7 +167,7 @@ module Mihari
167
167
  end
168
168
 
169
169
  desc "Delete a rule", {
170
- success: {code: 204, model: Entities::Message},
170
+ success: {code: 204},
171
171
  failure: [{code: 404, model: Entities::ErrorMessage}],
172
172
  summary: "Delete a rule"
173
173
  }
@@ -179,7 +179,7 @@ module Mihari
179
179
 
180
180
  id = params[:id].to_s
181
181
  result = Services::RuleDestroyer.result(id)
182
- return present({message: "ID:#{id} is deleted"}, with: Entities::Message) if result.success?
182
+ return if result.success?
183
183
 
184
184
  case result.failure
185
185
  when ActiveRecord::RecordNotFound
@@ -32,7 +32,7 @@ module Mihari
32
32
  end
33
33
 
34
34
  desc "Delete a tag", {
35
- success: {code: 204, model: Entities::Message},
35
+ success: {code: 204},
36
36
  failure: [{code: 404, model: Entities::ErrorMessage}],
37
37
  summary: "Delete a tag"
38
38
  }
@@ -44,7 +44,7 @@ module Mihari
44
44
 
45
45
  id = params[:id].to_i
46
46
  result = Services::TagDestroyer.result(id)
47
- return present({message: ""}, with: Entities::Message) if result.success?
47
+ return if result.success?
48
48
 
49
49
  case result.failure
50
50
  when ActiveRecord::RecordNotFound