Tidy up homepage and navigation
This commit is contained in:
@@ -4,17 +4,16 @@ class Api::EventsController < ApplicationController
|
||||
skip_before_action :verify_authenticity_token
|
||||
allow_unauthenticated_access # Skip normal session auth, use DSN auth instead
|
||||
|
||||
# POST /api/:project_id/events
|
||||
# POST /api/events
|
||||
def create
|
||||
project = authenticate_project!
|
||||
return head :not_found unless project
|
||||
dsn = authenticate_dsn!
|
||||
return head :not_found unless dsn
|
||||
|
||||
# Parse the incoming WAF event data
|
||||
event_data = parse_event_data(request)
|
||||
|
||||
# Create event asynchronously
|
||||
ProcessWafEventJob.perform_later(
|
||||
project_id: project.id,
|
||||
event_data: event_data,
|
||||
headers: extract_serializable_headers(request)
|
||||
)
|
||||
@@ -64,8 +63,8 @@ class Api::EventsController < ApplicationController
|
||||
|
||||
private
|
||||
|
||||
def authenticate_project!
|
||||
DsnAuthenticationService.authenticate(request, params[:project_id])
|
||||
def authenticate_dsn!
|
||||
DsnAuthenticationService.authenticate(request)
|
||||
end
|
||||
|
||||
def parse_event_data(request)
|
||||
|
||||
Reference in New Issue
Block a user