dcache-pyclient 0.1.2__tar.gz → 0.2.0__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.
Files changed (24) hide show
  1. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/PKG-INFO +1 -1
  2. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/pyproject.toml +1 -1
  3. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/api.py +6 -1
  4. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/cli/app.py +5 -0
  5. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/cli/commands.py +1 -0
  6. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/client.py +2 -0
  7. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/LICENSE +0 -0
  8. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/README.md +0 -0
  9. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/__init__.py +0 -0
  10. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/auth.py +0 -0
  11. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/cli/formatters.py +0 -0
  12. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/config.py +0 -0
  13. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/etc/ada.conf +0 -0
  14. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/exceptions.py +0 -0
  15. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/models.py +0 -0
  16. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/services/__init__.py +0 -0
  17. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/services/checksum.py +0 -0
  18. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/services/events.py +0 -0
  19. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/services/labels.py +0 -0
  20. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/services/namespace.py +0 -0
  21. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/services/staging.py +0 -0
  22. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/services/system.py +0 -0
  23. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/services/xattr.py +0 -0
  24. {dcache_pyclient-0.1.2 → dcache_pyclient-0.2.0}/src/ada/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dcache-pyclient
3
- Version: 0.1.2
3
+ Version: 0.2.0
4
4
  Summary: Python client for user interaction with dCache
5
5
  License: GPL-3.0 license
6
6
  Author: Onno Zweers, Haili Hu
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "dcache-pyclient"
3
- version = "0.1.2"
3
+ version = "0.2.0"
4
4
  description = "Python client for user interaction with dCache"
5
5
  authors = ["Onno Zweers, Haili Hu"]
6
6
  license = "GPL-3.0 license"
@@ -38,6 +38,7 @@ class DcacheAPI:
38
38
  self,
39
39
  base_url: str,
40
40
  auth: AuthProvider,
41
+ verify: bool = True,
41
42
  debug: bool = False,
42
43
  ) -> None:
43
44
  self.base_url = base_url.rstrip("/")
@@ -50,8 +51,12 @@ class DcacheAPI:
50
51
  "follow_redirects": True,
51
52
  }
52
53
 
54
+ # verify: False to disable verification
53
55
  ssl_ctx = auth.get_ssl_context()
54
- if ssl_ctx:
56
+ if verify is False:
57
+ logger.warning("WARNING: No SSL verification, connection may be insecure!")
58
+ client_kwargs["verify"] = False
59
+ elif ssl_ctx:
55
60
  client_kwargs["verify"] = ssl_ctx
56
61
 
57
62
  self._client = httpx.Client(**client_kwargs)
@@ -41,6 +41,11 @@ def parse_args() -> argparse.ArgumentParser:
41
41
  help="The dCache API URL to talk to."
42
42
  )
43
43
 
44
+ parser.add_argument(
45
+ "--no-verify",
46
+ help="Disable SSL verification. Do not use in production, connection may be insecure!",
47
+ action="store_true")
48
+
44
49
  parser.add_argument(
45
50
  "--debug",
46
51
  help="Run in debug mode (not yet implemented).",
@@ -131,5 +131,6 @@ def __get_client__(parsed_args):
131
131
  return AdaClient(
132
132
  api=parsed_args.api,
133
133
  tokenfile=parsed_args.tokenfile,
134
+ verify=(not parsed_args.no_verify),
134
135
  debug=parsed_args.debug, # TODO: debug option does not work
135
136
  )
@@ -57,6 +57,7 @@ class AdaClient:
57
57
  proxy: Optional[str] = None,
58
58
  igtf: bool = True,
59
59
  config_paths: Optional[list[str]] = None,
60
+ verify: bool = True,
60
61
  debug: bool = False,
61
62
  ) -> None:
62
63
  # Load config from files and env vars
@@ -81,6 +82,7 @@ class AdaClient:
81
82
  self._api = DcacheAPI(
82
83
  base_url=self.config.api,
83
84
  auth=self.auth,
85
+ verify=verify,
84
86
  debug=self.config.debug,
85
87
  )
86
88
 
File without changes