add private endpoint for match reporting
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
module Api
|
||||
module Internal
|
||||
# Base class for endpoints intended for the game-server only (never for
|
||||
# browsers). Authenticated via HMAC of the request body instead of a JWT:
|
||||
# see InternalSignatureService.
|
||||
class BaseController < ApplicationController
|
||||
skip_before_action :authenticate_request!
|
||||
before_action :authenticate_internal_request!
|
||||
|
||||
private
|
||||
|
||||
def authenticate_internal_request!
|
||||
unless InternalSignatureService.valid?(request)
|
||||
render json: { error: "Unauthorized" }, status: :unauthorized
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user