bundler_audit_notifier 0.0.6 → 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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b03380d456fbced6f980ed440aba6dab76c1ff64df758c9c01a027b853dba4fe
|
4
|
+
data.tar.gz: d217dcd33669a7a8c4bf137d41fb7bbc9885dcf37af7f7b3b0c6c86d74d5db1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b1f9056a5307b5e519ffa0356cabc9846362167dcff090859c788752cb2efc782b99aaa5f8a2ea6a6cf906d5ef385d2581d5bc6d9bd8642f55123999e4f9091
|
7
|
+
data.tar.gz: 0e49a1985f9728f9da180045a481b91910f9ed9fb1bd78bc5f73f741e928f565e159845da5ae6d11029d7ceec5f13519064f0539f57204a7933eddce5e0adf4d
|
@@ -1,4 +1,6 @@
|
|
1
1
|
class BundlerAuditIssuesController < ActionController::Base
|
2
|
+
before_action :authenticate, only: [:ignore]
|
3
|
+
|
2
4
|
def ignore
|
3
5
|
@bundler_audit_issue = BundlerAuditIssue.where(token: params[:token]).first
|
4
6
|
@bundler_audit_issue.ignore = true
|
@@ -6,8 +8,23 @@ class BundlerAuditIssuesController < ActionController::Base
|
|
6
8
|
render :ignore
|
7
9
|
end
|
8
10
|
end
|
11
|
+
|
9
12
|
private
|
10
13
|
|
14
|
+
def authenticate
|
15
|
+
if params[:token].present?
|
16
|
+
bundler_audit_issue = BundlerAuditIssue.where(token: params[:token]).first
|
17
|
+
if bundler_audit_issue
|
18
|
+
::Rails.logger.info("Authorized accesss to api for bundler audit issue: #{params[:token]}")
|
19
|
+
return true
|
20
|
+
else
|
21
|
+
::Rails.logger.warn("Unauthorized accesss to api for bundler audit issue: #{params[:token]}")
|
22
|
+
head :unauthorized
|
23
|
+
return false
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
11
28
|
def bundler_audit_issue_params
|
12
29
|
params.require(:bundler_audit_issue).permit(:name, :version, :advisory, :token, :criticality, :url, :title, :solution, :ignore)
|
13
30
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Run this command to generate migration: rails generate bundler_audit_notifier
|
1
|
+
# Run this command to generate migration: rails generate bundler_audit_notifier:bundler_audit_notifier
|
2
2
|
require "rails/generators/active_record"
|
3
3
|
require "rails/generators"
|
4
4
|
module BundlerAuditNotifier
|