mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-23 21:02:24 +02:00
WS API: done ; HTTP API: add secret path '$'
This commit is contained in:
+123
-11
@@ -6,6 +6,129 @@ source ./pulse_lib.sh
|
||||
TOKEN=$(./token.sh claims.json)
|
||||
ZP="00000000-0000-0000-0000-000000000001/TESTS"
|
||||
|
||||
|
||||
echo "--------- if-match ----------"
|
||||
|
||||
put "00000000-0000-0000-0000-000000000001/TESTS" "Value_1" "HULY-TTL: 2"
|
||||
put "00000000-0000-0000-0000-000000000001/TESTS/1" "Value_1" "HULY-TTL: 2"
|
||||
put "00000000-0000-0000-0000-000000000001/TESTS/2" "Value_1" "HULY-TTL: 2"
|
||||
put "00000000-0000-0000-0000-000000000001/TESTS/3$" "Value_1" "HULY-TTL: 2"
|
||||
put "00000000-0000-0000-0000-000000000001/TESTS/3/secret$/4" "Value_1" "HULY-TTL: 2"
|
||||
get "00000000-0000-0000-0000-000000000001/TESTS"
|
||||
get "00000000-0000-0000-0000-000000000001/TESTS/"
|
||||
get "00000000-0000-0000-0000-000000000001/TESTS/3/secret$/"
|
||||
|
||||
|
||||
exit
|
||||
Key
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Key is a string that consists of one or multiple segments separated by ‘/’. Example: foo/bar/baz.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Segment may not contain special characters (‘$’, ‘*’, ‘?’)
|
||||
|
||||
|
||||
|
||||
Key may not end with ‘/’
|
||||
|
||||
|
||||
|
||||
Segment may not be empty
|
||||
|
||||
|
||||
|
||||
Key segment may be private (prefixed with ‘$’)
|
||||
|
||||
|
||||
|
||||
Query
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
May not contain special characters (‘*’, ‘?’)
|
||||
|
||||
|
||||
|
||||
It is possible to use prefix, for listings / subscriptions (prefix ends with segment separator ‘/’)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GET/SUBSCRIBE/.. a/b → single key
|
||||
|
||||
|
||||
|
||||
GET/SUBSCRIBE/.. a/b/c/ → multiple
|
||||
|
||||
|
||||
|
||||
If multiple
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
select all keys starting with prefix
|
||||
|
||||
|
||||
|
||||
skip keys, containing private segments to the right from the prefix
|
||||
|
||||
|
||||
|
||||
example
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1. /a/b/$c/$d, 2. /a/b/c, 3. /a/b/$c, 4. /a/b/$c/$d/e
|
||||
|
||||
|
||||
|
||||
/ → [2]
|
||||
|
||||
|
||||
|
||||
/a/b/ → [2]
|
||||
|
||||
|
||||
|
||||
/a/b/$c/ → [3]
|
||||
|
||||
|
||||
|
||||
/a/b/$c/$d/ → [4]
|
||||
|
||||
|
||||
|
||||
/a/b/$c/$d → (1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
exit
|
||||
|
||||
echo "--------- Deprecated symbols ----------"
|
||||
|
||||
put "00000000-0000-0000-0000-000000000001/'TESTS" "Value_1" "HULY-TTL: 2"
|
||||
put "00000000-0000-0000-0000-000000000001/TES?TS" "Value_1" "HULY-TTL: 2"
|
||||
put "00000000-0000-0000-0000-000000000001/TESTS*" "Value_1" "HULY-TTL: 2"
|
||||
put "00000000-0000-0000-0000-000000000001/TESTS/" "Value_1" "HULY-TTL: 2"
|
||||
|
||||
echo "--------- if-match ----------"
|
||||
|
||||
delete ${ZP}
|
||||
@@ -42,17 +165,6 @@ echo "================> UPDATE PUT If-Match"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
put "00000000-0000-0000-0000-000000000001/TESTS" "Value_1" "HULY-TTL: 3"
|
||||
echo "sleep 1 sec"
|
||||
sleep 1
|
||||
|
||||
Reference in New Issue
Block a user