add private endpoint for match reporting

This commit is contained in:
2026-11-09 23:17:55 +03:00
parent f0616c7c51
commit dcb76fa570
11 changed files with 738 additions and 4 deletions
@@ -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