Skip to content

perms: add support for cursor and show-cursor flags in lookup resources#485

Merged
tstirrat15 merged 2 commits intoauthzed:mainfrom
kartikaysaxena:support-cursor-for-lookup-resources
Apr 22, 2025
Merged

perms: add support for cursor and show-cursor flags in lookup resources#485
tstirrat15 merged 2 commits intoauthzed:mainfrom
kartikaysaxena:support-cursor-for-lookup-resources

Conversation

@kartikaysaxena
Copy link
Copy Markdown
Contributor

@kartikaysaxena kartikaysaxena commented Apr 1, 2025

Related #482

Adds support for displaying the last cursor when the user opts in a show-cursor flag, also allows user to use a custom cursor to resume browsing the pages from a specific state using a cursor flag

@kartikaysaxena kartikaysaxena changed the title perms: add support for cursor and show-cursor flags in lookup subjects perms: add support for cursor and show-cursor flags in lookup resources Apr 1, 2025
Copy link
Copy Markdown
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

See comments - I'll re-review after that

Comment on lines +530 to +533
showCursor := cobrautil.MustGetBool(cmd, "show-cursor")
if showCursor && cursor != nil {
console.Printf("Last cursor: %s\n", cursor.Token)
}
Copy link
Copy Markdown
Contributor

@tstirrat15 tstirrat15 Apr 21, 2025

Choose a reason for hiding this comment

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

Can we change the logic to set show-cursor to true by default, and show the cursor if one exists by default?

I think it'll be more useful to show it if it's available, unless the user explicitly says not to. I chatted with the issue reporter about this and we're in agreement there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure, would be handy, defaulting the flag to be true unless explicitly set to false

Signed-off-by: Kartikay <kartikay_2101ce32@iitp.ac.in>
@kartikaysaxena kartikaysaxena force-pushed the support-cursor-for-lookup-resources branch from d19a6ef to 874e0ea Compare April 22, 2025 17:09
Copy link
Copy Markdown
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thank you!

@tstirrat15 tstirrat15 enabled auto-merge April 22, 2025 17:14
@tstirrat15
Copy link
Copy Markdown
Contributor

That test looks like a potential flake - I'll look into it if it fails again

@tstirrat15 tstirrat15 merged commit 2fc576a into authzed:main Apr 22, 2025
11 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 22, 2025
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.

2 participants