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

Add sample handler and docs for non-JSON body #977

Merged
merged 60 commits into from
Mar 23, 2020
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
0d2612e
Return handlers from install
eddyashton Mar 17, 2020
d50db07
Set some fields _after_ install
eddyashton Mar 17, 2020
c4725b5
Add setter methods
eddyashton Mar 17, 2020
3942aeb
set_auto_schema as a method
eddyashton Mar 17, 2020
92573d0
Remove use of install_with_auto_schema
eddyashton Mar 17, 2020
ff77000
Remove install_with_auto_schema
eddyashton Mar 17, 2020
64d71af
Missed some
eddyashton Mar 17, 2020
867c3e6
Merge branch 'master' into simple_install_signature
eddyashton Mar 17, 2020
5b30275
Document Handler& return
eddyashton Mar 17, 2020
1e69b7c
SNIPPETs for install_get
eddyashton Mar 17, 2020
4761ed1
Add initial verb restrictions adapters
eddyashton Mar 17, 2020
5ba0963
Add ALLOW header, sort headers
eddyashton Mar 17, 2020
afa26c9
Unit test for verb restrictions
eddyashton Mar 17, 2020
93f7c68
Merge branch 'master' into verb_selection
eddyashton Mar 17, 2020
5de1570
Ignore body of GETs
eddyashton Mar 18, 2020
652fa4d
Fix whitespace
eddyashton Mar 18, 2020
f395cee
params are moveable!
eddyashton Mar 18, 2020
55fb9c8
who_am_i is get_only
eddyashton Mar 18, 2020
f45d5df
Specify verb for Python clients
eddyashton Mar 19, 2020
df61440
Neater formatting
eddyashton Mar 19, 2020
624dc75
Make some more endpoints get-only
eddyashton Mar 19, 2020
1284226
Remove some empty params, add GETs
eddyashton Mar 19, 2020
a52a6cc
Replace .do with .rpc
eddyashton Mar 19, 2020
d96abfd
add client.get
eddyashton Mar 19, 2020
88bafe7
Bite the bullet - add a url-unescaper
eddyashton Mar 19, 2020
17cb907
Unescape queries, test
eddyashton Mar 19, 2020
fffd835
Send escaped query URLs
eddyashton Mar 19, 2020
c678899
getCommit from Python is now a GET
eddyashton Mar 19, 2020
3f8ee8e
getQuotes is GET-only
eddyashton Mar 19, 2020
71c10cc
get-only is a Handler-method, not an adapter
eddyashton Mar 19, 2020
c7074b6
Match uses of GET
eddyashton Mar 19, 2020
7f90438
Remove more empty params
eddyashton Mar 19, 2020
393e9be
?
eddyashton Mar 19, 2020
927ba26
Correctly format query in canonicalisation!
eddyashton Mar 19, 2020
1a70e89
Whoops
eddyashton Mar 19, 2020
ac11b56
Merge remote-tracking branch 'origin' into verb_selection
eddyashton Mar 19, 2020
b894098
Fix elections tests
eddyashton Mar 20, 2020
d62a239
Use bit mask to represent allowed verbs
eddyashton Mar 20, 2020
a679881
Compiles
eddyashton Mar 20, 2020
03e0dcf
Check that failing verbs AREN'T included in ALLOW header
eddyashton Mar 20, 2020
dbf7a6f
Merge remote-tracking branch 'origin' into verb_selection
eddyashton Mar 20, 2020
abecc8a
Merge branch 'master' into verb_selection
eddyashton Mar 20, 2020
8e9408c
Use timeout!
eddyashton Mar 20, 2020
d16eb8b
Add log_record_text (non-JSON body)
eddyashton Mar 20, 2020
0106126
Install
eddyashton Mar 20, 2020
a0b1bb6
Basic test
eddyashton Mar 20, 2020
f8b210c
Merge branch 'master' into non_json_body_sample
eddyashton Mar 23, 2020
9509fea
Support header-defined payload-types through clients.py
eddyashton Mar 23, 2020
71defbb
Update docs
eddyashton Mar 23, 2020
1811f18
Grammar fixes
eddyashton Mar 23, 2020
3391a43
Re-enable other logging tests
eddyashton Mar 23, 2020
a3539d1
Merge branch 'master' into non_json_body_sample
eddyashton Mar 23, 2020
95aa75b
LOG_gets are GET-only
eddyashton Mar 23, 2020
a4d39cb
Merge branch 'master' into non_json_body_sample
eddyashton Mar 23, 2020
58df585
Fix scenario test
eddyashton Mar 23, 2020
5dd463f
Set return type for jsgeneric
eddyashton Mar 23, 2020
6d94ae5
Pass query to JS
eddyashton Mar 23, 2020
4102995
LOG_get in JS parses query
eddyashton Mar 23, 2020
3786baa
Merge branch 'master' into non_json_body_sample
eddyashton Mar 23, 2020
1487f5c
Formatting
eddyashton Mar 23, 2020
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
Prev Previous commit
Next Next commit
Match uses of GET
eddyashton committed Mar 19, 2020
commit c7074b608ea4609877fd02cb535e5c519a589f8a
3 changes: 2 additions & 1 deletion src/node/rpc/commonhandlerregistry.h
Original file line number Diff line number Diff line change
@@ -264,7 +264,8 @@ namespace ccf
.set_auto_schema<GetSchema>()
.set_http_get_only();
install(GeneralProcs::GET_RECEIPT, json_adapter(get_receipt), Read)
.set_auto_schema<GetReceipt>();
.set_auto_schema<GetReceipt>()
.set_http_get_only();
install(GeneralProcs::VERIFY_RECEIPT, json_adapter(verify_receipt), Read)
.set_auto_schema<VerifyReceipt>();
}
2 changes: 1 addition & 1 deletion tests/infra/ccf.py
Original file line number Diff line number Diff line change
@@ -371,7 +371,7 @@ def wait_for_state(self, node, state, timeout=3):
for _ in range(timeout):
try:
with node.node_client() as c:
r = c.request("getSignedIndex", {})
r = c.get("getSignedIndex")
if r.result["state"] == state:
break
except ConnectionRefusedError:
2 changes: 1 addition & 1 deletion tests/receipts.py
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ def test(network, args, notifications_queue=None):
check_commit(c.rpc("LOG_record", {"id": 42, "msg": msg}), result=True)
r = c.rpc("LOG_get", {"id": 42})
check(r, result={"msg": msg})
r = c.rpc("getReceipt", {"commit": r.commit})
r = c.get("getReceipt", {"commit": r.commit})
check(
c.rpc("verifyReceipt", {"receipt": r.result["receipt"]}),
result={"valid": True},