aas-http-client 0.3.3__tar.gz → 0.3.4__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.

Potentially problematic release.


This version of aas-http-client might be problematic. Click here for more details.

Files changed (21) hide show
  1. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/PKG-INFO +1 -1
  2. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client/client.py +3 -6
  3. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client/wrapper/sdk_wrapper.py +8 -1
  4. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client.egg-info/PKG-INFO +1 -1
  5. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/pyproject.toml +1 -1
  6. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/tests/test_wrapper.py +6 -0
  7. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/LICENSE +0 -0
  8. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/README.md +0 -0
  9. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client/__init__.py +0 -0
  10. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client/core/encoder.py +0 -0
  11. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client/core/version_check.py +0 -0
  12. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client/demo/demo_process.py +0 -0
  13. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client/demo/logging_handler.py +0 -0
  14. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client/utilities/__init__.py +0 -0
  15. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client/utilities/model_builder.py +0 -0
  16. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client.egg-info/SOURCES.txt +0 -0
  17. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client.egg-info/dependency_links.txt +0 -0
  18. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client.egg-info/requires.txt +0 -0
  19. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/aas_http_client.egg-info/top_level.txt +0 -0
  20. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/setup.cfg +0 -0
  21. {aas_http_client-0.3.3 → aas_http_client-0.3.4}/tests/test_client.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aas-http-client
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: Generic python HTTP client for communication with various types of AAS servers
5
5
  Author-email: Daniel Klein <daniel.klein@em.ag>
6
6
  License: # :em engineering methods AG Software License
@@ -75,7 +75,6 @@ class AasHttpClient(BaseModel):
75
75
 
76
76
  base_url: str = "http://javaaasserver:5060/"
77
77
  username: str | None = None
78
- _password: str | None = PrivateAttr(default=None)
79
78
  https_proxy: str | None = None
80
79
  http_proxy: str | None = None
81
80
  time_out: int = 200
@@ -88,13 +87,11 @@ class AasHttpClient(BaseModel):
88
87
 
89
88
  :param password: password
90
89
  """
91
- self._password = password
92
-
93
90
  if self.base_url.endswith("/"):
94
91
  self.base_url = self.base_url[:-1]
95
92
 
96
93
  self._session = requests.Session()
97
- self._session.auth = HTTPBasicAuth(self.username, self._password)
94
+ self._session.auth = HTTPBasicAuth(self.username, password)
98
95
  self._session.verify = self.ssl_verify
99
96
 
100
97
  if self.https_proxy:
@@ -660,11 +657,11 @@ def create_client_by_config(config_file: Path, password: str = "") -> AasHttpCli
660
657
  return _create_client(config_string, password)
661
658
 
662
659
 
663
- def _create_client(config_string: str, password) -> AasHttpClient | None:
660
+ def _create_client(config_string: str, password: str) -> AasHttpClient | None:
664
661
  try:
665
662
  client = AasHttpClient.model_validate_json(config_string)
666
663
  except ValidationError as ve:
667
- raise ValidationError(f"Invalid BaSyx server connection file: {ve}") from ve
664
+ raise ValidationError(f"Invalid BaSyx server configuration file: {ve}") from ve
668
665
 
669
666
  logger.info(
670
667
  f"Using server configuration: '{client.base_url}' | "
@@ -288,8 +288,15 @@ class SdkWrapper:
288
288
  """
289
289
  return self._client.patch_submodel_element_by_path_value_only_submodel_repo(submodel_id, submodel_element_path, value)
290
290
 
291
+ # endregion
292
+
293
+ def get_client(self) -> AasHttpClient:
294
+ """Returns the underlying AAS HTTP client.
295
+
296
+ :return: The AAS HTTP client instance.
297
+ """
298
+ return self._client
291
299
 
292
- # endregion
293
300
 
294
301
  # region utils
295
302
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aas-http-client
3
- Version: 0.3.3
3
+ Version: 0.3.4
4
4
  Summary: Generic python HTTP client for communication with various types of AAS servers
5
5
  Author-email: Daniel Klein <daniel.klein@em.ag>
6
6
  License: # :em engineering methods AG Software License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aas-http-client"
7
- version = "0.3.3"
7
+ version = "0.3.4"
8
8
  description = "Generic python HTTP client for communication with various types of AAS servers"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -90,6 +90,12 @@ def test_000b_create_wrapper_by_dict(wrapper: SdkWrapper):
90
90
  new_client: SdkWrapper = create_wrapper_by_dict(configuration=config_dict)
91
91
  assert new_client is not None
92
92
 
93
+ def test_000c_get_client(wrapper: SdkWrapper):
94
+ client = wrapper.get_client()
95
+ assert client is not None
96
+ root = client.get_root()
97
+ assert root is not None
98
+
93
99
  def test_001_connect(wrapper: SdkWrapper):
94
100
  assert wrapper is not None
95
101
 
File without changes