Closed HalfVoxel closed 1 month ago
The changes in this pull request involve multiple updates across various files, primarily enhancing functionality and organization. Key modifications include the addition of new dependencies in the requirements.txt
, the introduction of a new SQL table for logging physical access events, and the enhancement of webhook handling in the multiaccessy
module. Additionally, several methods and classes related to webhook events have been added, along with improvements in type annotations for better clarity. Configuration changes in docker-compose.yml
and create_env.py
further refine the environment setup.
File | Change Summary |
---|---|
api/requirements.txt |
Added NamedAtomicLock , moved dataclasses_json to runtime requirements while retaining it in test requirements. |
api/src/api.py |
Imported register_accessy_webhook from multiaccessy.accessy and called it post permission registration. |
api/src/migrations/0028_initial_accessy_log.sql |
Added new table physical_access_log with specified columns and constraints for logging physical access events. |
api/src/multiaccessy/__init__.py |
Imported InternalService and created an instance named service . |
api/src/multiaccessy/accessy.py |
Introduced AccessyWebhookEventType enum and several data classes, updated request method signature, added multiple methods for webhook management, and enhanced type hints. |
api/src/multiaccessy/models.py |
Added new SQLAlchemy model PhysicalAccessEntry for physical_access_log . |
api/src/multiaccessy/views.py |
Added data classes for webhook events, implemented decode_event and handle_event functions, and created accessy_webhook endpoint for handling incoming events. |
api/src/service/entity.py |
Updated fromisoformat method signature to specify parameter and return types. |
api/src/services.py |
Added Instance(path="/accessy", service=multiaccessy.service) to services tuple. |
create_env.py |
Removed CORS_ALLOWED_ORIGINS from configuration dictionary. |
docker-compose.yml |
Added HOST_BACKEND environment variable to api service, updated CORS_ALLOWED_ORIGINS to include HOST_BACKEND . |
In the burrow deep, where the code does leap,
Changes abound, like secrets we keep.
With webhooks in tow, and logs to show,
The rabbit hops high, as new features grow.
Dependencies added, the structure refined,
A dance of the code, in harmony aligned! 🐇✨
api/src/multiaccessy/views.py (5)
`1-17`: **LGTM! Well-organized imports and logger setup.** The imports are properly structured and all necessary dependencies are included. --- `131-134`: **Skipping comment about inconsistent role field type** This issue was already identified in a previous review. --- `184-184`: **Skipping comments about assert statements** These issues were already identified in previous reviews. Also applies to: 190-190 --- `214-220`: **Skipping comment about header validation** This issue was already addressed in a previous review. --- `158-170`: **Consider implementing commented-out event types** There are several commented-out event types in the mapping. If these events are expected to be received, they should be implemented to ensure complete webhook handling coverage. Let's check if these events are actually needed: Would you like help implementing the missing event types?
Summary by CodeRabbit
Release Notes
New Features
Improvements
Configuration Changes
HOST_BACKEND
environment variable for backend connectivity.