Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for cursors to LookupResources #57

Merged
merged 1 commit into from
May 2, 2023

Conversation

josephschorr
Copy link
Member

@josephschorr josephschorr commented Apr 28, 2023

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

@@ -76,6 +76,15 @@ message ZedToken {
} ];
}

// Cursor is used to provide resumption of listing between calls to APIs
// such as LookupResources.
message Cursor {
Copy link
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
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
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
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
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
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
Member Author

Updated

vroldanbet
vroldanbet previously approved these changes May 2, 2023
Copy link
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