Skip to content

Commit fe4bb70

Browse files
LinZiyuuclaude
andcommitted
fix: apply inference restriction to SageMaker MME invoke path
The SageMaker multi-model custom-invoke route (POST /models/{model}/invoke) is dispatched to SageMakerMMEHandleInfer() without checking the inference API restriction. When --http-restricted-api=inference is configured, the standard HTTP infer, the gRPC infer, and the SageMaker /invocations routes all enforce the required header (the last via the inherited HandleInfer), but the MME invoke route runs inference without it. This mirrors the MME model-repository gap closed in #8686, which did not cover the invoke route. Add the existing RETURN_AND_RESPOND_IF_RESTRICTED(req, RestrictedCategory::INFERENCE) guard at the top of the /invoke branch, matching the base HandleInfer/HandleGenerate handlers and the sibling MME repository branches. No behavior change when no inference restriction is set. Signed-off-by: LinZiyuu <linziyu0205@163.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8cb2b77 commit fe4bb70

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/sagemaker_server.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ SagemakerAPIServer::Handle(evhtp_request_t* req)
199199
if (action == "/invoke") {
200200
LOG_VERBOSE(1) << "SageMaker request: INVOKE MODEL";
201201

202+
RETURN_AND_RESPOND_IF_RESTRICTED(
203+
req, RestrictedCategory::INFERENCE);
204+
202205
{
203206
std::lock_guard<std::mutex> lock(models_list_mutex_);
204207
if (sagemaker_models_list_.find(multi_model_name.c_str()) ==

0 commit comments

Comments
 (0)