Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ The project is built on Python with FastAPI framework. All the regular nuances f
- Connecting this to cloud will need the following in the `.env` file

```bash
PROVIDER=Azure
QUEUECONNECTION=xxxx
STORAGECONNECTION=xxxx
VALIDATION_REQ_TOPIC=xxxx
VALIDATION_REQ_SUB=xxxx
VALIDATION_RES_TOPIC=xxxx
CONTAINER_NAME=xxxx
AUTH_PERMISSION_URL=xxx
MAX_CONCURRENT_MESSAGES=xxx

AUTH_PERMISSION_URL=xxx # This is the URL to get the token
MAX_CONCURRENT_MESSAGES=xxx # Optional if not provided defaults to 2
AUTH_SIMULATE=xxx # Optional if not provided defaults to False
```

The application connect with the `STORAGECONNECTION` string provided in `.env` file and validates downloaded zipfile using `python-osw-validation` package.
Expand Down
8 changes: 7 additions & 1 deletion src/osw_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .models.queue_message_content import Upload, ValidationResult
from .config import Settings
import threading
import python_osw_validation

logging.basicConfig()
logger = logging.getLogger('OSW_VALIDATOR')
Expand Down Expand Up @@ -77,11 +78,16 @@ def validate(self, received_message: Upload):
def send_status(self, result: ValidationResult, upload_message: Upload):
upload_message.data.success = result.is_valid
upload_message.data.message = result.validation_message
resp_data = upload_message.data.to_json()
resp_data['package'] = {
'python-ms-core': Core.__version__,
'python-osw-validation': python_osw_validation.__version__
}

data = QueueMessage.data_from({
'messageId': upload_message.message_id,
'messageType': upload_message.message_type,
'data': upload_message.data.to_json()
'data': resp_data
})
try:
self.core.get_topic(topic_name=self._settings.event_bus.validation_topic).publish(data=data)
Expand Down
Loading