Re: [scim] Queries on SCIM Cursor-based Pagination Draft

Anuradha Karunarathna <anuradha199528@gmail.com> Wed, 23 February 2022 16:51 UTC

Return-Path: <anuradha199528@gmail.com>
X-Original-To: scim@ietfa.amsl.com
Delivered-To: scim@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1C91F3A115C for <scim@ietfa.amsl.com>; Wed, 23 Feb 2022 08:51:15 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.747
X-Spam-Level:
X-Spam-Status: No, score=-6.747 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W6yt4v6bxjOd for <scim@ietfa.amsl.com>; Wed, 23 Feb 2022 08:51:10 -0800 (PST)
Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DD9903A1154 for <scim@ietf.org>; Wed, 23 Feb 2022 08:51:09 -0800 (PST)
Received: by mail-io1-xd2c.google.com with SMTP id q8so25198721iod.2 for <scim@ietf.org>; Wed, 23 Feb 2022 08:51:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QesWtaq7i+pT30WGKb64aNB04kC6zxGbAGPwHyWqGY0=; b=OeKanhrIY5VWUYd+xnFW3Ftx/bSC0qbpEzLqL5PvfcE6aF6UNhL/0RZRu8F/ANu/6V M6e7cioduek7E+1zCzaEN8J79BZ/2w9E6pgnDsQUKH5Uh2fDKZOTw2wZD78HGOe9wAVT 0keyyGdSDIFJu1gzSN2DOcz1RrGd/rJR5wEUsPBB+gZKgoo6eV/jTRnZ96mVpK2AZNqC d7InVsuPusHHXkPTn/l5cGwa2kvPb3ML7yhbgFTV8XOP0ThziyxvPQ5rIAJddi0S3a/Y AoKsRPjkaWvCFzXBJu0OIDfuFsOp+u4o1rsw40KQezY9bEeStdoYM3LGFOlA9Bp9GhzZ 0Gxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QesWtaq7i+pT30WGKb64aNB04kC6zxGbAGPwHyWqGY0=; b=kNCNsowMwrRGK3vlSedwsxRCaoEuTG3NO+oQ/4/XBkFhZ4Q7QMW5U2xZCbDEa0t+Uj Jz3DhiQYH9ilXEauZgGKnBkh/LsAzk1bdYu6I9c0luyu4061XunGGBAe71ZyucEbMlUa FXedYCdQacaLWu7NhH4mZDOu51n2KJ67ouD5rBt9w9/p45Pn8WoZRpJBTUDvPSlhWbWR 9qWG0/L6arC5dWcdPpKjrYQJwAOr3N92hyAsZSqyYAMG45BA2c/QSnLTL4Btg8YDMDFI idgHOJ6++ebcSLvtP7w+NWQVTPeru0c/xau7ptFsqUZlEZ8V2zyj4TygcIxFO3o3DQsR PTUQ==
X-Gm-Message-State: AOAM531dkeHntnQD5YLAVa934tzhIVkfFou5WmI8EcAaQ4K02Uqg9AgJ bxOCoCjS4EIcA0qWa0L8ESXdFlQbZIqFXwW6kc/+bvcbNZY=
X-Google-Smtp-Source: ABdhPJwVISo0GyehhRuEuVhUFLpb5DrwrqnobcKBpdS/A74mOTWNGn37+zzicacJB77OVUVQYCEEKeKGsg3VLhIgR7M=
X-Received: by 2002:a05:6602:2a42:b0:611:799e:bf30 with SMTP id k2-20020a0566022a4200b00611799ebf30mr266371iov.113.1645635068784; Wed, 23 Feb 2022 08:51:08 -0800 (PST)
MIME-Version: 1.0
References: <CA+OkT=9V-+b7nR=MEovu8r620vPwP_2y5Pprv-YW-8QiXGCLKg@mail.gmail.com> <MWHPR19MB095729F6C69FE4D4C0D5ACCDE12D9@MWHPR19MB0957.namprd19.prod.outlook.com> <af56ec62-f73a-2e28-534c-f57db8326bc6@pdmconsulting.net> <MWHPR19MB09576221C57E701D95D0C263E12E9@MWHPR19MB0957.namprd19.prod.outlook.com>
In-Reply-To: <MWHPR19MB09576221C57E701D95D0C263E12E9@MWHPR19MB0957.namprd19.prod.outlook.com>
From: Anuradha Karunarathna <anuradha199528@gmail.com>
Date: Wed, 23 Feb 2022 22:20:57 +0530
Message-ID: <CA+OkT=8n_yoLFXa0Q5hpPa9Dndx87NtuJ-QPwXJ=7JO+UkZx1Q@mail.gmail.com>
To: "Matt Peterson (mpeterso)" <Matt.Peterson@oneidentity.com>
Cc: Danny Mayer <mayer@pdmconsulting.net>, "scim@ietf.org" <scim@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000b4754105d8b245f5"
Archived-At: <https://mailarchive.ietf.org/arch/msg/scim/exC8niinPCi0o41drJXIpl9jHSA>
Subject: Re: [scim] Queries on SCIM Cursor-based Pagination Draft
X-BeenThere: scim@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Simple Cloud Identity Management BOF <scim.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/scim>, <mailto:scim-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/scim/>
List-Post: <mailto:scim@ietf.org>
List-Help: <mailto:scim-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/scim>, <mailto:scim-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 23 Feb 2022 16:51:15 -0000

