gramps-webapi 3.25.1__tar.gz → 3.25.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/PKG-INFO +1 -1
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/_version.py +1 -1
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/__init__.py +12 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/cache.py +14 -1
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/file.py +8 -5
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/image.py +6 -4
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/llm/__init__.py +8 -3
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/llm/tools.py +5 -3
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/media.py +4 -4
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/citations.py +1 -1
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/dna.py +7 -2
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/s3.py +2 -2
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/search/text.py +3 -1
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/util/celery.py +25 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi.egg-info/PKG-INFO +1 -1
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi.egg-info/SOURCES.txt +1 -0
- gramps_webapi-3.25.2/tests/test_celery_logging.py +53 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_etag.py +11 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_file.py +10 -1
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_post.py +26 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_search_text.py +9 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.devcontainer/Dockerfile +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.devcontainer/devcontainer.json +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.devcontainer/docker-compose.yml +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.dockerignore +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.editorconfig +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.flake8 +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.github/workflows/base-image-pr.yml +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.github/workflows/base-image.yml +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.github/workflows/image.yml +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.github/workflows/pypi.yml +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.github/workflows/test.yml +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.gitignore +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.pre-commit-config.yaml +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.pylintrc +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.vscode/extensions.json +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.vscode/launch.json +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.vscode/settings.json +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/.vscode/tasks.json +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/AGENTS.md +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/CLAUDE.md +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/CODE_OF_CONDUCT.md +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/CONTRIBUTING.md +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/Dockerfile +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/Dockerfile.base +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/LICENSE +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/MANIFEST.in +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/README.md +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/ROADMAP.md +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic.ini +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/README +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/env.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/script.py.mako +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/2082445b0769_add_oidc_accounts_table_for_secure_.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/22c8d1fba959_add_trees_enabled.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/4b7f9d2e6c01_add_web_push_subscriptions.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/66e56620891a_add_trees_table.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/6d8f3cb50b71_add_persistent_access_tokens_table.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/7b2e9f4c1a63_allow_several_access_tokens_per_scope.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/84960b7d968c_use_bigint_for_quota_media.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/9c4d2e7a5b18_track_task_lifecycle.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/a8e57fe0d82e_add_columns_for_ai_quota.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/b0582f54029c_use_bigint_for_usage_media.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/b2c3d4e5f6a7_add_tree_config_column.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/b6f1d3a9c2e4_add_token_version_to_user.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/c1d2e3f4a5b6_merge_task_tree_and_tree_config.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/c89728e71264_.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/d4e9a1c7b3f2_drop_unique_constraint_on_user_email.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/e176543c72a8_add_tree_column_to_user.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/e5e738d09fa7_added_configuration_table.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/f3a1c8e92b47_add_task_tree_table.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/docker-entrypoint.sh +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/__init__.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/__main__.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/access/__init__.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/access/db.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/access/policy.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/access/sanitize.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/auth.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/backup.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/backup_store.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/blueprint.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/check.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/deprecations.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/dna.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/emails.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/export.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/faces.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/html.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/llm/agent.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/llm/deps.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/llm/render.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/media_importer.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/people_families_cache.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/ratelimiter.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/report.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/__init__.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/access_tokens.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/anniversaries.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/backups.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/base.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/bookmarks.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/chat.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/config.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/db_backend.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/delete.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/emit.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/events.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/export_media.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/exporters.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/face_detection.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/facts.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/families.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/file.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/filter_param_types.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/filters.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/history.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/holidays.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/import_media.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/importers.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/living.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/match.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/media.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/merge.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/metadata.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/name_formats.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/name_groups.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/notes.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/object_query.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/objects.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/ocr.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/oidc.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/oidc_accounts.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/people.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/places.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/push_subscriptions.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/relations.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/reports.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/repositories.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/restore.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/schemas.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/search.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/sort.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/sources.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/tags.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/tasks.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/timeline.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/token.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/transactions.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/translations.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/trees.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/types.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/user.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/util.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/verify.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/resources/ydna.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/search/__init__.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/search/indexer.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/search/query.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/search/schema.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/snapshot.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/tasks.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/telemetry.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/api/util.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/app.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/auth/__init__.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/auth/const.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/auth/oidc.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/auth/oidc_helpers.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/auth/passwords.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/auth/sql_guid.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/celery.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/config.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/const.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/data/empty_gramps_auth.cfg +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/data/example_gramps_auth.cfg +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/data/face_detection_yunet_2023mar.onnx +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/data/test_auth.cfg +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/dbloader.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/dbmanager.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/future_gramps/__init__.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/future_gramps/alive.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/future_gramps/relationship.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/logging_utils.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/profiler.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/sentry.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/static/index.html +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/templates/confirmation.html +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/templates/reset_password.html +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/templates/reset_password_base.html +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/templates/reset_password_error.html +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/translogger.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/types.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/undodb.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/util/__init__.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/util/task_state.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/verify_lib.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/webpush.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi/wsgi.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi.egg-info/dependency_links.txt +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi.egg-info/requires.txt +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/gramps_webapi.egg-info/top_level.txt +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/mypy.ini +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/pyproject.toml +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/requirements-dev.txt +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/scripts/s3_rename.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/scripts/search_benchmark.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/scripts/start_dev_container.sh +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/setup.cfg +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/setup.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/__init__.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/conftest.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_access.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_check.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_cli.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_close_db.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_db.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_delete.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_deprecations.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_dna_match_parser.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/__init__.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/checks.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_access_tokens.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_anniversaries_ics.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_backups.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_bookmarks.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_chat.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_citations.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_config.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_db_handle.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_delete.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_dna.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_events.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_exporters.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_facts.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_families.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_filters.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_history.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_holidays.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_import_media.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_importers.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_list_paging.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_living.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_media.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_media_archive.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_media_usage_sync.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_merge.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_metadata.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_name_formats.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_name_groups.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_notes.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_object_query.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_object_query_where_tree.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_ocr.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_oidc.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_oidc_accounts.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_oidc_link.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_paging_sort.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_people.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_people_query.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_place_coordinates.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_places.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_profiler.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_push_subscriptions.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_put.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_ready.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_relations.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_repair.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_reports.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_repositories.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_restore.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_s3.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_search.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_sources.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_tags.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_tasks.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_timelines.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_token.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_token_revocation.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_token_sync.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_transactions.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_translations.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_treeless_admin.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_trees.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_types.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_upload.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_user.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_verify.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_webpush_delivery.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/test_ydna.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_endpoints/util.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_face_detection.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_file.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_future_gramps_alive.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_future_gramps_relationship.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_image.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_import_util.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_jwt.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_limiter.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_llm_agent.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_llm_errors.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_llm_history.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_llm_render.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_llm_tools.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_logging_utils.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_map_tile.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_media_importer.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_media_prefix_tree.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_migrate_grampsdb.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_missing_references.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_object_query_parsing.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_oidc_auth.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_openapi_operation_ids.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_password.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_postgres_driver.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_privacy_canary.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_private_proxy.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_private_proxy_backlinks.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_s3.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_search_api_updates.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_search_index.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_search_oracle.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_sentry.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_server_locale.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_shared_postgresql.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_snapshot.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_sort_raw_data.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_sort_sql.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_sqlauth.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_static_files.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_task_error.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_task_state.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_tasks.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_telemetry.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_undodb.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_user_db_migration.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_util.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_verify_lib.py +0 -0
- {gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/tests/test_version.py +0 -0
|
@@ -1033,6 +1033,16 @@ def get_thumbnail(args, handle, size):
|
|
|
1033
1033
|
return handler.send_thumbnail(size=size, square=args["square"])
|
|
1034
1034
|
|
|
1035
1035
|
|
|
1036
|
+
def _abort_if_invalid_crop(x1: int, y1: int, x2: int, y2: int) -> None:
|
|
1037
|
+
"""Abort unless the crop region (in percent) lies within the image.
|
|
1038
|
+
|
|
1039
|
+
Pillow pads crops outside the image, so unchecked coordinates could
|
|
1040
|
+
allocate an arbitrarily large image.
|
|
1041
|
+
"""
|
|
1042
|
+
if not (0 <= x1 < x2 <= 100 and 0 <= y1 < y2 <= 100):
|
|
1043
|
+
abort_with_message(400, "Crop region must lie within 0 and 100 percent")
|
|
1044
|
+
|
|
1045
|
+
|
|
1036
1046
|
@api_blueprint.route(
|
|
1037
1047
|
"/media/<string:handle>/cropped/<int:x1>/<int:y1>/<int:x2>/<int:y2>"
|
|
1038
1048
|
)
|
|
@@ -1049,6 +1059,7 @@ def get_thumbnail(args, handle, size):
|
|
|
1049
1059
|
@thumbnail_cache_decorator
|
|
1050
1060
|
def get_cropped(args, handle: str, x1: int, y1: int, x2: int, y2: int):
|
|
1051
1061
|
"""Get the thumbnail of a cropped file."""
|
|
1062
|
+
_abort_if_invalid_crop(x1, y1, x2, y2)
|
|
1052
1063
|
tree = get_tree_from_jwt()
|
|
1053
1064
|
db_handle = get_db_handle()
|
|
1054
1065
|
handler = get_media_handler(db_handle, tree=tree).get_file_handler(
|
|
@@ -1075,6 +1086,7 @@ def get_thumbnail_cropped(
|
|
|
1075
1086
|
args, handle: str, x1: int, y1: int, x2: int, y2: int, size: int
|
|
1076
1087
|
):
|
|
1077
1088
|
"""Get the thumbnail of a cropped file."""
|
|
1089
|
+
_abort_if_invalid_crop(x1, y1, x2, y2)
|
|
1078
1090
|
tree = get_tree_from_jwt()
|
|
1079
1091
|
db_handle = get_db_handle()
|
|
1080
1092
|
handler = get_media_handler(db_handle, tree=tree).get_file_handler(
|
|
@@ -141,8 +141,21 @@ def skip_cache_missing_media(*args, **kwargs) -> bool:
|
|
|
141
141
|
return g.cached_media is None
|
|
142
142
|
|
|
143
143
|
|
|
144
|
+
def is_cacheable_response(rv) -> bool:
|
|
145
|
+
"""Only cache successful responses.
|
|
146
|
+
|
|
147
|
+
Since Flask-Caching 2.5.0, an exception raised by `abort()` is cached as
|
|
148
|
+
well. An error can depend on the server rather than the tree (e.g. an addon
|
|
149
|
+
that isn't installed yet), so it must not be served until the tree changes.
|
|
150
|
+
The view may return something other than a `Response`, e.g. a string.
|
|
151
|
+
"""
|
|
152
|
+
return getattr(rv, "status_code", 200) < 400
|
|
153
|
+
|
|
154
|
+
|
|
144
155
|
_request_cached = request_cache.cached(
|
|
145
|
-
make_cache_key=make_cache_key_request,
|
|
156
|
+
make_cache_key=make_cache_key_request,
|
|
157
|
+
unless=skip_cache_condition_request,
|
|
158
|
+
response_filter=is_cacheable_response,
|
|
146
159
|
)
|
|
147
160
|
|
|
148
161
|
|
|
@@ -22,9 +22,11 @@
|
|
|
22
22
|
import hashlib
|
|
23
23
|
import json
|
|
24
24
|
import os
|
|
25
|
+
import shutil
|
|
26
|
+
import tempfile
|
|
25
27
|
from io import BytesIO
|
|
26
28
|
from pathlib import Path
|
|
27
|
-
from typing import Any, BinaryIO, Optional, Tuple, Union
|
|
29
|
+
from typing import IO, Any, BinaryIO, Optional, Tuple, Union
|
|
28
30
|
|
|
29
31
|
from flask import jsonify, make_response, send_file, send_from_directory, current_app
|
|
30
32
|
from gramps.gen.db.base import DbReadBase
|
|
@@ -326,7 +328,7 @@ class LocalFileHandler(FileHandler):
|
|
|
326
328
|
|
|
327
329
|
|
|
328
330
|
def upload_file_local(
|
|
329
|
-
base_dir: FilenameOrPath, rel_path: FilenameOrPath, stream:
|
|
331
|
+
base_dir: FilenameOrPath, rel_path: FilenameOrPath, stream: IO[bytes]
|
|
330
332
|
) -> None:
|
|
331
333
|
"""Upload a file from a stream to a path inside the base directory.
|
|
332
334
|
|
|
@@ -358,10 +360,11 @@ def get_checksum(fp) -> str:
|
|
|
358
360
|
return md5sum
|
|
359
361
|
|
|
360
362
|
|
|
361
|
-
def process_file(stream: Union[Any, BinaryIO]) -> Tuple[str, int,
|
|
363
|
+
def process_file(stream: Union[Any, BinaryIO]) -> Tuple[str, int, IO[bytes]]:
|
|
362
364
|
"""Process a file from a stream that has a read method."""
|
|
363
|
-
|
|
364
|
-
fp.
|
|
365
|
+
# copy in chunks, spilling to disk, instead of holding the body in memory twice
|
|
366
|
+
fp = tempfile.SpooledTemporaryFile(max_size=10 * 1024 * 1024)
|
|
367
|
+
shutil.copyfileobj(stream, fp)
|
|
365
368
|
fp.seek(0)
|
|
366
369
|
checksum = get_checksum(fp)
|
|
367
370
|
size = fp.tell()
|
|
@@ -75,11 +75,13 @@ def _fix_xmp(image: ImageType) -> None:
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
def exif_transpose(image: ImageType) -> ImageType:
|
|
78
|
-
"""
|
|
78
|
+
"""Rotate the image in place according to its EXIF orientation and return it.
|
|
79
|
+
|
|
80
|
+
Pillow's default returns a full copy even when no rotation is needed.
|
|
81
|
+
"""
|
|
79
82
|
_fix_xmp(image)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return transposed
|
|
83
|
+
ImageOps.exif_transpose(image, in_place=True)
|
|
84
|
+
return image
|
|
83
85
|
|
|
84
86
|
|
|
85
87
|
def open_image(fp: Union[BinaryIO, FilenameOrPath]) -> ImageType:
|
|
@@ -240,7 +240,8 @@ def answer_with_agent(
|
|
|
240
240
|
|
|
241
241
|
messages: list[ModelMessage] = []
|
|
242
242
|
try:
|
|
243
|
-
|
|
243
|
+
# never log the prompt or the answer, they contain private chat content
|
|
244
|
+
logger.debug("Running Pydantic AI agent")
|
|
244
245
|
with capture_run_messages() as messages:
|
|
245
246
|
result = agent.run_sync(
|
|
246
247
|
prompt,
|
|
@@ -254,7 +255,7 @@ def answer_with_agent(
|
|
|
254
255
|
else None
|
|
255
256
|
),
|
|
256
257
|
)
|
|
257
|
-
logger.debug("Agent
|
|
258
|
+
logger.debug("Agent finished with reason: %s", result.response.finish_reason)
|
|
258
259
|
if result.response.finish_reason == "length":
|
|
259
260
|
logger.warning(
|
|
260
261
|
"AI answer cut off at the output token limit, see "
|
|
@@ -295,7 +296,11 @@ def answer_with_agent(
|
|
|
295
296
|
abort_with_message(
|
|
296
297
|
400, "The AI model's response exceeded its output token limit."
|
|
297
298
|
)
|
|
298
|
-
|
|
299
|
+
# str(e) can include the model's response body
|
|
300
|
+
logger.error(
|
|
301
|
+
"Pydantic AI error: %s",
|
|
302
|
+
e.message if isinstance(e, UnexpectedModelBehavior) else type(e).__name__,
|
|
303
|
+
)
|
|
299
304
|
abort_with_message(500, "Error communicating with the AI model")
|
|
300
305
|
except Exception:
|
|
301
306
|
logger.exception("Unexpected error in agent")
|
|
@@ -143,7 +143,10 @@ def _apply_gramps_filter(
|
|
|
143
143
|
filter_dict["function"] = logic
|
|
144
144
|
|
|
145
145
|
filter_rules = json.dumps(filter_dict)
|
|
146
|
-
|
|
146
|
+
# rule values come from the chat, so only log the rule names
|
|
147
|
+
logger.debug(
|
|
148
|
+
"%s filter rules: %s", namespace, [rule["name"] for rule in rules]
|
|
149
|
+
)
|
|
147
150
|
|
|
148
151
|
args = {"rules": filter_rules}
|
|
149
152
|
matching_handles = apply_filter(
|
|
@@ -404,10 +407,9 @@ def search_genealogy_database(
|
|
|
404
407
|
if len(context_parts) < total:
|
|
405
408
|
result += f"\n\n---\nShowing {len(context_parts)} of {total} matches."
|
|
406
409
|
logger.debug(
|
|
407
|
-
"Tool search_genealogy_database returned %d results (%d chars)
|
|
410
|
+
"Tool search_genealogy_database returned %d results (%d chars)",
|
|
408
411
|
len(context_parts),
|
|
409
412
|
len(result),
|
|
410
|
-
query,
|
|
411
413
|
)
|
|
412
414
|
return result
|
|
413
415
|
|
|
@@ -26,7 +26,7 @@ import os
|
|
|
26
26
|
import time
|
|
27
27
|
import zipfile
|
|
28
28
|
from pathlib import Path
|
|
29
|
-
from typing import
|
|
29
|
+
from typing import IO, TYPE_CHECKING, Callable, List, Optional, Set
|
|
30
30
|
|
|
31
31
|
from flask import current_app
|
|
32
32
|
from flask_jwt_extended import get_jwt_identity
|
|
@@ -159,7 +159,7 @@ class MediaHandlerBase:
|
|
|
159
159
|
|
|
160
160
|
def upload_file(
|
|
161
161
|
self,
|
|
162
|
-
stream:
|
|
162
|
+
stream: IO[bytes],
|
|
163
163
|
checksum: str,
|
|
164
164
|
mime: str,
|
|
165
165
|
path: Optional[FilenameOrPath] = None,
|
|
@@ -203,7 +203,7 @@ class MediaHandlerLocal(MediaHandlerBase):
|
|
|
203
203
|
|
|
204
204
|
def upload_file(
|
|
205
205
|
self,
|
|
206
|
-
stream:
|
|
206
|
+
stream: IO[bytes],
|
|
207
207
|
checksum: str,
|
|
208
208
|
mime: str,
|
|
209
209
|
path: Optional[FilenameOrPath] = None,
|
|
@@ -347,7 +347,7 @@ class MediaHandlerS3(MediaHandlerBase):
|
|
|
347
347
|
|
|
348
348
|
def upload_file(
|
|
349
349
|
self,
|
|
350
|
-
stream:
|
|
350
|
+
stream: IO[bytes],
|
|
351
351
|
checksum: str,
|
|
352
352
|
mime: str,
|
|
353
353
|
path: Optional[FilenameOrPath] = None,
|
|
@@ -50,7 +50,7 @@ class CitationResourceHelper(GrampsObjectResourceHelper):
|
|
|
50
50
|
"""Extend citation attributes as needed."""
|
|
51
51
|
if "profile" in args:
|
|
52
52
|
obj.profile = get_citation_profile_for_object(
|
|
53
|
-
self.db_handle, obj, args["profile"]
|
|
53
|
+
self.db_handle, obj, args["profile"], locale=locale
|
|
54
54
|
)
|
|
55
55
|
if "extend" in args:
|
|
56
56
|
obj.extended = get_extended_attributes(self.db_handle, obj, args)
|
|
@@ -87,8 +87,13 @@ class PersonDnaMatchesResource(ProtectedResource):
|
|
|
87
87
|
abort(404)
|
|
88
88
|
raise AssertionError # for type checker
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
# caching the whole tree is only worth it if there are matches to compute
|
|
91
|
+
if any(
|
|
92
|
+
association.get_relation() == "DNA"
|
|
93
|
+
for association in person.get_person_ref_list()
|
|
94
|
+
):
|
|
95
|
+
db_handle.cache_people()
|
|
96
|
+
db_handle.cache_families()
|
|
92
97
|
|
|
93
98
|
locale = get_locale_for_language(args["locale"], default=True)
|
|
94
99
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"""Object storage (e.g. S3) handling utilities."""
|
|
21
21
|
|
|
22
22
|
from io import BytesIO
|
|
23
|
-
from typing import BinaryIO, Dict, Optional
|
|
23
|
+
from typing import IO, BinaryIO, Dict, Optional
|
|
24
24
|
|
|
25
25
|
from flask import current_app, redirect, send_file
|
|
26
26
|
from gramps.gen.db.base import DbReadBase
|
|
@@ -210,7 +210,7 @@ class ObjectStorageFileHandler(FileHandler):
|
|
|
210
210
|
|
|
211
211
|
def upload_file_s3(
|
|
212
212
|
bucket_name: str,
|
|
213
|
-
stream:
|
|
213
|
+
stream: IO[bytes],
|
|
214
214
|
checksum: str,
|
|
215
215
|
mime: str,
|
|
216
216
|
prefix: Optional[str] = None,
|
|
@@ -241,7 +241,9 @@ def _collect(
|
|
|
241
241
|
spec = FIELD_SPECS[data["_class"]]
|
|
242
242
|
is_private = is_private or bool(data.get("private"))
|
|
243
243
|
strings = private if is_private else public
|
|
244
|
-
|
|
244
|
+
# Gramps does not enforce types, so data written by other tools can hold
|
|
245
|
+
# e.g. a postal code as a number
|
|
246
|
+
strings += [str(data[key]) for key in spec.text if data.get(key)]
|
|
245
247
|
strings += [_type_string(data.get(key), False) for key in spec.types]
|
|
246
248
|
strings += [_type_string(data.get(key), True) for key in spec.custom_types]
|
|
247
249
|
for key in spec.children:
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"""Utility functions for celery."""
|
|
2
2
|
|
|
3
|
+
import logging
|
|
4
|
+
|
|
3
5
|
from celery import Task
|
|
4
6
|
from celery import current_app as current_celery_app
|
|
5
7
|
from werkzeug.exceptions import HTTPException
|
|
@@ -22,8 +24,31 @@ class TaskRejection(TaskError):
|
|
|
22
24
|
"""
|
|
23
25
|
|
|
24
26
|
|
|
27
|
+
class HideTaskResultFilter(logging.Filter):
|
|
28
|
+
"""Hide task return values in Celery's "Task ... succeeded" log records.
|
|
29
|
+
|
|
30
|
+
Results can contain private tree data, e.g. OCR text or AI chat answers.
|
|
31
|
+
Celery has no setting for this, but passes the log context as ``data`` in
|
|
32
|
+
``extra`` for custom handlers, so the value is replaced there too.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
def filter(self, record: logging.LogRecord) -> bool:
|
|
36
|
+
context = record.args
|
|
37
|
+
if isinstance(context, dict) and "return_value" in context:
|
|
38
|
+
context = {**context, "return_value": "<hidden>"}
|
|
39
|
+
record.args = context
|
|
40
|
+
if isinstance(getattr(record, "data", None), dict):
|
|
41
|
+
record.data = context
|
|
42
|
+
return True
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
_hide_task_result_filter = HideTaskResultFilter()
|
|
46
|
+
|
|
47
|
+
|
|
25
48
|
def create_celery(app):
|
|
26
49
|
"""App factory for celery."""
|
|
50
|
+
# no-op if already added, create_celery runs once per app
|
|
51
|
+
logging.getLogger("celery.app.trace").addFilter(_hide_task_result_filter)
|
|
27
52
|
celery = current_celery_app
|
|
28
53
|
celery.conf.name = app.import_name
|
|
29
54
|
celery.conf.update(app.config["CELERY_CONFIG"])
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Gramps Web API - A RESTful API for the Gramps genealogy program
|
|
3
|
+
#
|
|
4
|
+
# Copyright (C) 2026 David Straub
|
|
5
|
+
#
|
|
6
|
+
# This program is free software; you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
8
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU Affero General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
17
|
+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
"""Tests that Celery does not log task return values."""
|
|
21
|
+
|
|
22
|
+
import logging
|
|
23
|
+
|
|
24
|
+
from celery import shared_task
|
|
25
|
+
from celery.app.trace import build_tracer
|
|
26
|
+
|
|
27
|
+
from gramps_webapi.app import create_app
|
|
28
|
+
from gramps_webapi.const import ENV_CONFIG_FILE, TEST_AUTH_CONFIG
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@shared_task()
|
|
32
|
+
def _ocr_task():
|
|
33
|
+
return "secret OCR text"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def test_task_result_not_logged(monkeypatch, caplog):
|
|
37
|
+
monkeypatch.setenv(ENV_CONFIG_FILE, TEST_AUTH_CONFIG)
|
|
38
|
+
create_app(config={"TESTING": True})
|
|
39
|
+
create_app(config={"TESTING": True})
|
|
40
|
+
trace_logger = logging.getLogger("celery.app.trace")
|
|
41
|
+
assert len(trace_logger.filters) == 1
|
|
42
|
+
with caplog.at_level(logging.INFO, logger="celery.app.trace"):
|
|
43
|
+
# the tracer checks the log level when it is built
|
|
44
|
+
tracer = build_tracer(
|
|
45
|
+
_ocr_task.name, _ocr_task, app=_ocr_task._get_app(), eager=True
|
|
46
|
+
)
|
|
47
|
+
retval = tracer("some-id", (), {}, {})
|
|
48
|
+
assert retval.retval == "secret OCR text"
|
|
49
|
+
records = [r for r in caplog.records if "succeeded" in r.getMessage()]
|
|
50
|
+
assert len(records) == 1
|
|
51
|
+
assert records[0].getMessage().endswith(": <hidden>")
|
|
52
|
+
assert records[0].data["return_value"] == "<hidden>"
|
|
53
|
+
assert "secret OCR text" not in caplog.text
|
|
@@ -116,6 +116,17 @@ class TestRequestCacheETag(unittest.TestCase):
|
|
|
116
116
|
self._get_etag(path, self.headers_user),
|
|
117
117
|
)
|
|
118
118
|
|
|
119
|
+
def test_error_not_cached(self):
|
|
120
|
+
"""An error response is not served from the cache once its cause is
|
|
121
|
+
gone, e.g. an addon filter rule that was installed after the error."""
|
|
122
|
+
rules = '{"rules":[{"name":"HasIdOf","values":["N0000"]}]}'
|
|
123
|
+
path = f"/api/notes/?rules={rules}"
|
|
124
|
+
with patch("gramps_webapi.api.resources.filters.get_rule_map", return_value={}):
|
|
125
|
+
rv = self.client.get(path, headers=self.headers_admin)
|
|
126
|
+
self.assertEqual(rv.status_code, 404)
|
|
127
|
+
rv = self.client.get(path, headers=self.headers_admin)
|
|
128
|
+
self.assertEqual(rv.status_code, 200)
|
|
129
|
+
|
|
119
130
|
def test_etag_without_timestamp(self):
|
|
120
131
|
"""Without a last change timestamp, the ETag is the hash of the body."""
|
|
121
132
|
path = f"/api/notes/{self.handle}"
|
|
@@ -27,7 +27,7 @@ from PIL import Image
|
|
|
27
27
|
from gramps_webapi.const import MIME_AVIF
|
|
28
28
|
|
|
29
29
|
from . import BASE_URL, get_test_client
|
|
30
|
-
from .checks import check_requires_token, check_success
|
|
30
|
+
from .checks import check_invalid_syntax, check_requires_token, check_success
|
|
31
31
|
from .util import fetch_header
|
|
32
32
|
|
|
33
33
|
TEST_URL = BASE_URL + "/media/"
|
|
@@ -186,6 +186,15 @@ class TestCropped(unittest.TestCase):
|
|
|
186
186
|
self.assertAlmostEqual(img.width, 0.1 * full_img.width, delta=1)
|
|
187
187
|
self.assertAlmostEqual(img.height, 0.2 * full_img.height, delta=1)
|
|
188
188
|
|
|
189
|
+
def test_get_cropped_invalid_region(self):
|
|
190
|
+
"""Test that crop regions outside the image are rejected."""
|
|
191
|
+
handle = check_success(self, TEST_URL)[0]["handle"]
|
|
192
|
+
for region in ["0/0/1000/100", "0/0/100/1000", "20/0/10/100", "0/50/100/50"]:
|
|
193
|
+
for suffix in ["", "/thumbnail/100"]:
|
|
194
|
+
check_invalid_syntax(
|
|
195
|
+
self, f"{TEST_URL}{handle}/cropped/{region}{suffix}"
|
|
196
|
+
)
|
|
197
|
+
|
|
189
198
|
def test_get_cropped_with_checksum(self):
|
|
190
199
|
"""Test that the checksum query param is accepted and does not alter the response."""
|
|
191
200
|
media_objects = check_success(self, TEST_URL)
|
|
@@ -527,6 +527,32 @@ class TestObjectCreation(unittest.TestCase):
|
|
|
527
527
|
obj_dict = rv.json
|
|
528
528
|
self.assertEqual(obj_dict["page"], obj["page"])
|
|
529
529
|
|
|
530
|
+
def test_add_citation_profile_locale(self):
|
|
531
|
+
"""Citation profile date is displayed in the requested locale."""
|
|
532
|
+
handle = make_handle()
|
|
533
|
+
obj = {
|
|
534
|
+
"handle": handle,
|
|
535
|
+
"date": {
|
|
536
|
+
"_class": "Date",
|
|
537
|
+
"modifier": 3, # about
|
|
538
|
+
"dateval": [0, 0, 1855, False],
|
|
539
|
+
},
|
|
540
|
+
}
|
|
541
|
+
headers = get_headers(self.client, "admin", "123")
|
|
542
|
+
rv = self.client.post("/api/citations/", json=obj, headers=headers)
|
|
543
|
+
self.assertEqual(rv.status_code, 201)
|
|
544
|
+
rv = self.client.get(
|
|
545
|
+
f"/api/citations/{handle}?locale=de&profile=all", headers=headers
|
|
546
|
+
)
|
|
547
|
+
self.assertEqual(rv.status_code, 200)
|
|
548
|
+
self.assertEqual(rv.json["profile"]["date"], "um 1855")
|
|
549
|
+
rv = self.client.get(
|
|
550
|
+
f"/api/citations/?handles={handle}&locale=de&profile=all",
|
|
551
|
+
headers=headers,
|
|
552
|
+
)
|
|
553
|
+
self.assertEqual(rv.status_code, 200)
|
|
554
|
+
self.assertEqual(rv.json[0]["profile"]["date"], "um 1855")
|
|
555
|
+
|
|
530
556
|
def test_add_repository(self):
|
|
531
557
|
"""Add a single repository."""
|
|
532
558
|
handle = make_handle()
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
import gramps.gen.lib as lib
|
|
23
23
|
import pytest
|
|
24
24
|
from gramps.gen.lib import (
|
|
25
|
+
Address,
|
|
25
26
|
Attribute,
|
|
26
27
|
AttributeType,
|
|
27
28
|
Event,
|
|
@@ -191,6 +192,14 @@ def test_types():
|
|
|
191
192
|
assert _words(own_strings(media)[1]) == {"x", "y", "zqtype"}
|
|
192
193
|
|
|
193
194
|
|
|
195
|
+
def test_non_string_text():
|
|
196
|
+
"""Text fields holding numbers, as written by other tools, are indexed."""
|
|
197
|
+
address = Address()
|
|
198
|
+
address.set_postal_code(12345)
|
|
199
|
+
person = _person(add_address=address, add_attribute=_attribute(42))
|
|
200
|
+
assert {"12345", "42"} <= _words(own_strings(person)[1])
|
|
201
|
+
|
|
202
|
+
|
|
194
203
|
def test_standard_types_are_the_indexed_types():
|
|
195
204
|
"""The types searchable by translated name are those indexed in English."""
|
|
196
205
|
indexed = set()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gramps_webapi-3.25.1 → gramps_webapi-3.25.2}/alembic_users/versions/66e56620891a_add_trees_table.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|