Skip to content

Commit

Permalink
Update API ref (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris authored Nov 12, 2024
2 parents aeff213 + f5fd92e commit e4bfdff
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Main config
OPENFGA_DOCKER_TAG = v1.5.3
OPEN_API_REF ?= 7e5be7b65c273bdcbddb7b88e98a9b7495effa05
OPENFGA_DOCKER_TAG = v1.7.0
OPEN_API_REF ?= 30477608a587fbebea8940129703c11238530f71
OPEN_API_URL = https://raw.githubusercontent.com/openfga/api/${OPEN_API_REF}/docs/openapiv2/apidocs.swagger.json
OPENAPI_GENERATOR_CLI_DOCKER_TAG = v6.4.0
NODE_DOCKER_TAG = 20-alpine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public class OpenFgaApiIntegrationTest {
// Then
String responseJson = mapper.writeValueAsString(response.getAssertions());
assertEquals(
"[{\"tuple_key\":{\"object\":\"document:2021-budget\",\"relation\":\"reader\",\"user\":\"user:81684243-9356-4421-8fbf-a4f8d36aa31b\"},\"expectation\":true}]",
"[{\"tuple_key\":{\"object\":\"document:2021-budget\",\"relation\":\"reader\",\"user\":\"user:81684243-9356-4421-8fbf-a4f8d36aa31b\"},\"expectation\":true,\"contextual_tuples\":[],\"context\":null}]",
responseJson);
}

Expand Down
2 changes: 1 addition & 1 deletion config/clients/java/template/OpenFgaApiTest.java.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@ public class OpenFgaApiTest {
String putUrl =
"https://api.fga.example/stores/01YCP46JKYM8FJCQ37NMBYHE5X/assertions/01G5JAVJ41T49E9TT3SKVS7X1J";
String expectedBody = String.format(
"{\"assertions\":[{\"tuple_key\":{\"object\":\"%s\",\"relation\":\"%s\",\"user\":\"%s\"},\"expectation\":true}]}",
"{\"assertions\":[{\"tuple_key\":{\"object\":\"%s\",\"relation\":\"%s\",\"user\":\"%s\"},\"expectation\":true,\"contextual_tuples\":[],\"context\":null}]}",
DEFAULT_OBJECT, DEFAULT_RELATION, DEFAULT_USER);
mockHttpClient.onPut(putUrl).withBody(is(expectedBody)).doReturn(200, EMPTY_RESPONSE_BODY);
WriteAssertionsRequest request = new WriteAssertionsRequest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public class OpenFgaClientIntegrationTest {
// Then
String responseJson = mapper.writeValueAsString(response.getAssertions());
assertEquals(
"[{\"tuple_key\":{\"object\":\"document:2021-budget\",\"relation\":\"reader\",\"user\":\"user:81684243-9356-4421-8fbf-a4f8d36aa31b\"},\"expectation\":true}]",
"[{\"tuple_key\":{\"object\":\"document:2021-budget\",\"relation\":\"reader\",\"user\":\"user:81684243-9356-4421-8fbf-a4f8d36aa31b\"},\"expectation\":true,\"contextual_tuples\":[],\"context\":null}]",
responseJson);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2516,7 +2516,7 @@ public class OpenFgaClientTest {
String putUrl = String.format(
"https://api.fga.example/stores/%s/assertions/%s", DEFAULT_STORE_ID, DEFAULT_AUTH_MODEL_ID);
String expectedBody = String.format(
"{\"assertions\":[{\"tuple_key\":{\"object\":\"%s\",\"relation\":\"%s\",\"user\":\"%s\"},\"expectation\":true}]}",
"{\"assertions\":[{\"tuple_key\":{\"object\":\"%s\",\"relation\":\"%s\",\"user\":\"%s\"},\"expectation\":true,\"contextual_tuples\":[],\"context\":null}]}",
DEFAULT_OBJECT, DEFAULT_RELATION, DEFAULT_USER);
mockHttpClient.onPut(putUrl).withBody(is(expectedBody)).doReturn(200, EMPTY_RESPONSE_BODY);
List<ClientAssertion> assertions = List.of(new ClientAssertion()
Expand Down
2 changes: 0 additions & 2 deletions config/clients/python/template/test/api_test.py.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ class {{#operations}}Test{{classname}}(IsolatedAsyncioTestCase):
relation="can_read",
user_filters=[
{"type": "user"},
{"type": "team", "relation": "member"},
],
context={},
contextual_tuples=[
Expand Down Expand Up @@ -478,7 +477,6 @@ class {{#operations}}Test{{classname}}(IsolatedAsyncioTestCase):
"relation": "can_read",
"user_filters": [
{"type": "user"},
{"type": "team", "relation": "member"},
],
"context": {},
"contextual_tuples": [
Expand Down
2 changes: 0 additions & 2 deletions config/clients/python/template/test/sync/api_test.py.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,6 @@ class TestOpenFgaApiSync(IsolatedAsyncioTestCase):
request.relation = "can_read"
request.user_filters = [
{"type": "user"},
{"type": "team", "relation": "member"},
]
request.context = {}
request.contextual_tuples = [
Expand Down Expand Up @@ -484,7 +483,6 @@ class TestOpenFgaApiSync(IsolatedAsyncioTestCase):
"relation": "can_read",
"user_filters": [
{"type": "user"},
{"type": "team", "relation": "member"},
],
"context": {},
"contextual_tuples": [
Expand Down

0 comments on commit e4bfdff

Please sign in to comment.