Appreciate all inputs.

The use case for  “previousCursor” is:
The UI client which lists out users/groups uses cursor-based pagination as
its pagination mechanism. If the UI client supports infinite scrolling
there should be a way to navigate to the previous and next set of results.

Regards,
Anuradha

On Wed, Feb 9, 2022 at 11:51 PM Matt Peterson (mpeterso) <
Matt.Peterson@oneidentity.com> wrote:

> Danny,
>
>
>
> I also can not think of a good use case for “previousCursor”, but because
> others had interest, I included it in the draft as OPTIONAL
>
>
>
> --
>
> Matt
>
>
>
> *From:* Danny Mayer <mayer@pdmconsulting.net>
> *Sent:* Wednesday, February 9, 2022 10:31 AM
> *To:* Matt Peterson (mpeterso) <Matt.Peterson@oneidentity.com>; Anuradha
> Karunarathna <anuradha199528@gmail.com>; scim@ietf.org
> *Subject:* Re: [scim] Queries on SCIM Cursor-based Pagination Draft
>
>
>
> *CAUTION:* This email originated from outside of the organization. Do not
> follow guidance, click links, or open attachments unless you recognize the
> sender and know the content is safe.
>
>
>
> I'm not sure I understand this. Why would you have a previous cursor? In
> order to get to a point where you might have a previous cursor you would
> already have traversed that data set. I expect that it would be up to the
> client to have absorbed that data set and not expect the server to have
> remembered that. I can't imagine how you would be able to jump into the
> middle of a set of data. Maybe I'm not understanding how you got to this
> point. Don't forget too that the data may have changed between requests so
> whatever was on that previous data set may have changed.
>
> Danny
>
> On 2/8/22 11:37 AM, Matt Peterson (mpeterso) wrote:
>
> Anurada,
>
>
>
> Thank you for the feedback on SCIM Cursor-based Pagination Draft.
>
>
>
> You asked:  “No explanation on backward traversal (traverse to the
> previous page result set)”
>
>
>
> I agree.  The draft could describe more clearly the use of previousCursor
> (when supported).   Would the following rewording of the cursor query
> parameter be clearer?
>
>
>
> cursor – To request the next page, pass the nextCursor value from
>
> the current result page. For the previous page, pass the
>
> previousCursor from the current result page. The cursor parameter
>
> SHOULD be omitted for the first request of a paginated query.
>
>
>
>
>
> You asked: “As per the following paragraph in the introduction, is the
> cursor-based pagination supported only when all resources are fetched from
> the server?”
>
>
>
> Not only is filtering an OPTIONAL capability,for service providers,
>
> it is also a very common for SCIM clients to not to use a query
>
> filter in order to intentionally to retrieve all resources.
>
> Therefore, pagination of results (more so than filtering) is a
>
> primary scalability mechanism for SCIM service providers.
>
>
>
> No, cursor-based pagination should be supported for filtered and
> unfiltered requests.  This paragraph in the introduction was intended to
> counter the opinion that high performance pagination would not be needed if
> clients would constrain queries with filter.   In a future version of this
> draft, I would omit this paragraph as there is less controversy on this
> point than I originally thought.
>
>
>
> --
>
> Matt
>
>
>
> *From:* scim <scim-bounces@ietf.org> <scim-bounces@ietf.org> *On Behalf
> Of *Anuradha Karunarathna
> *Sent:* Monday, February 7, 2022 9:24 AM
> *To:* scim@ietf.org
> *Subject:* [scim] Queries on SCIM Cursor-based Pagination Draft
>
>
>
> *CAUTION:* This email originated from outside of the organization. Do not
> follow guidance, click links, or open attachments unless you recognize the
> sender and know the content is safe.
>
>
>
> Hi all,
>
>
>
> WSO2 Identity Server(IS) is a SCIM service provider which supports SCIM
> 2.0, and SCIM is the main protocol used in identity management in WSO2-IS.
>
> After seeing performance and functionality improvements that can be
> achieved with the cursor-based pagination we are planning to implement the
> cursor-based pagination draft [1] in WSO2 IS. While reading the draft spec
> we encountered the following concerns. Appreciate your clarification and
> input on these points.
>
>
>
>    1.
>    2.
>    3. No explanation on backward traversal (traverse to the previous page
>    result set)
>    4.
>
>
>
> 1.
>
> 2.
>
> 3.      As per the draft, count and cursor are the URL pagination
> parameters for cursor-based pagination.
>
> 4.      (eg: GET /Users?cursor=VZUTiyhEQJ94I&count=10).
>
> 5.
>
> 6.
>
> 7.
>
> 8.      Also, the definition of the “cursor” attribute is
>
> 9.      *“**The*
>
> 10.   *string*
>
> 11.   * value from the nextCursor **attribute*
>
> 12.   * from the previous result page. A  cursor parameter SHOULD be
> omitted for the first request of the paginated query**”*
>
> 13.
>
> 14.
>
> 15.
>
> 16.   If the SCIM service provider supports previousCursor, what should
> be the API request format to
>
> 17.    traverse back to the previous page?
>
> 18.
>
> 1.
>
> 2.
>
> 3.      Suggestions:
>
> 4.
>
> 1.
>
> 2.
>
> 3.      Instead of “cursor” query param, support two query params as
> “before” and “after” as similar to
>
> 4.       Facebook API[2]
>
> 5.
>
> 6.
>
> 7.
>
> 8.      Introduce new query param as “cursorDirection”  to indicate
> whether the client needs the before/next
>
> 9.       set of results from the cursor, and change cursor attribute
> definition
>
> 10.
>
> 11.
>
> 12.
>
> 13.   Only if “count” and “cursor” params are supported, add a prefix to
> the cursor such as prev_ and
>
> 14.    next_ that can be parsed before sending to the DB layer[3].
>
> 15.
>
> *Get next page results*: GET
> /Users?cursor=base64encode<next_cursor1>&count=10
>
> *Get previous page results*: GET
> /Users?cursor=base64encode<pre_cursor2>&count=10
>
>
>
>    1.
>    2.
>    3. Supporting filtering params and cursor-based pagination params
>    together in the API request
>    4.
>
>
>
> As per the following paragraph in the introduction, is the cursor-based
> pagination supported only when all resources are fetched from the server?
>
>
>
> “  Not only is filtering an OPTIONAL capability,for service providers,
>
>    it is also a very common for SCIM clients to not to use a query
>
>    filter in order to intentionally to retrieve all resources.
>
>    Therefore, pagination of results (more so than filtering) is a
>
>    primary scalability mechanism for SCIM service providers.
>
> “
>
>
>
> [1]
> https://datatracker.ietf.org/doc/html/draft-peterson-scim-cursor-pagination-00
> <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdatatracker.ietf.org%2Fdoc%2Fhtml%2Fdraft-peterson-scim-cursor-pagination-00&data=04%7C01%7CMatt.Peterson%40oneidentity.com%7Cc9c495422ae544d06a2908d9ebf2083e%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637800247033454244%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=J6ZmPYq2NI630ISNdfiwP7svVH0atbiuxNXN2XMQ%2FlI%3D&reserved=0>
>
>
> [2] https://developers.facebook.com/docs/graph-api/results
> <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fgraph-api%2Fresults&data=04%7C01%7CMatt.Peterson%40oneidentity.com%7Cc9c495422ae544d06a2908d9ebf2083e%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637800247033454244%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=ko1N0kM%2BnYOVJVBybULOOGc6PMJDBaEvfoXJRxqaapQ%3D&reserved=0>
>
> [3]
> https://medium.com/swlh/how-to-implement-cursor-pagination-like-a-pro-513140b65f32
> <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmedium.com%2Fswlh%2Fhow-to-implement-cursor-pagination-like-a-pro-513140b65f32&data=04%7C01%7CMatt.Peterson%40oneidentity.com%7Cc9c495422ae544d06a2908d9ebf2083e%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637800247033454244%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=%2F%2BL19mJQL3286dbfC0GDaCRQCn%2F5Jx3fm%2FemBgECVhg%3D&reserved=0>
>
>
>
>
> Regards,
>
> Anuradha
>
>
>
> _______________________________________________
>
> scim mailing list
>
> scim@ietf.org
>
> https://www.ietf.org/mailman/listinfo/scim <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Fscim&data=04%7C01%7CMatt.Peterson%40oneidentity.com%7Cc9c495422ae544d06a2908d9ebf2083e%7C91c369b51c9e439c989c1867ec606603%7C0%7C1%7C637800247033454244%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=eCMSMqFE%2Bti6S42XlnCYfYhWX2Dyy%2FCOZ3nDzKIIP60%3D&reserved=0>
>
>