dothttp-req 0.0.44a26__tar.gz → 0.0.44a28__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 (53) hide show
  1. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/PKG-INFO +5 -4
  2. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/handlers/http2postman.py +2 -1
  3. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/http.tx +6 -6
  4. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/parse/__init__.py +8 -3
  5. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/parse/request_base.py +9 -4
  6. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/utils/common.py +11 -0
  7. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/pyproject.toml +4 -4
  8. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/LICENSE.txt +0 -0
  9. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/README.md +0 -0
  10. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/__init__.py +0 -0
  11. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/__init__.py +0 -0
  12. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/__main__.py +0 -0
  13. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/agent.py +0 -0
  14. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/handlers/__init__.py +0 -0
  15. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/handlers/basic_handlers.py +0 -0
  16. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/handlers/fs_handlers.py +0 -0
  17. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/handlers/gohandler.py +0 -0
  18. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/handlers/har2httphandler.py +0 -0
  19. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/handlers/http2har.py +0 -0
  20. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/handlers/postman2http.py +0 -0
  21. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/models/__init__.py +0 -0
  22. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/models/har.py +0 -0
  23. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/postman/__init__.py +0 -0
  24. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/postman2_1/__init__.py +0 -0
  25. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/server.py +0 -0
  26. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/server/utils.py +0 -0
  27. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/version/__init__.py +0 -0
  28. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dotextensions/version/__main__.py +0 -0
  29. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/__init__.py +0 -0
  30. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/__main__.py +0 -0
  31. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/__version__.py +0 -0
  32. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/auth/__init__.py +0 -0
  33. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/auth/azure_auth.py +0 -0
  34. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/exceptions.py +0 -0
  35. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/models/__init__.py +0 -0
  36. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/models/computed.py +0 -0
  37. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/models/parse_models.py +0 -0
  38. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/parse/dsl_jsonparser.py +0 -0
  39. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/parse/expression.py +0 -0
  40. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/postScript.js +0 -0
  41. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/property_schema.py +0 -0
  42. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/script/__init__.py +0 -0
  43. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/script/js3py.py +0 -0
  44. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/utils/__init__.py +0 -0
  45. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/utils/constants.py +0 -0
  46. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/utils/curl_utils.py +0 -0
  47. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/utils/json_utils.py +0 -0
  48. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/utils/log_utils.py +0 -0
  49. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp/utils/property_util.py +0 -0
  50. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp_test/__init__.py +0 -0
  51. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp_test/__main__.py +0 -0
  52. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp_test/conftest.py +0 -0
  53. {dothttp_req-0.0.44a26 → dothttp_req-0.0.44a28}/dothttp_test/dothttp_test.py +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dothttp-req
3
- Version: 0.0.44a26
3
+ Version: 0.0.44a28
4
4
  Summary: Dothttp is Simple http client for testing and development
5
5
  License: MIT
6
6
  License-File: LICENSE.txt
7
7
  Author: Prasanth
8
8
  Author-email: kesavarapu.siva@gmail.com
9
- Requires-Python: >=3.9,<3.14
9
+ Requires-Python: >=3.9,<3.15
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: OS Independent
12
12
  Classifier: Programming Language :: Python :: 3
@@ -15,8 +15,9 @@ Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
18
19
  Provides-Extra: js
19
- Requires-Dist: faker (==35.2.2)
20
+ Requires-Dist: faker (==37.12.0)
20
21
  Requires-Dist: jsonschema (==4.23.0)
21
22
  Requires-Dist: jstyleson (==0.0.2)
22
23
  Requires-Dist: msal (==1.34.0)
@@ -26,7 +27,7 @@ Requires-Dist: requests (==2.32.5)
26
27
  Requires-Dist: requests-aws4auth (==1.3.1)
27
28
  Requires-Dist: requests-hawk (==1.2.1)
28
29
  Requires-Dist: requests-ntlm (==1.3.0)
29
- Requires-Dist: requests-pkcs12 (==1.25)
30
+ Requires-Dist: requests-pkcs12 (==1.27)
30
31
  Requires-Dist: restrictedpython (==8.1)
31
32
  Requires-Dist: textx (==4.2.3)
32
33
  Requires-Dist: toml (==0.10.2)
@@ -235,7 +235,8 @@ class Http2Postman(RunHttpFileHandler):
235
235
 
236
236
  except BaseException:
237
237
  pass
238
- for index, http in enumerate(http_list.allhttps):
238
+ enumerate_list = list(http_list.allhttps)
239
+ for index, http in enumerate(enumerate_list):
239
240
  try:
240
241
  name = http.namewrap.name if http.namewrap else str(index + 1)
241
242
  config.target = name
@@ -169,13 +169,13 @@ METHODTYPE:
169
169
  | "SEARCH"
170
170
  ;
171
171
 
172
- QUERY:
173
- 'query' '(' key=DotString ',' value=DotString ')'
172
+ QUERY:
173
+ 'query' '(' key=DotString ',' value=TRIPLE_OR_DOUBLE_STRING ')'
174
174
  |('?' | "&") (
175
- '(' key=DotString ',' value=DotString ')'
176
- | key=DotString ',' value=DotString
177
- | key=DotString ':' value=DotString
178
- | key=DotString '=' value=DotString
175
+ '(' key=DotString ',' value=TRIPLE_OR_DOUBLE_STRING ')'
176
+ | key=DotString ',' value=TRIPLE_OR_DOUBLE_STRING
177
+ | key=DotString ':' value=TRIPLE_OR_DOUBLE_STRING
178
+ | key=DotString '=' value=TRIPLE_OR_DOUBLE_STRING
179
179
  )
180
180
  ;
181
181
 
@@ -21,6 +21,11 @@ from requests.auth import HTTPBasicAuth, HTTPDigestAuth
21
21
  from requests.structures import CaseInsensitiveDict
