diff --git a/apps/skit/src/auth/handlers.rs b/apps/skit/src/auth/handlers.rs index 0ea4ab3d..5dfbafca 100644 --- a/apps/skit/src/auth/handlers.rs +++ b/apps/skit/src/auth/handlers.rs @@ -27,6 +27,7 @@ use tower::limit::ConcurrencyLimitLayer; const AUTH_MAX_BODY_BYTES: usize = 64 * 1024; const AUTH_MAX_CONCURRENCY: usize = 64; +const RELOAD_KEYS_MAX_CONCURRENCY: usize = 1; /// Request body for login endpoint. #[derive(Debug, Deserialize)] @@ -508,7 +509,8 @@ pub fn auth_router() -> axum::Router> { ) .route( "/reload-keys", - post(reload_keys_handler).layer(ConcurrencyLimitLayer::new(AUTH_MAX_CONCURRENCY)), + post(reload_keys_handler) + .layer(ConcurrencyLimitLayer::new(RELOAD_KEYS_MAX_CONCURRENCY)), ); #[cfg(feature = "moq")] diff --git a/docs/public/registry/plugins/parakeet/0.3.0/manifest.json b/docs/public/registry/plugins/parakeet/0.3.0/manifest.json index ea3af355..be0c2381 100644 --- a/docs/public/registry/plugins/parakeet/0.3.0/manifest.json +++ b/docs/public/registry/plugins/parakeet/0.3.0/manifest.json @@ -8,6 +8,7 @@ "description": "Fast speech-to-text using NVIDIA Parakeet TDT via sherpa-onnx", "license": "MPL-2.0", "homepage": "https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3", + "repository": "https://github.com/streamer45/streamkit", "entrypoint": "libparakeet.so", "bundle": { "url": "https://github.com/streamer45/streamkit/releases/download/plugin-parakeet-v0.3.0/parakeet-0.3.0-bundle.tar.zst", diff --git a/scripts/marketplace/build_registry.py b/scripts/marketplace/build_registry.py index 26f55e6f..b48644bc 100644 --- a/scripts/marketplace/build_registry.py +++ b/scripts/marketplace/build_registry.py @@ -170,7 +170,7 @@ def build_manifest( "license": plugin.get("license"), "license_url": plugin.get("license_url"), "homepage": plugin.get("homepage"), - "repository": plugin.get("repository"), + "repository": plugin.get("repo"), "entrypoint": plugin["entrypoint"], "bundle": bundle_block, "compatibility": plugin.get("compatibility"), diff --git a/scripts/marketplace/check_registry_versions.py b/scripts/marketplace/check_registry_versions.py index 4a228569..ed65c921 100644 --- a/scripts/marketplace/check_registry_versions.py +++ b/scripts/marketplace/check_registry_versions.py @@ -49,7 +49,7 @@ def build_manifest_from_plugin(plugin: dict, bundle_block: dict | None) -> dict: "license": plugin.get("license"), "license_url": plugin.get("license_url"), "homepage": plugin.get("homepage"), - "repository": plugin.get("repository"), + "repository": plugin.get("repo"), "entrypoint": plugin["entrypoint"], "bundle": bundle_block, "compatibility": plugin.get("compatibility"), diff --git a/scripts/marketplace/test_build_registry.py b/scripts/marketplace/test_build_registry.py new file mode 100644 index 00000000..c375473b --- /dev/null +++ b/scripts/marketplace/test_build_registry.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: © 2025 StreamKit Contributors +# SPDX-License-Identifier: MPL-2.0 + +"""Unit tests for build_registry and check_registry_versions manifest builders.""" + +import importlib.util +import pathlib +import sys + +import pytest + +SCRIPTS_DIR = pathlib.Path(__file__).resolve().parent + +# Import build_registry module by path (it has no package structure). +_br_spec = importlib.util.spec_from_file_location( + "build_registry", SCRIPTS_DIR / "build_registry.py" +) +build_registry = importlib.util.module_from_spec(_br_spec) +_br_spec.loader.exec_module(build_registry) + +# Import check_registry_versions module by path. +_cr_spec = importlib.util.spec_from_file_location( + "check_registry_versions", SCRIPTS_DIR / "check_registry_versions.py" +) +check_registry_versions = importlib.util.module_from_spec(_cr_spec) +_cr_spec.loader.exec_module(check_registry_versions) + + +SAMPLE_PLUGIN = { + "id": "test-plugin", + "name": "Test Plugin", + "node_kind": "test_node", + "kind": "native", + "entrypoint": "libtest.so", + "description": "A test plugin", + "license": "MPL-2.0", + "repo": "https://github.com/streamer45/streamkit", +} + + +class TestBuildManifestRepoField: + """Regression tests for #307: plugin.yml uses ``repo`` not ``repository``.""" + + def test_build_manifest_maps_repo_to_repository(self): + manifest = build_registry.build_manifest(SAMPLE_PLUGIN, "1.0.0", bundle_block=None) + assert manifest["repository"] == "https://github.com/streamer45/streamkit" + + def test_check_registry_maps_repo_to_repository(self): + manifest = check_registry_versions.build_manifest_from_plugin( + SAMPLE_PLUGIN, bundle_block=None + ) + assert manifest["repository"] == "https://github.com/streamer45/streamkit" + + def test_build_manifest_omits_repository_when_repo_absent(self): + plugin = {k: v for k, v in SAMPLE_PLUGIN.items() if k != "repo"} + manifest = build_registry.build_manifest(plugin, "1.0.0", bundle_block=None) + assert "repository" not in manifest + + def test_check_registry_omits_repository_when_repo_absent(self): + plugin = {k: v for k, v in SAMPLE_PLUGIN.items() if k != "repo"} + manifest = check_registry_versions.build_manifest_from_plugin(plugin, bundle_block=None) + assert "repository" not in manifest