small adjustment to the way the inthewild_cve_exploits earliest_report data is stored
This commit is contained in:
parent
b439d4fc60
commit
c152086fad
4 changed files with 9 additions and 5 deletions
|
@ -1,10 +1,11 @@
|
|||
class InthewildCveExploitsController < ApplicationController
|
||||
def index
|
||||
@cves = InthewildCveExploit.all
|
||||
render json: @cves.to_json
|
||||
end
|
||||
|
||||
def show
|
||||
@cve = InthewildCveExploit.find_by(:id => params[:cve_id])
|
||||
render json: @poc.to_json
|
||||
@cve = InthewildCveExploit.find_by(:cve_id => params[:cve_id])
|
||||
render json: @cve.to_json
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,5 +11,6 @@ Rails.application.routes.draw do
|
|||
get "/github_pocs/:id", to: "github_pocs#show"
|
||||
get "/github_pocs/cve/:cve_id", to: "github_pocs#show_for_cve"
|
||||
|
||||
get "inthewild/cve/:cve_id", to: "inthewild_exploitations#show"
|
||||
get "/inthewild_cve_exploits", to: "inthewild_cve_exploits#index"
|
||||
get "/inthewild_cve_exploits/:cve_id", to: "inthewild_cve_exploits#show"
|
||||
end
|
||||
|
|
|
@ -2,7 +2,9 @@ class InthewildCveExploits < ActiveRecord::Migration[7.0]
|
|||
def change
|
||||
create_table :inthewild_cve_exploits do |t|
|
||||
t.string :cve_id
|
||||
t.date :earliest_report
|
||||
# i think maybe making a string is better for now for the earliestReport data
|
||||
t.string :earliest_report
|
||||
#t.date :earliest_report
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -66,7 +66,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_04_06_064613) do
|
|||
|
||||
create_table "inthewild_cve_exploits", force: :cascade do |t|
|
||||
t.string "cve_id"
|
||||
t.date "earliest_report"
|
||||
t.string "earliest_report"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue