Skip to content

Commit 9301ce9

Browse files
gaultierory-bot
authored andcommitted
fix: always retry curl invocations to surmount transient third-party failures
GitOrigin-RevId: b23ca94a4e1ba11367012a70a9e528b614f3ceb9
1 parent ccc5141 commit 9301ce9

File tree

18 files changed

+24
-14
lines changed

18 files changed

+24
-14
lines changed

contrib/docs-code-samples/expand-api-display-access/00-create-tuples/curl.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ files:/photos/mountains.jpg#access@(directories:/photos#access)' | \
1818
keto relation-tuple parse - --format json | \
1919
jq "[ .[] | { relation_tuple: . , action: \"insert\" } ]" -c | \
2020
curl -X PATCH --silent --fail \
21+
--retry 7 --retry-connrefused \
2122
--data @- \
2223
http://127.0.0.1:4467/admin/relation-tuples
2324

contrib/docs-code-samples/expand-api-display-access/01-expand-beach/curl.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -euo pipefail
33

44
curl -G --silent \
5+
--retry 7 --retry-connrefused \
56
--data-urlencode "namespace=files" \
67
--data-urlencode "relation=access" \
78
--data-urlencode "object=/photos/beach.jpg" \

contrib/docs-code-samples/expand-api-display-access/99-cleanup/curl.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,21 @@ export KETO_READ_REMOTE="127.0.0.1:4466"
55
export KETO_WRITE_REMOTE="127.0.0.1:4467"
66

77
curl -G --silent \
8+
--retry 7 --retry-connrefused \
89
--data-urlencode "namespace=files" \
910
http://127.0.0.1:4466/relation-tuples | \
1011
jq "[ .relation_tuples[] | { relation_tuple: . , action: \"delete\" } ]" -c | \
1112
curl -X PATCH --silent --fail \
13+
--retry 7 --retry-connrefused \
1214
--data @- \
1315
http://127.0.0.1:4467/admin/relation-tuples
1416

1517
curl -G --silent \
18+
--retry 7 --retry-connrefused \
1619
--data-urlencode "namespace=directories" \
1720
http://127.0.0.1:4466/relation-tuples | \
1821
jq "[ .relation_tuples[] | { relation_tuple: . , action: \"delete\" } ]" -c | \
1922
curl -X PATCH --silent --fail \
23+
--retry 7 --retry-connrefused \
2024
--data @- \
2125
http://127.0.0.1:4467/admin/relation-tuples

contrib/docs-code-samples/list-api-display-objects/00-create-tuples/curl.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ chats:coffee-break#member@Patrik' | \
1515
keto relation-tuple parse - --format json | \
1616
jq "[ .[] | { relation_tuple: . , action: \"insert\" } ]" -c | \
1717
curl -X PATCH --silent --fail \
18+
--retry 7 --retry-connrefused \
1819
--data @- \
1920
http://127.0.0.1:4467/admin/relation-tuples
2021

contrib/docs-code-samples/list-api-display-objects/01-list-PM/curl.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -euo pipefail
33

44
curl -G --silent \
5+
--retry 7 --retry-connrefused \
56
--data-urlencode "namespace=chats" \
67
--data-urlencode "relation=member" \
78
--data-urlencode "subject_id=PM" \

contrib/docs-code-samples/list-api-display-objects/02-list-coffee-break/curl.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -euo pipefail
33

44
curl -G --silent \
5+
--retry 7 --retry-connrefused \
56
--data-urlencode "namespace=chats" \
67
--data-urlencode "object=coffee-break" \
78
--data-urlencode "relation=member" \

contrib/docs-code-samples/list-api-display-objects/99-cleanup/curl.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ export KETO_READ_REMOTE="127.0.0.1:4466"
55
export KETO_WRITE_REMOTE="127.0.0.1:4467"
66

77
curl -G --silent \
8+
--retry 7 --retry-connrefused \
89
--data-urlencode "namespace=chats" \
910
http://127.0.0.1:4466/relation-tuples | \
1011
jq "[ .relation_tuples[] | { relation_tuple: . , action: \"delete\" } ]" -c | \
1112
curl -X PATCH --silent --fail \
13+
--retry 7 --retry-connrefused \
1214
--data @- \
1315
http://127.0.0.1:4467/admin/relation-tuples

contrib/docs-code-samples/simple-access-check-guide/00-write-direct-access/curl.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ relationtuple='
1010
}'
1111

1212
curl --fail --silent -X PUT \
13+
--retry 7 --retry-connrefused \
1314
--data "$relationtuple" \
1415
http://127.0.0.1:4467/admin/relation-tuples > /dev/null \
1516
&& echo "Successfully created tuple" \

contrib/docs-code-samples/simple-access-check-guide/01-check-direct-access/curl.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -euo pipefail
33

44
curl -G --silent \
5+
--retry 7 --retry-connrefused \
56
--data-urlencode "subject_id=john" \
67
--data-urlencode "relation=decypher" \
78
--data-urlencode "namespace=messages" \

contrib/docs-code-samples/simple-access-check-guide/99-cleanup/curl.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -euo pipefail
33

44
curl -X DELETE -G --silent \
5+
--retry 7 --retry-connrefused \
56
--data-urlencode "subject_id=john" \
67
--data-urlencode "relation=decypher" \
78
--data-urlencode "namespace=messages" \

0 commit comments

Comments
 (0)