Skip to content

Commit c713cf0

Browse files
authored
Feature/update libs to avoid security issues (#49)
* Update cryptography and urllib3 versions in requirements.txt The project dependencies cryptography and urllib3 have been updated to more recent versions in the requirements.txt file. Cryptography has been updated from 3.4.8 to 42.0.5 while urllib3 has been updated from 1.26.7 to 2.2.1. * Update cryptography and urllib3 versions in requirements Updated the cryptography from version 42.0.5 to version 3.4.8 and urllib3 from 2.2.1 to 1.26.18 in the requirements file. This will ensure compatibility with the latest libraries while maintaining the application's functionality. * Downgrade protobuf package Protobuf package version has been downgraded from 3.20.3 to 3.18.0 in the requirements.txt file. This change maintains compatibility with other dependencies that are yet to support the newer version. * Refactor codebase for agrirouter integration The codebase has been heavily refactored to introduce the "agrirouter" namespace. Among other changes, the original 'src' module is now within 'agrirouter'. All corresponding root-level paths, import paths, and descriptor full names have been updated to reflect this change, ensuring that the module hierarchy is correct. * Refactor import statements in test_send_and_receive_chunked_messages_from_the_feed The import statements were reorganized in the file 'test_send_and_receive_chunked_messages_from_the_feed.py'. The sequence of imports was changed and multi-line import statements were aligned for better readability and code formatting standards. * typeReorder imports in mqtt tests The imports in the mqtt test script have been restructured for better readability and maintenance. The imports related to 'enums', 'parameters.service' and 'request.request_pb2' have been modified. It does not affect the functionality of the test cases or the script, but enhances the structure. * Update imports in type_url.py The import order and placement in type_url.py has been corrected to improve code readability and organization. Along with this, import statements for TimeLog and ISO11783_TaskData from efdi_pb2 and TypeUrlNotFound from exceptions have been moved to the top. * Update import order in cloud.py Adjusted the import order in cloud.py to improve readability and code consistency. `TechnicalMessageType` has been moved to precede the import from `cloud_virtualized_app_registration_pb2`. No functional changes have been made.
1 parent 34e7518 commit c713cf0

152 files changed

Lines changed: 429 additions & 428 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

example_script.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
from google.protobuf.timestamp_pb2 import Timestamp
44

5-
from src.generated.messaging.request.payload.account.endpoints_pb2 import ListEndpointsQuery
6-
from src.generated.messaging.request.payload.feed.feed_requests_pb2 import ValidityPeriod
7-
from src.onboarding.response import OnboardResponse
5+
from src.agrirouter.generated.messaging.request.payload.account.endpoints_pb2 import ListEndpointsQuery
6+
from src.agrirouter.generated.messaging.request.payload.feed.feed_requests_pb2 import ValidityPeriod
7+
from src.agrirouter.onboarding.response import OnboardResponse
88

99
public_key = """-----BEGIN PUBLIC KEY-----
1010
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzGt41/+kSOTlO1sJvLIN
@@ -65,14 +65,14 @@
6565
}
6666

6767
import src as ar
68-
from src.onboarding.enums import Gateways
69-
from src.api.enums import CapabilityType
70-
from src.generated.messaging.request.payload.endpoint.subscription_pb2 import Subscription
71-
from src.generated.messaging.request.payload.endpoint.capabilities_pb2 import CapabilitySpecification
72-
from src.messaging.services.commons import HttpMessagingService, MqttMessagingService
68+
from src.agrirouter.onboarding.enums import Gateways
69+
from src.agrirouter.api.enums import CapabilityType
70+
from src.agrirouter.generated.messaging.request.payload.endpoint.subscription_pb2 import Subscription
71+
from src.agrirouter.generated.messaging.request.payload.endpoint.capabilities_pb2 import CapabilitySpecification
72+
from src.agrirouter.messaging.services.commons import HttpMessagingService, MqttMessagingService
7373
from src import ListEndpointsParameters, ListEndpointsService, SubscriptionService, SubscriptionParameters, \
7474
QueryHeaderService, QueryHeaderParameters, CapabilitiesService, CapabilitiesParameters
75-
from src.utils.uuid_util import new_uuid
75+
from src.agrirouter.utils.uuid_util import new_uuid
7676

7777
application_id = "8c947a45-c57d-42d2-affc-206e21d63a50" # # store here your application id. You can find it in AR UI
7878
certification_version_id = "edd5d6b7-45bb-4471-898e-ff9c2a7bf56f" # # store here your certification version id. You can find it in AR UI
@@ -298,9 +298,9 @@ def example_query_header_message_mqtt(onboarding_response_data, on_msg_callback)
298298
def on_message_callback(client, userdata, msg):
299299
# Define here the way receiving messages will be processed
300300

301-
from src.messaging.decode import decode_response
302-
from src.messaging.decode import decode_details
303-
from src.messaging.messages import OutboxMessage
301+
from src.agrirouter.messaging.decode import decode_response
302+
from src.agrirouter.messaging.decode import decode_details
303+
from src.agrirouter.messaging.messages import OutboxMessage
304304

305305
outbox_message = OutboxMessage()
306306
outbox_message.json_deserialize(msg.payload.decode().replace("'", '"'))

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ cryptography~=3.4.8
66
setuptools~=68.0.0
77
pycparser~=2.20
88
idna~=3.2
9-
urllib3~=1.26.7
9+
urllib3~=1.26.18
1010
certifi~=2023.7.22
1111
requests~=2.31.0
1212
paho-mqtt~=1.5.1
13-
protobuf~=3.20.3
13+
protobuf~=3.18.0
1414
google~=3.0.0
1515
toml~=0.10.2
1616
build~=1.1.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from src.api.keys import AR_QA_PUBLIC_KEY, AR_PROD_PUBLIC_KEY
1+
from src.agrirouter.api.keys import AR_QA_PUBLIC_KEY, AR_PROD_PUBLIC_KEY
22

33

44
class BaseEnvironment:
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from urllib.parse import urlparse, parse_qs
22

3-
from src.auth.parameters import AuthUrlParameter
4-
from src.auth.response import AuthResponse
5-
from src.environments.environmental_services import EnvironmentalService
3+
from src.agrirouter.auth.parameters import AuthUrlParameter
4+
from src.agrirouter.auth.response import AuthResponse
5+
from src.agrirouter.environments.environmental_services import EnvironmentalService
66

77

88
class Authorization(EnvironmentalService):

0 commit comments

Comments
 (0)