Skip to content

Commit 0c40816

Browse files
authored
Merge pull request #39 from TaskarCenterAtUW/feature-1564
Fixed Task 1564 and 1566
2 parents bd83973 + cf408b4 commit 0c40816

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ The project is built on Python with FastAPI framework. All the regular nuances f
2323
- Connecting this to cloud will need the following in the `.env` file
2424

2525
```bash
26+
PROVIDER=Azure
2627
QUEUECONNECTION=xxxx
2728
STORAGECONNECTION=xxxx
2829
VALIDATION_REQ_TOPIC=xxxx
2930
VALIDATION_REQ_SUB=xxxx
3031
VALIDATION_RES_TOPIC=xxxx
3132
CONTAINER_NAME=xxxx
32-
AUTH_PERMISSION_URL=xxx
33-
MAX_CONCURRENT_MESSAGES=xxx
34-
33+
AUTH_PERMISSION_URL=xxx # This is the URL to get the token
34+
MAX_CONCURRENT_MESSAGES=xxx # Optional if not provided defaults to 2
35+
AUTH_SIMULATE=xxx # Optional if not provided defaults to False
3536
```
3637

3738
The application connect with the `STORAGECONNECTION` string provided in `.env` file and validates downloaded zipfile using `python-osw-validation` package.

src/osw_validator.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .models.queue_message_content import Upload, ValidationResult
1010
from .config import Settings
1111
import threading
12+
import python_osw_validation
1213

1314
logging.basicConfig()
1415
logger = logging.getLogger('OSW_VALIDATOR')
@@ -77,11 +78,16 @@ def validate(self, received_message: Upload):
7778
def send_status(self, result: ValidationResult, upload_message: Upload):
7879
upload_message.data.success = result.is_valid
7980
upload_message.data.message = result.validation_message
81+
resp_data = upload_message.data.to_json()
82+
resp_data['package'] = {
83+
'python-ms-core': Core.__version__,
84+
'python-osw-validation': python_osw_validation.__version__
85+
}
8086

8187
data = QueueMessage.data_from({
8288
'messageId': upload_message.message_id,
8389
'messageType': upload_message.message_type,
84-
'data': upload_message.data.to_json()
90+
'data': resp_data
8591
})
8692
try:
8793
self.core.get_topic(topic_name=self._settings.event_bus.validation_topic).publish(data=data)

0 commit comments

Comments
 (0)