Skip to content

Commit

Permalink
Fix places expecting arrays where it wasn't explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
martinemde committed Dec 21, 2024
1 parent d5c680c commit 21b38cd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def revoke
return render plain: "Can't fetch public key from GitHub", status: :unauthorized if key.empty_public_key?
return render plain: "Invalid GitHub Signature", status: :unauthorized unless key.valid_github_signature?(signature, request.body.read.chomp)

tokens = params.expect(_json: %i[token type url]).index_by { |t| hashed_key(t.require(:token)) }
tokens = params.expect(_json: [%i[token type url]]).index_by { |t| hashed_key(t.require(:token)) }
api_keys = ApiKey.where(hashed_key: tokens.keys).index_by(&:hashed_key)
resp = tokens.map do |hashed_key, t|
api_key = api_keys[hashed_key]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/notifiers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def update
private

def notifier_params
params.expect(ownerships: %i[push owner ownership_request])
params.expect(ownerships: [%i[push owner ownership_request]])
end

def notifier_options(param)
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/sendgrid_events_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
class SendgridEventsController < ApplicationController
# Safelist documented SendGrid Event attributes
# https://sendgrid.com/docs/API_Reference/Event_Webhook/event.html#-Event-objects
SENDGRID_EVENT_ATTRIBUTES = %i[
SENDGRID_EVENT_ATTRIBUTES = [%i[
email timestamp smtp-id event category sg_event_id sg_message_id reason
status response attempt useragent ip url asm_group_id tls unique_args
marketing_campaign_id marketing_campaign_name pool type
].freeze
]].freeze

skip_before_action :verify_authenticity_token, only: :create

Expand Down

0 comments on commit 21b38cd

Please sign in to comment.