Skip to content

Add support for cursors to LookupResources#57

Merged
jakedt merged 1 commit intoauthzed:mainfrom
josephschorr:lr-cursors
May 2, 2023
Merged

Add support for cursors to LookupResources#57
jakedt merged 1 commit intoauthzed:mainfrom
josephschorr:lr-cursors

Conversation

@josephschorr
Copy link
Copy Markdown
Member

@josephschorr josephschorr commented Apr 28, 2023

Remains backwards compatible because the new fields are optional on the request


// Cursor is used to provide resumption of listing between calls to APIs
// such as LookupResources.
message Cursor {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a message for this or should we just use a string field in the parent message?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like having a message in case we need to make semantics changes to it, like we do for ZedToken

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that's fine since clients will just copying this whole message at a time if they need it.
If they maybe wanted to save it in a db or something, it could help to already just be a string.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's the idea

// before the stream is closed on the server side. By default, the stream will continue
// resolving resources until exhausted or the stream is closed due to the client or a
// network issue.
uint32 optional_limit = 6;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we set a max here too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@josephschorr
Copy link
Copy Markdown
Member Author

Updated

vroldanbet
vroldanbet previously approved these changes May 2, 2023
Copy link
Copy Markdown
Contributor

@vroldanbet vroldanbet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jakedt jakedt merged commit f92a33f into authzed:main May 2, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants