Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed snyk and semgrep issues #100

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.7.8'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

gem 'rails', '~> 7.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'
Expand Down Expand Up @@ -40,8 +41,10 @@ end

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.

gem 'web-console', '>= 4.2.1'
gem 'listen', '~> 3.9'

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
Expand All @@ -58,3 +61,4 @@ end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'rubocop', '~> 0.89.1'

44 changes: 22 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ GEM
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.8)
bindex (0.8.1)
bootsnap (1.18.3)
msgpack (~> 1.2)
builder (3.2.4)
builder (3.3.0)
byebug (11.1.3)
capybara (3.39.2)
addressable
Expand All @@ -94,12 +94,12 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
concurrent-ruby (1.3.1)
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
crass (1.0.6)
date (3.3.4)
drb (2.2.1)
erubi (1.12.0)
erubi (1.13.0)
faraday (2.8.1)
base64
faraday-net_http (>= 2.0, < 3.1)
Expand All @@ -111,15 +111,15 @@ GEM
graphlient (0.8.0)
faraday (~> 2.0)
graphql-client
graphql (2.3.4)
graphql (2.3.9)
base64
graphql-client (0.22.0)
graphql-client (0.23.0)
activesupport (>= 3.0)
graphql (>= 1.13.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.13.1)
irb (1.14.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jbuilder (2.12.0)
Expand All @@ -140,10 +140,10 @@ GEM
matrix (0.4.2)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.23.1)
minitest (5.24.1)
msgpack (1.7.2)
mutex_m (0.2.0)
net-imap (0.4.12)
net-imap (0.4.14)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -155,17 +155,17 @@ GEM
nio4r (2.7.3)
nokogiri (1.15.6-arm64-darwin)
racc (~> 1.4)
parallel (1.24.0)
parser (3.3.2.0)
parallel (1.25.1)
parser (3.3.4.0)
ast (~> 2.4.1)
racc
psych (5.1.2)
stringio
public_suffix (5.0.5)
public_suffix (5.1.1)
puma (6.4.2)
nio4r (~> 2.0)
racc (1.8.0)
rack (3.0.11)
rack (3.1.7)
rack-proxy (0.7.7)
rack
rack-session (2.0.0)
Expand Down Expand Up @@ -212,10 +212,10 @@ GEM
rdoc (6.7.0)
psych (>= 4.0.0)
regexp_parser (2.9.2)
reline (0.5.8)
reline (0.5.9)
io-console (~> 0.5)
rexml (3.2.8)
strscan (>= 3.0.9)
rexml (3.3.2)
strscan
rubocop (0.89.1)
parallel (~> 1.10)
parser (>= 2.7.1.1)
Expand Down Expand Up @@ -252,16 +252,16 @@ GEM
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.5.0)
sprockets-rails (3.5.1)
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
sqlite3 (1.7.3)
mini_portile2 (~> 2.8.0)
stringio (3.1.0)
stringio (3.1.1)
strscan (3.1.0)
thor (1.3.1)
tilt (2.3.0)
tilt (2.4.0)
timeout (0.4.1)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
Expand All @@ -284,13 +284,13 @@ GEM
railties (>= 5.2)
semantic_range (>= 2.3.0)
webrick (1.8.1)
websocket (1.2.10)
websocket (1.2.11)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.15)
zeitwerk (2.6.16)

PLATFORMS
arm64-darwin-22
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Application controller file
class ApplicationController < ActionController::Base
# Enable CSRF protection
protect_from_forgery with: :exception
# Enable CSRF protection
protect_from_forgery with: :exception
end
3 changes: 1 addition & 2 deletions app/views/products/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
<% all_product.items.each do |product| %>
<li>
<span class="thum-img moreBox blogBox">

<%= image_tag product.featured_image_connection.edges[0].node.url, alt: product.featured_image_connection.edges[0].node.filename %>
</span>


<div class="thumbnail-detail">
<h3><a href="#"><%= product.title %> </a></h3>
</div>
Expand Down
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
config.webpacker.check_yarn_integrity = false

# Show full error reports.
config.consider_all_requests_local = true
config.consider_all_requests_local = false

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
Expand Down
3 changes: 2 additions & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
}

# Show full error reports and disable caching.
config.consider_all_requests_local = false
config.consider_all_requests_local = false

config.action_controller.perform_caching = false
config.cache_store = :null_store

Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
resources :products do
end
get '/', to: redirect('/products')

# Custom error routes
match '/404', to: 'errors#not_found', via: :all
match '/500', to: 'errors#internal_server_error', via: :all

end
Loading