Skip to content

Add a paginated endpoint for retrieving all Applications#56324

Merged
rosstimothy merged 1 commit intomasterfrom
tross/paginated_resource_apis
Jul 11, 2025
Merged

Add a paginated endpoint for retrieving all Applications#56324
rosstimothy merged 1 commit intomasterfrom
tross/paginated_resource_apis

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

@rosstimothy rosstimothy commented Jul 1, 2025

A new ListApps RPC has been added to the auth service to retrieve pages of applications and should be preferred over the existing GetApps RPC. The cache and tctl get have been updated to prefer using ListApps, but fallback to GetApps if the upstream does not yet implement the paginated API.

Changelog: Update Application APIs to use pagination to avoid exceeding message size limitations.

@rosstimothy rosstimothy force-pushed the tross/paginated_resource_apis branch from e8f7b37 to 2610982 Compare July 1, 2025 21:02
@rosstimothy rosstimothy marked this pull request as ready for review July 2, 2025 11:56
@github-actions github-actions bot added size/lg tctl tctl - Teleport admin tool labels Jul 2, 2025
Comment thread lib/auth/auth_with_roles.go Outdated
Comment thread tool/tctl/common/resource_command.go Outdated
Copy link
Copy Markdown
Contributor

@marcoandredinis marcoandredinis left a comment

Choose a reason for hiding this comment

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

Just one comment on checking for NotFound instead of NotImplemented on tctl.
Everything else lgtm

@rosstimothy rosstimothy force-pushed the tross/paginated_resource_apis branch from 2610982 to 4a648a8 Compare July 7, 2025 12:17
@rosstimothy rosstimothy requested a review from espadolini July 8, 2025 13:56
Comment thread api/client/client.go
Comment thread lib/cache/app.go
Comment on lines +51 to +52
// TODO(tross): DELETE IN v21.0.0
if trace.IsNotImplemented(err) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we have the client's GetApps method use Apps with the fallback to the old rpc instead so we don't have to add a million fallbacks from Collect(Apps) to GetApps everywhere? There's a precedent for this, the client's GetNodes also does this.

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.

I don't know that I like that pattern too much though. I think it causes confusion around whether the API is paginated or not.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we deprecate the GetApps method then, at least in v19?

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there any reason to use the unpaginated endpoint? Even with the deprecation warning, I wonder about existing code using the api module, it would be nice if we could transparently make it not die if there's too many apps in a cluster (and I'm not even sure if we should deprecate methods in the middle of a major).

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.

What are our other options? Not populate the cache if the upstream doesn't support ListApps? Also, I don't plan on backporting the deprecation of the API beyond master.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deprecate GetApps as a method and implement it using Collect+Resources+ListApps just for the transitional period, I guess?

@rosstimothy rosstimothy force-pushed the tross/paginated_resource_apis branch from 4a648a8 to c07fd60 Compare July 9, 2025 15:13
@rosstimothy rosstimothy requested a review from espadolini July 9, 2025 16:47
Comment thread api/client/client.go Outdated
Comment thread lib/cache/app.go
Comment on lines +51 to +52
// TODO(tross): DELETE IN v21.0.0
if trace.IsNotImplemented(err) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there any reason to use the unpaginated endpoint? Even with the deprecation warning, I wonder about existing code using the api module, it would be nice if we could transparently make it not die if there's too many apps in a cluster (and I'm not even sure if we should deprecate methods in the middle of a major).

@rosstimothy rosstimothy requested a review from espadolini July 11, 2025 11:59
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
@rosstimothy rosstimothy force-pushed the tross/paginated_resource_apis branch from 19cee39 to 63bb43c Compare July 11, 2025 14:00
@rosstimothy rosstimothy enabled auto-merge July 11, 2025 14:01
@rosstimothy rosstimothy added this pull request to the merge queue Jul 11, 2025
Merged via the queue into master with commit 7449994 Jul 11, 2025
44 of 45 checks passed
@rosstimothy rosstimothy deleted the tross/paginated_resource_apis branch July 11, 2025 15:49
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@rosstimothy See the table below for backport results.

Branch Result
branch/v16 Failed
branch/v17 Failed
branch/v18 Failed

github-merge-queue bot pushed a commit that referenced this pull request Jul 16, 2025
…6727)

A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 18, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 18, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 18, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 18, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 18, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 18, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 18, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 18, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 18, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 18, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 21, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 21, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 21, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 21, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 21, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 24, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 24, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
rosstimothy added a commit that referenced this pull request Jul 24, 2025
A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
github-merge-queue bot pushed a commit that referenced this pull request Jul 24, 2025
…6949)

A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
github-merge-queue bot pushed a commit that referenced this pull request Jul 25, 2025
…6954)

A new ListApps RPC has been added to the auth service to retrieve
pages of applications and should be preferred over the existing
GetApps RPC. The cache and tctl get have been updated to prefer
using ListApps, but fallback to GetApps if the upstream does not
yet implement the paginated API.
okraport added a commit that referenced this pull request Sep 22, 2025
This RPC was already previously deprecated in #56324,
this commit updates the proto and the linter plugin to match.
okraport added a commit that referenced this pull request Sep 26, 2025
This RPC was already previously deprecated in #56324,
this commit updates the proto and the linter plugin to match.
github-merge-queue bot pushed a commit that referenced this pull request Sep 26, 2025
This RPC was already previously deprecated in #56324,
this commit updates the proto and the linter plugin to match.
rhammonds-teleport pushed a commit that referenced this pull request Nov 6, 2025
This RPC was already previously deprecated in #56324,
this commit updates the proto and the linter plugin to match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants