rename(547): the server is grimoire — package, image, DB defaults, backups
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / TypeScript typecheck (push) Successful in 56s
CI & Build / integration (push) Successful in 1m4s
CI & Build / Python tests (push) Successful in 1m55s
CI & Build / Build & push image (push) Successful in 44s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / TypeScript typecheck (push) Successful in 56s
CI & Build / integration (push) Successful in 1m4s
CI & Build / Python tests (push) Successful in 1m55s
CI & Build / Build & push image (push) Successful in 44s
Step 2 of the Scribe -> Grimoire rename. - src/scribe -> src/grimoire, and every import, patch target, module path, hypercorn entry point and `python -m grimoire.restore` with it; pyproject, uv.lock and the frontend package are named grimoire. - Image git.fabledsword.com/bvandeusen/fabledgrimoire; CI's Postgres service runs as grimoire / grimoire_test. - Compose files default the DB user, database and (prod) volume to grimoire, each overridable from .env, so an install created as Scribe keeps its data by setting POSTGRES_USER, POSTGRES_DB and PGDATA_VOLUME. - Backups are written as grimoire-<ts>.tar with format grimoire-backup-tar. Archives named scribe-* with the scribe-backup-tar manifest still restore and are still counted at the destination (folder and S3), with tests. - Exports, the MCP auth realm, the ASGI scope key and the persistent logger carry the new name. Kept on purpose: the secret-sealing key label stays "scribe.secrets.v1", because every stored secret was derived under it. Plugin identity (plugin name, hooks, env vars, .scribe marker, skills) is step 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-10
@@ -4,7 +4,7 @@ from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from scribe.services.api_keys import (
|
||||
from grimoire.services.api_keys import (
|
||||
hash_token,
|
||||
_key_prefix,
|
||||
generate_key,
|
||||
@@ -45,7 +45,7 @@ async def test_create_api_key_returns_full_key():
|
||||
mock_key_obj.id = 1
|
||||
mock_key_obj.to_dict.return_value = {"id": 1, "name": "test", "scope": "read", "key_prefix": "fmcp_xxx"}
|
||||
|
||||
with patch("scribe.services.api_keys.async_session") as mock_session_ctx:
|
||||
with patch("grimoire.services.api_keys.async_session") as mock_session_ctx:
|
||||
mock_session = make_mock_session()
|
||||
mock_session.add = MagicMock()
|
||||
mock_session.commit = AsyncMock()
|
||||
@@ -56,7 +56,7 @@ async def test_create_api_key_returns_full_key():
|
||||
mock_session_ctx.return_value = mock_session
|
||||
|
||||
# Patch the select result
|
||||
with patch("scribe.services.api_keys.ApiKey") as mock_model:
|
||||
with patch("grimoire.services.api_keys.ApiKey") as mock_model:
|
||||
mock_model.return_value = mock_key_obj
|
||||
full_key, key_dict = await create_api_key(user_id=1, name="test", scope="read")
|
||||
|
||||
@@ -65,7 +65,7 @@ async def test_create_api_key_returns_full_key():
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_lookup_key_returns_none_for_unknown():
|
||||
with patch("scribe.services.api_keys.async_session") as mock_session_ctx:
|
||||
with patch("grimoire.services.api_keys.async_session") as mock_session_ctx:
|
||||
mock_session = make_mock_session()
|
||||
mock_result = MagicMock()
|
||||
mock_result.scalars.return_value.first.return_value = None
|
||||
@@ -109,15 +109,15 @@ async def test_read_only_key_blocked_on_post():
|
||||
from quart import jsonify
|
||||
return jsonify({"ok": True})
|
||||
|
||||
from scribe.auth import _check_auth
|
||||
from grimoire.auth import _check_auth
|
||||
wrapped = _check_auth(dummy)
|
||||
|
||||
async with app.test_request_context(
|
||||
"/test", method="POST",
|
||||
headers={"Authorization": "Bearer fmcp_readonly"},
|
||||
):
|
||||
with patch("scribe.auth.lookup_key", AsyncMock(return_value=fake_key)), \
|
||||
patch("scribe.auth.get_user_by_id", AsyncMock(return_value=fake_user)):
|
||||
with patch("grimoire.auth.lookup_key", AsyncMock(return_value=fake_key)), \
|
||||
patch("grimoire.auth.get_user_by_id", AsyncMock(return_value=fake_user)):
|
||||
resp = await wrapped()
|
||||
assert resp[1] == 403
|
||||
|
||||
@@ -146,15 +146,15 @@ async def test_bearer_token_valid_write_key_passes():
|
||||
from quart import jsonify
|
||||
return jsonify({"ok": True})
|
||||
|
||||
from scribe.auth import _check_auth
|
||||
from grimoire.auth import _check_auth
|
||||
wrapped = _check_auth(dummy)
|
||||
|
||||
async with app.test_request_context(
|
||||
"/test", method="POST",
|
||||
headers={"Authorization": "Bearer fmcp_writekey"},
|
||||
):
|
||||
with patch("scribe.auth.lookup_key", AsyncMock(return_value=fake_key)), \
|
||||
patch("scribe.auth.get_user_by_id", AsyncMock(return_value=fake_user)):
|
||||
with patch("grimoire.auth.lookup_key", AsyncMock(return_value=fake_key)), \
|
||||
patch("grimoire.auth.get_user_by_id", AsyncMock(return_value=fake_user)):
|
||||
resp = await wrapped()
|
||||
|
||||
# Should not be a tuple (no error response)
|
||||
|
||||
Reference in New Issue
Block a user