[scim] Queries on SCIM Cursor-based Pagination Draft

Anuradha Karunarathna <anuradha199528@gmail.com> Mon, 07 February 2022 16:24 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 339FB3A0D23 for <scim@ietfa.amsl.com>; Mon, 7 Feb 2022 08:24:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.863
X-Spam-Level:
X-Spam-Status: No, score=0.863 tagged_above=-999 required=5 tests=[BAYES_50=0.8, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01, 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 UOCKXYzsL_RF for <scim@ietfa.amsl.com>; Mon, 7 Feb 2022 08:24:04 -0800 (PST)
Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 D1D913A0D26 for <scim@ietf.org>; Mon, 7 Feb 2022 08:24:04 -0800 (PST)
Received: by mail-io1-xd2b.google.com with SMTP id 9so17529373iou.2 for <scim@ietf.org>; Mon, 07 Feb 2022 08:24:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=GH7hLoVT1Qybs4fRE76cxQINCuhO/SGvJUqk3qB5XA8=; b=RGC7T4416MgZOw5eNEcP4L1SLd0aAXbDpGkQV7MdfhAoF9x01GN9Ab4Dpa+nowG3z7 rI8RfjLGV1t1ijr36J0a8l1b19xGZus2ZdrKyg8BQFNtCG/cNfcTJAV1aJpjKDsl6mTi gsfIwq4LKDPlC4GxWfNddQjfALfc6gyOwO21GEUL4T3IRgPyn+HVyK8FKgNeEfV9FEc7 3BJzPfsshh7yuSm5s0wcPym8YUtALx2RTsk2+7wmO2WTK8yHQz1+qF8i8ZdJW+kt5szo lmDw9c02IhdPk3aZSAuJZK6EzjeptQryGRKDSY78KqSt6HvzabRvA+cE1IujlX/AyJV3 VEWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=GH7hLoVT1Qybs4fRE76cxQINCuhO/SGvJUqk3qB5XA8=; b=P3LKhyYEO95sPeQfFapCxONvU1/t2Tp7kN+FKnwEf2jukRsyLMDs9/GdMhKWi0TA6k vCn/yHf6r/mcy5Mzxmbjffegypt98B6Q5KSaT8aAQA7TU695+C4EBlyoTC4Phl1+8tDA fkRPwUz/saJ5k3ojZF98SN+WEpMqQ+aQEymChGdfB3OY9SfmBkemA2FtweC658U6OokX Sir/P89GOpP+gU208lrScPC8ecB05m52JIVlkhBQdeUP7X077Dq7mZH20B3co+2FX3xt ZiVDDOjbLRN6V98ai7ht8pXr7empKmmlEioiCNh52JhHgzq9bi3XvL00QhtC5azXpf3v /QMQ==
X-Gm-Message-State: AOAM531uMgEoZuzwvcQ9OhZSvtFN2gDFRXOZBzDUK3DaBz9DMrHmcFj+ pBx608TXh2U4gzouZ5J21TPaKrNIgLBwSIlq8ExEv5PPvz4=
X-Google-Smtp-Source: ABdhPJwbkN1HSXrmovlLSiljKFQ5wyrk7Qj7uPAz89+oktYOxl1yhEZBRLD8Toh6EFYzt5MG01DRrq/KYezDOTRSnAY=
X-Received: by 2002:a02:6a02:: with SMTP id l2mr234582jac.140.1644251042877; Mon, 07 Feb 2022 08:24:02 -0800 (PST)
MIME-Version: 1.0
From: Anuradha Karunarathna <anuradha199528@gmail.com>
Date: Mon, 07 Feb 2022 21:53:51 +0530
Message-ID: <CA+OkT=9V-+b7nR=MEovu8r620vPwP_2y5Pprv-YW-8QiXGCLKg@mail.gmail.com>
To: scim@ietf.org
Content-Type: multipart/alternative; boundary="000000000000551a3005d77007c1"
Archived-At: <https://mailarchive.ietf.org/arch/msg/scim/iKG0w-gXgIUTDM_tRS1wlqOwcHY>
Subject: [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: Mon, 07 Feb 2022 16:24:10 -0000

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.

   No explanation on backward traversal (traverse to the previous page
   result set)



   -

   As per the draft, count and cursor are the URL pagination parameters for
   cursor-based pagination. (eg: GET /Users?cursor=VZUTiyhEQJ94I&count=10).
   -

   Also, the definition of the “cursor” attribute is “The string value from
   the nextCursor attribute from the previous result page. A  cursor
   parameter SHOULD be  omitted for the first request of the paginated query
   ”
   -

   If the SCIM service provider supports previousCursor, what should be the
   API request format to traverse back to the previous page?
   -

      Suggestions:


   1.

   Instead of “cursor” query param, support two query params as “before”
   and “after” as similar to Facebook API[2]
   2.

   Introduce new query param as “cursorDirection”  to indicate whether the
   client needs the before/next set of results from the cursor, and change
   cursor attribute definition
   3.

   Only if “count” and “cursor” params are supported, add a prefix to the
   cursor such as prev_ and next_ that can be parsed before sending to the DB
   layer[3].

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.

   Supporting filtering params and cursor-based pagination params together
   in the API request


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


[2] https://developers.facebook.com/docs/graph-api/results
[3]
https://medium.com/swlh/how-to-implement-cursor-pagination-like-a-pro-513140b65f32

Regards,
Anuradha