Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.0.16 release #71

Merged
merged 215 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
215 commits
Select commit Hold shift + click to select a range
51d916b
prog name
cedric05 Feb 4, 2021
4c01aaa
better error reporting
cedric05 Feb 4, 2021
c16164c
added logging for better tracking
cedric05 Feb 4, 2021
1d20633
in middle of json
cedric05 Feb 4, 2021
df18ea8
more tasks
cedric05 Feb 4, 2021
0b84761
json payload complete
cedric05 Feb 4, 2021
2123b26
in middle of adding tests
cedric05 Feb 5, 2021
8188dec
allow comments in json for property file
cedric05 Feb 5, 2021
cf46e37
added few simple test cases.
cedric05 Feb 5, 2021
31b8903
json test cases. need to add substituion tests
cedric05 Feb 5, 2021
e136010
`python -m unittest` will test all
cedric05 Feb 5, 2021
0e305f2
substitution tests complete. need to work on json comments.
cedric05 Feb 5, 2021
a4eb84c
substitution tests complete
cedric05 Feb 6, 2021
e4ea127
few fixes
cedric05 Feb 6, 2021
3695f6b
added placeholder for tests.
cedric05 Feb 6, 2021
f4acb9b
added placeholder for tests.
cedric05 Feb 6, 2021
962953f
fix bugs found by tests
cedric05 Feb 7, 2021
7fccbd3
info logs
cedric05 Feb 7, 2021
b39af20
command line property error
cedric05 Feb 7, 2021
e8e9527
basic auth, cookie
cedric05 Feb 7, 2021
3907164
in middle of installable package
cedric05 Feb 7, 2021
661be4e
dothttp-cli installable package, single file, folder
cedric05 Feb 7, 2021
faf54bd
docker publish to github
cedric05 Feb 7, 2021
a3913bb
update workflow
cedric05 Feb 7, 2021
543f4ec
fix name
cedric05 Feb 7, 2021
b5e78a3
release to github
cedric05 Feb 7, 2021
4cb6c22
formatter
cedric05 Feb 7, 2021
51cf8a6
Merge branch 'master' of github.com:cedric05/dothttp into dev
cedric05 Feb 7, 2021
1abb480
fix tests
cedric05 Feb 7, 2021
2ee33aa
json format fix
cedric05 Feb 7, 2021
3ca354c
stdout for formatting. grouping commandline args.
cedric05 Feb 7, 2021
728b53e
- default headers defined in prop file
cedric05 Feb 7, 2021
daf6143
fixed few tasks from #4
cedric05 Feb 7, 2021
cce9a22
fix formatting for data section when input is json
cedric05 Feb 7, 2021
cb7eac4
in middle of pyoxidizer
cedric05 Feb 8, 2021
47ca9c3
property validation, json file validation, cookie save failure proceed
cedric05 Feb 9, 2021
9e00f6a
whitespace is ignored, unless specified in quotes.
cedric05 Feb 9, 2021
d854def
readme and bug fix for propertys
cedric05 Feb 9, 2021
a49cc62
Merge branch 'master' of github.com:cedric05/dothttp into dev
cedric05 Feb 9, 2021
c8bac1b
add few unit tests
cedric05 Feb 9, 2021
07a9e43
add tests, few are more direct need to add more assertions
cedric05 Feb 10, 2021
7ad881f
test output of curl and formatter.
cedric05 Feb 10, 2021
e3aa806
Update Dockerfile
cedric05 Feb 10, 2021
858ce78
using multiple files, pyinstaller, workable in most unix
cedric05 Feb 10, 2021
dc20348
windows docker file
cedric05 Feb 10, 2021
37cba7a
formatter has issues with comments. need to rewrite from beginning
cedric05 Feb 11, 2021
fba27ef
few formatting fixes
cedric05 Feb 11, 2021
8194341
extension link
cedric05 Feb 11, 2021
50f5a75
pipfile
cedric05 Feb 11, 2021
e056b14
bugs reporting
cedric05 Feb 11, 2021
9f04e91
fix query params bug
cedric05 Feb 11, 2021
7a23b1a
added substituion tests
cedric05 Feb 11, 2021
58acf92
fix bugs found via test cases
cedric05 Feb 11, 2021
801c32c
Merge branch 'master' of github.com:cedric05/dothttp into dev
cedric05 Feb 12, 2021
f94f7c0
bug with multiple substitutions
cedric05 Feb 12, 2021
e3b824e
Merge branch 'dev' of dothttp-git.org:cedric05/dothttp into dev
cedric05 Feb 12, 2021
cddd387
print output path
cedric05 Feb 12, 2021
c304828
experimental phase, of string matching
cedric05 Feb 12, 2021
d83bf3a
alphanumeric then write normally otherwise go for double or single qu…
cedric05 Feb 12, 2021
28b8dce
http file issue
cedric05 Feb 12, 2021
313b1ed
fix github actions
cedric05 Feb 12, 2021
a7dcfab
Update TASKS.md
cedric05 Feb 14, 2021
4085c89
formatter has issues with comments. need to rewrite from beginning
cedric05 Feb 14, 2021
5ffdb4a
Merge branch 'dev' of github.com:cedric05/dothttp into dev
cedric05 Feb 14, 2021
a03cfb0
update version
cedric05 Feb 14, 2021
646b7e4
setup.py fix requirements, add console package
cedric05 Feb 14, 2021
cf7c117
setup.py fix requirements, add console package
cedric05 Feb 14, 2021
2e903f9
Merge branch 'dev' of github.com:cedric05/dothttp into dev
cedric05 Feb 14, 2021
dc315c0
update README.md
cedric05 Feb 14, 2021
174e8c9
Merge branch 'master' of github.com:cedric05/dothttp into dev
cedric05 Feb 14, 2021
ba76f07
platform specific
cedric05 Feb 14, 2021
5c793a4
platform specific
cedric05 Feb 14, 2021
f2346b5
next steps
cedric05 Feb 15, 2021
ee841eb
initial extension phase
cedric05 Feb 15, 2021
b13e111
added error handling in response
cedric05 Feb 16, 2021
3018e84
naming requests, only useful in ide
cedric05 Feb 16, 2021
6ef861b
multiple requests in same file, although i prefer not to have in that…
cedric05 Feb 18, 2021
a3de749
fix exception message
cedric05 Feb 18, 2021
2293741
trailing ',' are allowed now in data and json. so, no problem comment…
cedric05 Feb 18, 2021
0bcf115
add license (#8)
cedric05 Feb 19, 2021
3be22a9
calling http.http is bad, changed it to urlwrap and adding trailing '…
cedric05 Feb 19, 2021
82f7048
on error, return error. flush right after writing to cmdline (helpful…
cedric05 Feb 19, 2021
934c664
added error handling in response
cedric05 Feb 20, 2021
77cd02a
Merge branch 'dev' of github.com:cedric05/dothttp into dev
cedric05 Feb 20, 2021
1c047a6
fix conflicsts
cedric05 Feb 20, 2021
5820e9b
target tests
cedric05 Feb 21, 2021
53e2b2f
better messaging
cedric05 Feb 21, 2021
621d5b2
trailing commas are ok with dothttp [tests]
cedric05 Feb 21, 2021
889f28b
added tests to commands
cedric05 Feb 21, 2021
2c4f00e
[bug] target id starts with 0
cedric05 Feb 22, 2021
29f2b71
allow curl
cedric05 Feb 24, 2021
14fd5e2
tasks
cedric05 Feb 24, 2021
3fdc9b8
threading
cedric05 Feb 24, 2021
3d34844
multi line curl and easy sharable file
cedric05 Feb 26, 2021
403e8f5
check for similar names
cedric05 Feb 26, 2021
6c93c38
added resources
cedric05 Feb 26, 2021
75d5abb
fix tests
cedric05 Feb 26, 2021
e82f4e0
validate name is working now
cedric05 Feb 26, 2021
c2550e7
fix multipart payload with actual data
cedric05 Feb 26, 2021
8e6aa33
using typings for models, helpful for debugging and working
cedric05 Feb 26, 2021
7dd4503
add models
cedric05 Feb 26, 2021
4142627
added tests for more scenarios
cedric05 Feb 27, 2021
f27a905
Merge branch 'main' of github.com:cedric05/dothttp into dev
cedric05 Feb 27, 2021
813152a
better example
cedric05 Feb 27, 2021
3d64987
Merge branch 'main' of github.com:cedric05/dothttp into dev
cedric05 Feb 27, 2021
1d430aa
update version
cedric05 Feb 27, 2021
fcb3f15
update version
cedric05 Feb 27, 2021
61ee190
Update README.md
cedric05 Feb 27, 2021
6757d83
Merge branch 'cedric05-patch-1' of dothttp-git.org:cedric05/dothttp i…
cedric05 Feb 27, 2021
195f26c
variable need not have to be defined first time
cedric05 Feb 28, 2021
c51ea33
Merge branch 'dev' of github.com:cedric05/dothttp into dev
cedric05 Feb 28, 2021
a5b105c
Merge branch 'main' of github.com:cedric05/dothttp into dev
cedric05 Feb 28, 2021
48309d7
install flask only when needed, os specific tests
cedric05 Mar 1, 2021
1dbf9d7
postman import complete. currently file creation is done in server side
cedric05 Mar 3, 2021
b10d61c
Fixes #21 #22 #18 #23
cedric05 Mar 3, 2021
26def7e
postman unquote values
cedric05 Mar 5, 2021
2a5f8e9
swagger schema
cedric05 Mar 5, 2021
e3af759
var string
cedric05 Mar 5, 2021
58174c0
var string
cedric05 Mar 5, 2021
3ed8798
fix todos
cedric05 Mar 5, 2021
4a5e114
move json parsing out of core logic
cedric05 Mar 5, 2021
6645adf
fix json key var
cedric05 Mar 5, 2021
b3a4a1d
added test and fixes #27 #28
cedric05 Mar 6, 2021
60714e1
Merge pull request #29 from cedric05/properties_perhttp
cedric05 Mar 6, 2021
0ab8571
#15 postman improvements
cedric05 Mar 6, 2021
d354958
libmagic is not must
cedric05 Mar 6, 2021
d0ec66a
goal rewamp
cedric05 Mar 6, 2021
a7a9f2a
Merge branch 'dev' of dothttp-git.org:cedric05/dothttp into dev
cedric05 Mar 6, 2021
bb9e602
generate http from requests
cedric05 Mar 6, 2021
b44f4e6
fix line endings
cedric05 Mar 6, 2021
6610eb5
fix $
cedric05 Mar 6, 2021
bbb9ad9
fix readme
cedric05 Mar 6, 2021
17bcb49
version update
cedric05 Mar 6, 2021
e5bec29
send updated http def
cedric05 Mar 6, 2021
8bbd70c
subs test on each section.
cedric05 Mar 6, 2021
f3ac7fa
remove flask
cedric05 Mar 7, 2021
1a6e31f
update
cedric05 Mar 7, 2021
ab89f20
#24 provide random properties complete. adding tests pending
cedric05 Mar 17, 2021
28d632c
example update
cedric05 Mar 17, 2021
2dc3cdc
update version and schema
cedric05 Mar 17, 2021
7638006
added tests for random
cedric05 Mar 18, 2021
2a1076f
fixes #32
cedric05 Mar 18, 2021
072da0c
allow properties to have more than one equals
cedric05 Mar 18, 2021
79e970a
[Feature] allow env variables to have json vaule #33
cedric05 Mar 18, 2021
a485549
fix tests
cedric05 Mar 19, 2021
476c6a4
added tests for env with json structure
cedric05 Mar 19, 2021
bdaa2e8
Merge branch 'main' of dothttp-git.org:cedric05/dothttp into dev
cedric05 Mar 20, 2021
bace246
Merge branch 'main' of dothttp-git.org:cedric05/dothttp into dev
cedric05 Mar 20, 2021
d60ca6c
value with templates in randomstring
cedric05 Mar 21, 2021
708b9e9
better outline
cedric05 Mar 22, 2021
fc1452b
fixes https://github.com/cedric05/dothttp-runner/issues/31
cedric05 Mar 23, 2021
29b80d3
content execute
cedric05 Mar 24, 2021
afb3fa3
fixes #37
cedric05 Mar 24, 2021
54e618f
query started having `[` `]` in the generated httpdef
cedric05 Mar 24, 2021
619a583
fix input issue
cedric05 Mar 24, 2021
ef9b3d1
wasm first steps
cedric05 Mar 25, 2021
51429e1
loadable dothttp in wasm
cedric05 Mar 26, 2021
935f839
import fix
cedric05 Mar 27, 2021
f830b79
provide url information, for symbols request
cedric05 Mar 27, 2021
1f63013
remove unused
cedric05 Mar 27, 2021
61e7a80
Merge branch 'main' of github.com:cedric05/dothttp into dev
cedric05 Mar 27, 2021
92f4a26
Merge branch 'main' of github.com:cedric05/dothttp into dev
cedric05 Mar 27, 2021
a541957
apply patches with version is not working fixed
cedric05 Mar 28, 2021
228587e
temporarly disable mimetype for data part of multipart upload.
cedric05 Mar 29, 2021
5c41b0c
fix running tests, added tests for content execute
cedric05 Apr 1, 2021
bd4582d
added tests for postman
cedric05 Apr 1, 2021
85d370c
Merge pull request #44 from cedric05/issue/38
cedric05 Apr 1, 2021
d156311
include version in command
cedric05 Apr 2, 2021
3b7ccbe
Merge pull request #47 from cedric05/issue/38
cedric05 Apr 2, 2021
8171f45
Merge pull request #49 from cedric05/main
cedric05 Apr 3, 2021
bb8ffc3
Merge branch 'main' of github.com:cedric05/dothttp into dev
cedric05 Apr 3, 2021
e392d25
run postimport tests for all variants
cedric05 Apr 3, 2021
73f4428
#50 provide api to parsed structure
cedric05 Apr 4, 2021
fb7f130
fix tests
cedric05 Apr 4, 2021
64c4dc6
fix multipart file har generation failed
cedric05 Apr 5, 2021
2f2583d
Bump urllib3 from 1.26.3 to 1.26.4
dependabot[bot] Apr 6, 2021
571695f
Update requirements.txt
cedric05 Apr 7, 2021
20640a6
Merge pull request #52 from cedric05/dependabot/pip/urllib3-1.26.4
cedric05 Apr 7, 2021
e1aa296
version update
cedric05 Apr 9, 2021
c7765a1
Merge branch 'dev' of github.com:cedric05/dothttp into dev
cedric05 Apr 9, 2021
01ec68b
Merge branch 'main' of github.com:cedric05/dothttp into dev
cedric05 Apr 9, 2021
adee6cc
mime type not included
cedric05 Apr 10, 2021
311c7b7
fix tests
cedric05 Apr 10, 2021
160cb00
fix tests
cedric05 Apr 10, 2021
0c4cf52
Create Dockerfile
cedric05 Apr 11, 2021
407c984
no escape quoted string for data payload in httpdef #54
cedric05 Apr 11, 2021
d42df65
Merge remote-tracking branch 'origin/dev' into dev
cedric05 Apr 11, 2021
7c2a23c
no escape quoted string for data payload in httpdef #54
cedric05 Apr 12, 2021
9ab5f41
lazy ','
cedric05 Apr 12, 2021
3cf7378
Merge main into dev
cedric05 Apr 12, 2021
926712a
Merge branch 'dev' of github.com:cedric05/dothttp into dev
cedric05 Apr 12, 2021
f7c9e4b
json substition with multiline
cedric05 Apr 14, 2021
c135065
Merge branch 'main' of github.com:cedric05/dothttp into dev
cedric05 Apr 17, 2021
758352e
Merge branch 'main' of github.com:cedric05/dothttp into dev
cedric05 Apr 17, 2021
d4b524d
Merge branch 'main' of github.com:cedric05/dothttp into dev
cedric05 Apr 17, 2021
f5cb137
generate curl should print in multi line #59
cedric05 Apr 19, 2021
155a732
update curl request
cedric05 Apr 19, 2021
77f1f60
Multipart add content-type for files according to file extension #61
cedric05 Apr 21, 2021
441c13a
fix failing tests
cedric05 Apr 21, 2021
56ba254
Bump autopep8 from 1.5.5 to 1.5.6 (#55)
dependabot-preview[bot] Apr 21, 2021
b4c3d44
Bump ipython from 7.20.0 to 7.22.0 (#56)
dependabot-preview[bot] Apr 21, 2021
7d99a72
Bump python-magic from 0.4.18 to 0.4.22 (#57)
dependabot-preview[bot] Apr 21, 2021
76489d1
Bump pyinstaller from 4.2 to 4.3 (#60)
dependabot-preview[bot] Apr 21, 2021
b7882a0
Merge branch 'main' of dothttp-git.org:cedric05/dothttp into dev
cedric05 Apr 26, 2021
b0973cf
header is not generated for curl generation
cedric05 May 1, 2021
1e9a6c9
fix issue with content execute https://github.com/cedric05/dothttp-ru…
cedric05 May 3, 2021
73616fb
self.file (simple hack for now)
cedric05 May 3, 2021
b1f4346
content names
cedric05 May 8, 2021
836227e
content name handler
cedric05 May 8, 2021
243626d
Merge branch 'main' of github.com:cedric05/dothttp into dev
cedric05 May 8, 2021
152db9a
fix regression of names
cedric05 May 8, 2021
5069fc0
0.0.16 version
cedric05 May 8, 2021
ddb9b2a
include method
cedric05 May 10, 2021
e3c7964
multiline in json
cedric05 May 13, 2021
055bdaa
randomStr substitute not working fixed
cedric05 May 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion dotextensions/server/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ def get_request_result(self, command, comp):
"headers":
{key: value for key, value in resp.headers.items()},
"body": resp.text, # for binary out, it will fail, check for alternatives
"status": resp.status_code, "url": resp.url}
"status": resp.status_code,
"method": resp.request.method,
"url": resp.url}
}
# will be used for response
data = {}
Expand Down Expand Up @@ -236,6 +238,9 @@ def parse_n_get(self, http_data):
class ContentNameReferencesHandler(GetNameReferencesHandler):
name = "/content/names"

def get_method(self):
return ContentNameReferencesHandler.name

def execute(self, command, filename):
http_data = command.params.get("content", "")
all_names, all_urls = self.parse_n_get(http_data)
Expand Down
2 changes: 1 addition & 1 deletion dothttp/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.0.15'
__version__ = '0.0.16'
7 changes: 6 additions & 1 deletion dothttp/dsl_jsonparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,19 @@ def json_or_array_to_json(model, update_content_func) -> Union[Dict, List]:
def get_key(member, update_content_func):
if member.key:
return update_content_func(member.key)
return update_content_func(member.var)
elif member.var:
return update_content_func(member.var)
else:
return update_content_func(member.multi[3:-3])


def jsonmodel_to_json(model, update_content_func):
if str_value := model.str:
return update_content_func(str_value.value)
elif var_value := model.var:
return get_json_data(var_value, update_content_func)
elif multi_value := model.multi:
return get_json_data(multi_value[3:-3], update_content_func)
elif flt := model.flt:
return flt.value
elif bl := model.bl:
Expand Down
5 changes: 3 additions & 2 deletions dothttp/http.tx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Array:
;

Value:
str=String | var=VarString | flt=Float | bl=Bool | object=Object | array=Array | null="null"
multi=MULTILINE_STRING | str=String | var=VarString | flt=Float | bl=Bool | object=Object | array=Array | null="null"
;


Expand All @@ -98,6 +98,7 @@ Object:
;

Member:
(multi=MULTILINE_STRING ':' value=Value) |
(key=STRING ':' value=Value) |
(var=VarString ':' value=Value)
;
Expand Down Expand Up @@ -125,7 +126,7 @@ DotString:
// allow only alphanumeric or string in double/single quotes

MULTILINE_STRING:
/"""[\S\s]*"""/ | /'''[\S\s]*'''/
/"""[\S\s]*?"""/ | /'''[\S\s]*?'''/

;

Expand Down
2 changes: 1 addition & 1 deletion dothttp/property_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class PropertyProvider:
random = Random()
var_regex = re.compile(r'{{(?P<var>.*?)}}', re.DOTALL)
random_string_regex = re.compile(
r'(?P<category>\$randomStr|\$randomInt|\$randomBool|\$randomFloat)(?P<length>:\d*)?')
r'.*?(?P<category>\$randomStr|\$randomInt|\$randomBool|\$randomFloat)(?P<length>:\d*)?')

rand_map = {
'$randomStr': get_random_str,
Expand Down
40 changes: 40 additions & 0 deletions test/core/payload/multilinejson.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@name("simple1")
POST https://httpbin.org/post
json({
"simple": """test"""
})

@name("simple2")
POST https://httpbin.org/post
json({
"simple": '''test'''
})


@name("withquotes")
POST https://httpbin.org/post
json({
"simple": '''
test
"simple 1"
'simple 2'
''simple 3''
""simple 4""

'''
})



@name("withquoteskey")
POST https://httpbin.org/post
json({
"""simple""": '''
test
"simple 1"
'simple 2'
''simple 3''
""simple 4""

'''
})
14 changes: 12 additions & 2 deletions test/core/test_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,26 @@ def test_multipart_payload(self):
loadfile.close()
os.unlink(loadfile.name)

def test_data_json_payload(self):
def test_data_multi_payload(self):
req = self.get_request(f"{base_dir}/quoted.http")
self.assertEqual("""
"'this can have quotes with escape sequence'"

""", req.body)

def test_data_json_payload(self):
def test_data_multi2_payload(self):
req = self.get_request(f"{base_dir}/quoted2.http")
self.assertEqual("""
"'this can have quotes with escape sequence'"

""", req.body)

def test_multi_in_json_payload(self):
self.assertEqual(b'{"simple": "test"}', self.get_request(f"{base_dir}/multilinejson.http", target='1').body)
self.assertEqual(b'{"simple": "test"}', self.get_request(f"{base_dir}/multilinejson.http", target="2").body)
self.assertEqual(b'{"simple": "\\ntest\\n\\"simple 1\\"\\n\'simple 2\'\\n\'\'simple 3\'\'\\n'
b'\\"\\"simple 4\\"\\"\\n\\n"}',
self.get_request(f"{base_dir}/multilinejson.http", target="3").body)
self.assertEqual(b'{"simple": "\\ntest\\n\\"simple 1\\"\\n\'simple 2\'\\n\'\'simple 3\'\'\\n'
b'\\"\\"simple 4\\"\\"\\n\\n"}',
self.get_request(f"{base_dir}/multilinejson.http", target="4").body)