Skip to content

Commit

Permalink
fix: content type handling
Browse files Browse the repository at this point in the history
  • Loading branch information
hperl committed Jan 3, 2025
1 parent 42d378f commit bd8474f
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ files:/photos/mountains.jpg#access@(directories:/photos#access)' | \
keto relation-tuple parse - --format json | \
jq "[ .[] | { relation_tuple: . , action: \"insert\" } ]" -c | \
curl -X PATCH --silent --fail \
-H 'Content-Type: application/json' \
--data @- \
http://127.0.0.1:4467/admin/relation-tuples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ curl -G --silent \
http://127.0.0.1:4466/relation-tuples | \
jq "[ .relation_tuples[] | { relation_tuple: . , action: \"delete\" } ]" -c | \
curl -X PATCH --silent --fail \
-H 'Content-Type: application/json' \
--data @- \
http://127.0.0.1:4467/admin/relation-tuples

Expand All @@ -17,5 +18,6 @@ curl -G --silent \
http://127.0.0.1:4466/relation-tuples | \
jq "[ .relation_tuples[] | { relation_tuple: . , action: \"delete\" } ]" -c | \
curl -X PATCH --silent --fail \
-H 'Content-Type: application/json' \
--data @- \
http://127.0.0.1:4467/admin/relation-tuples
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ chats:coffee-break#member@Patrik' | \
keto relation-tuple parse - --format json | \
jq "[ .[] | { relation_tuple: . , action: \"insert\" } ]" -c | \
curl -X PATCH --silent --fail \
-H 'Content-Type: application/json' \
--data @- \
http://127.0.0.1:4467/admin/relation-tuples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ curl -G --silent \
http://127.0.0.1:4466/relation-tuples | \
jq "[ .relation_tuples[] | { relation_tuple: . , action: \"delete\" } ]" -c | \
curl -X PATCH --silent --fail \
-H 'Content-Type: application/json' \
--data @- \
http://127.0.0.1:4467/admin/relation-tuples
4 changes: 2 additions & 2 deletions contrib/docs-code-samples/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ relationtuple='
}'

curl --fail --silent -X PUT \
-H 'Content-Type: application/json' \
--data "$relationtuple" \
http://127.0.0.1:4467/admin/relation-tuples > /dev/null \
&& echo "Successfully created tuple" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ curl -X DELETE -G --silent \
--data-urlencode "relation=decypher" \
--data-urlencode "namespace=messages" \
--data-urlencode "object=02y_15_4w350m3" \
-H 'Content-Type: application/json' \
http://127.0.0.1:4467/admin/relation-tuples
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ service CheckService {
}
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
consumes: "application/x-www-form-urlencoded"
consumes: "application/json"
tags: "permission"
responses: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ service ExpandService {
response_body: "tree"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
consumes: "application/x-www-form-urlencoded";
consumes: "application/json"
tags: "permission";
operation_id: "expandPermissions";
responses: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ service NamespacesService {
rpc ListNamespaces(ListNamespacesRequest) returns (ListNamespacesResponse) {
option (google.api.http) = {get: "/namespaces"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
consumes: "application/x-www-form-urlencoded";
tags: "relationship";
operation_id: "listRelationshipNamespaces";
responses: {
Expand Down
1 change: 0 additions & 1 deletion proto/ory/keto/relation_tuples/v1alpha2/read_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ service ReadService {
rpc ListRelationTuples(ListRelationTuplesRequest) returns (ListRelationTuplesResponse) {
option (google.api.http) = {get: "/relation-tuples"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
consumes: "application/x-www-form-urlencoded";
tags: "relationship";
operation_id: "getRelationships";
responses: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ service WriteService {
rpc DeleteRelationTuples(DeleteRelationTuplesRequest) returns (DeleteRelationTuplesResponse) {
option (google.api.http) = {delete: "/admin/relation-tuples"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
consumes: "application/x-www-form-urlencoded";
tags: "relationship";
operation_id: "deleteRelationships";
responses: {
Expand Down

0 comments on commit bd8474f

Please sign in to comment.