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

Conventional pagination with page tokens #499

Open
santhosh-c1 opened this issue Jan 8, 2025 · 0 comments
Open

Conventional pagination with page tokens #499

santhosh-c1 opened this issue Jan 8, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@santhosh-c1
Copy link

Describe the feature request?

Hi Okta team,

It seems like today we need the resp object from every inital response to make the next() call. This is a change from before, where you can pass in a page token in query parameters.

Today in V5

	apiTokens, resp, err = o.clientV5.ApiTokenAPI.ListApiTokens(ctx).Execute()
	if err != nil {
		return nil, "", nil, fmt.Errorf("okta-connectorv2: failed to list api tokens: %w", err)
	}

	if resp.HasNextPage() {
		resp, err = resp.Next(&apiTokens)
		if err != nil {
			return nil, "", nil, err
		}
	}

Before in V2

   qp :=  query.NewQueryParams(query.WithLimit(int64(size)), query.WithAfter(after))
   oktaUsers, resp, err := client.User.ListUsers(ctx, qp)

This essentially means, the downstream consumer cannot be stateless any more and needs to store the resp object from the API responses. Even if we are able to get page tokens from our end, we are not able to just call list API with the token.

Looking for some guidance if we are looking at it the wrong way. Thanks!

New or Affected Resource(s)

All APIs

Provide a documentation link

No response

Additional Information?

No response

@santhosh-c1 santhosh-c1 added the enhancement New feature or request label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant