Skip to content

Commit dad37aa

Browse files
Pass x-roboflow-internal-service-sceret header to calls for new model registry (#2219)
* Pass x-roboflow-internal-service-sceret header to calls for new model registry * Make linters happy --------- Co-authored-by: Grzegorz Klimaszewski <166530809+grzegorz-roboflow@users.noreply.github.com>
1 parent d76f6a0 commit dad37aa

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

inference/core/roboflow_api.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
ROBOFLOW_API_EXTRA_HEADERS,
4848
ROBOFLOW_API_REQUEST_TIMEOUT,
4949
ROBOFLOW_API_VERIFY_SSL,
50+
ROBOFLOW_INTERNAL_SERVICE_SECRET,
5051
ROBOFLOW_SERVICE_SECRET,
5152
SINGLE_TENANT_WORKFLOW_CACHE,
5253
TRANSIENT_ROBOFLOW_API_ERRORS,
@@ -595,6 +596,8 @@ def get_model_metadata_from_inference_models_registry(
595596
)
596597
if not skip:
597598
headers[ENFORCE_CREDITS_VERIFICATION_HEADER] = "true"
599+
if ROBOFLOW_INTERNAL_SERVICE_SECRET:
600+
headers["X-Roboflow-Internal-Service-Secret"] = ROBOFLOW_INTERNAL_SERVICE_SECRET
598601
api_url = _add_params_to_url(
599602
url=f"{API_BASE_URL}/models/v1/external/weights",
600603
params=query,
@@ -1226,6 +1229,8 @@ def get_extra_weights_provider_headers(
12261229
)
12271230
if not skip:
12281231
headers[ENFORCE_CREDITS_VERIFICATION_HEADER] = "true"
1232+
if ROBOFLOW_INTERNAL_SERVICE_SECRET:
1233+
headers["X-Roboflow-Internal-Service-Secret"] = ROBOFLOW_INTERNAL_SERVICE_SECRET
12291234
return build_roboflow_api_headers(explicit_headers=headers)
12301235

12311236

0 commit comments

Comments
 (0)