22
22
  from textx import TextXSyntaxError, metamodel_from_file
23
23
 
24
+ try:
25
+ import magic
26
+ except ImportError:
27
+ magic = None
28
+
24
29
  from ..exceptions import *
25
30
  from ..models.computed import *
26
31
  from ..models.parse_models import (
@@ -42,7 +47,7 @@ from ..models.parse_models import (
42
47
  )
43
48
  from ..property_schema import property_schema
44
49
  from ..script import ScriptExecutionJs, ScriptExecutionPython
45
- from ..utils.common import get_real_file_path, triple_or_double_tostring
50
+ from ..utils.common import get_real_file_path, triple_or_double_tostring, single_triple_or_double_tostring
46
51
  from ..utils.constants import *
47
52
  from ..utils.property_util import PropertyProvider, StringFormatPropertyResolver
48
53
  from .dsl_jsonparser import json_or_array_to_json, jsonmodel_to_json
@@ -422,12 +427,12 @@ class HttpDefBase(BaseModelProcessor):
422
427
  for line in parent.lines:
423
428
  if query := line.query:
424
429
  params[self.get_updated_content(query.key)].append(
425
- self.get_updated_content(query.value)
430
+ single_triple_or_double_tostring(query.value, self.get_updated_content)
426
431
  )
427
432
  for line in self.http.lines:
428
433
  if query := line.query:
429
434
  params[self.get_updated_content(query.key)].append(
430
- self.get_updated_content(query.value)
435
+ single_triple_or_double_tostring(query.value, self.get_updated_content)
431
436
  )
432
437
  request_logger.debug(f"computed query params from `{self.file}` are `{params}`")
433
438
  self.httpdef.query = params
@@ -32,7 +32,7 @@ from ..parse import (
32
32
  eprint,
33
33
  )
34
34
  from ..script import ScriptResult
35
- from ..utils.common import apply_quote_or_unquote, quote_or_unquote
35
+ from ..utils.common import apply_quote_or_unquote, quote_or_unquote, single_triple_or_double_tostring
36
36
  from ..utils.curl_utils import to_curl
37
37
  from ..utils.json_utils import JSONEncoder
38
38
  from .dsl_jsonparser import json_or_array_to_json
@@ -371,7 +371,7 @@ class HttpFileFormatter(RequestBase):
371
371
  map(
372
372
  query_to_http,
373
373
  filter(
374
- lambda line: line.query and isinstance(line.query.value, str),
374
+ lambda line: line.query and (isinstance(line.query.value, str) or hasattr(line.query.value, 'triple') or hasattr(line.query.value, 'str')),
375
375
  lines,
376
376
  ),
377
377
  )
@@ -473,8 +473,13 @@ class HttpFileFormatter(RequestBase):
473
473
 
474
474
 
475
475
  def query_to_http(line):
476
- quote_type = quote_or_unquote(line.query.value)[0]
477
- return f"? {quote_type}{line.query.key}{quote_type}= {quote_type}{line.query.value}{quote_type}"
476
+ # Handle TRIPLE_OR_DOUBLE_STRING object
477
+ if hasattr(line.query.value, 'triple') or hasattr(line.query.value, 'str'):
478
+ value_str = single_triple_or_double_tostring(line.query.value, lambda x: x)
479
+ else:
480
+ value_str = line.query.value
481
+ quote_type = quote_or_unquote(value_str)[0]
482
+ return f"? {quote_type}{line.query.key}{quote_type}= {quote_type}{value_str}{quote_type}"
478
483
 
479
484
 
480
485
  class RequestCompiler(RequestBase):
@@ -37,6 +37,17 @@ def triple_or_double_tostring(list_of_triple_or_double, update_content_func):
37
37
  )
38
38
 
39
39
 
40
+ def single_triple_or_double_tostring(triple_or_double, update_content_func):
41
+ """Convert a single TRIPLE_OR_DOUBLE_STRING object to string"""
42
+ if hasattr(triple_or_double, 'triple') and triple_or_double.triple:
43
+ return update_content_func(triple_or_double.triple[3:-3])
44
+ elif hasattr(triple_or_double, 'str') and triple_or_double.str:
45
+ return update_content_func(triple_or_double.str)
46
+ else:
47
+ # This shouldn't happen with proper grammar, but handle edge cases
48
+ return update_content_func(str(triple_or_double))
49
+
50
+
40
51
  def quote_or_unquote(line: str):
41
52
  if '"' in line and "'" in line:
42
53
  return '"', line.replace("'", "\\'")
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "dothttp-req"
3
- version = "0.0.44a26"
3
+ version = "0.0.44a28"
4
4
  description = "Dothttp is Simple http client for testing and development"
5
5
  authors = ["Prasanth <kesavarapu.siva@gmail.com>"]
6
6
  license = "MIT"
@@ -21,16 +21,16 @@ dothttp = 'dothttp.__main__:main'
21
21
 
22
22
 
23
23
  [tool.poetry.dependencies]
24
- python = ">=3.9,<3.14"
24
+ python = ">=3.9,<3.15"
25
25
  jsonschema = "4.23.0"
26
26
  jstyleson = "0.0.2"
27
27
  textx = "4.2.3"
28
- requests-pkcs12 = "1.25"
28
+ requests-pkcs12 = "1.27"
29
29
  parsys-requests-unixsocket = "0.3.2"
30
30
  requests-aws4auth = "1.3.1"
31
31
  requests-ntlm = "1.3.0"
32
32
  restrictedpython = "8.1"
33
- faker = "35.2.2"
33
+ faker = "37.12.0"
34
34
  requests-hawk = "1.2.1"
35
35
  msal = "1.34.0"
36
36
  pyyaml = "6.0.3"