Skip to content

Commit

Permalink
Merge pull request #105 from josephschorr/add-cursors
Browse files Browse the repository at this point in the history
Update for cursor support in LookupResources
  • Loading branch information
josephschorr committed May 3, 2023
2 parents d7e2b7b + 8aa0d09 commit a97bac7
Show file tree
Hide file tree
Showing 9 changed files with 943 additions and 326 deletions.
2 changes: 1 addition & 1 deletion buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S buf generate buf.build/authzed/api:1b83af201dea4437913b2fefe52fdae90d166c9a --template
#!/usr/bin/env -S buf generate buf.build/authzed/api:f92a33fb940f3dcced566d2d33e70d317cd5846c --template
---
version: "v1"
plugins:
Expand Down
28 changes: 26 additions & 2 deletions proto/apidocs.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,15 @@
},
"description": "ContextualizedCaveat represents a reference to a caveat to be used by caveated relationships.\nThe context consists of key-value pairs that will be injected at evaluation time.\nThe keys must match the arguments defined on the caveat in the schema."
},
"v1Cursor": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
},
"description": "Cursor is used to provide resumption of listing between calls to APIs\nsuch as LookupResources."
},
"v1DeleteRelationshipsRequest": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -997,6 +1006,15 @@
"context": {
"type": "object",
"title": "context consists of named values that are injected into the caveat evaluation context *"
},
"optionalLimit": {
"type": "integer",
"format": "int64",
"description": "optional_limit, if non-zero, specifies the limit on the number of resources to return\nbefore the stream is closed on the server side. By default, the stream will continue\nresolving resources until exhausted or the stream is closed due to the client or a\nnetwork issue."
},
"optionalCursor": {
"$ref": "#/definitions/v1Cursor",
"description": "optional_cursor, if specified, indicates the cursor after which results should resume being returned.\nThe cursor can be found on the LookupResourcesResponse object."
}
},
"description": "LookupResourcesRequest performs a lookup of all resources of a particular\nkind on which the subject has the specified permission or the relation in\nwhich the subject exists, streaming back the IDs of those resources."
Expand All @@ -1005,10 +1023,12 @@
"type": "object",
"properties": {
"lookedUpAt": {
"$ref": "#/definitions/v1ZedToken"
"$ref": "#/definitions/v1ZedToken",
"description": "looked_up_at is the ZedToken at which the resource was found."
},
"resourceObjectId": {
"type": "string"
"type": "string",
"description": "resource_object_id is the object ID of the found resource."
},
"permissionship": {
"$ref": "#/definitions/v1LookupPermissionship",
Expand All @@ -1017,6 +1037,10 @@
"partialCaveatInfo": {
"$ref": "#/definitions/v1PartialCaveatInfo",
"title": "partial_caveat_info holds information of a partially-evaluated caveated response"
},
"afterResultCursor": {
"$ref": "#/definitions/v1Cursor",
"description": "after_result_cursor holds a cursor that can be used to resume the LookupResources stream after this\nresult."
}
},
"description": "LookupResourcesResponse contains a single matching resource object ID for the\nrequested object type, permission, and subject."
Expand Down
279 changes: 172 additions & 107 deletions proto/authzed/api/v1/core.pb.go

Large diffs are not rendered by default.

109 changes: 109 additions & 0 deletions proto/authzed/api/v1/core.pb.validate.go

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

155 changes: 155 additions & 0 deletions proto/authzed/api/v1/core_vtproto.pb.go

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

0 comments on commit a97bac7

Please sign in to comment.