Re: [scim] How to patch multi-valued nested attributes?

Phil Hunt <phil.hunt@oracle.com> Mon, 25 February 2019 19:10 UTC

Return-Path: <phil.hunt@oracle.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 51990130F49 for <scim@ietfa.amsl.com>; Mon, 25 Feb 2019 11:10:04 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.299
X-Spam-Level:
X-Spam-Status: No, score=-4.299 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, UNPARSEABLE_RELAY=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=oracle.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 KS7Kjdh_O4OF for <scim@ietfa.amsl.com>; Mon, 25 Feb 2019 11:10:02 -0800 (PST)
Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D6B32128AFB for <scim@ietf.org>; Mon, 25 Feb 2019 11:10:01 -0800 (PST)
Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1PJ8dwH004243; Mon, 25 Feb 2019 19:10:00 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=corp-2018-07-02; bh=m+CX3emF4oCPm7waw7iAW2XCoJ427wwqEvPn0WOgvkE=; b=4ds9F46Cf6RgrbQBtwZP/fTO9xJnE7RWAqNAJFk+ydYXR9vMwGNcMlc4tXGkKIh0Fb+f R6MYOT4Vy+BuDMjfV7SXWDQUvRRv5ls0Uc/jY0eyStuinVZH7XzhjJB8eqMNoGQoEsdG MUYILyyea4C81gTtINGmx5dbz0rr6d/Mn6kW0QZVYBDWg25MyFyXef8FjyPn6tH0KsVy bxKqRlZpXQzfx+1NBZnaM2+qri8d5aSPjY7oUMEQhTVXR3/gm0PZO4yfldCCzeP7Vewy 8iYrnu1IyINBDyMO0uXiqlLHCg4yTdGW+jXmhmxIiyzMYfP20ngxwFlsaOGTcMneTbQW 6g==
Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2qtxtrg08h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Feb 2019 19:09:59 +0000
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x1PJ9xod005775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Feb 2019 19:09:59 GMT
Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x1PJ9x6P031147; Mon, 25 Feb 2019 19:09:59 GMT
Received: from dhcp-10-65-173-200.vpn.oracle.com (/10.65.173.200) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 25 Feb 2019 11:09:59 -0800
From: Phil Hunt <phil.hunt@oracle.com>
Message-Id: <96DFFA94-CA40-44F3-9B6B-8267C1CEB069@oracle.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_F41665C1-67A0-437B-B644-28D3FC7AEA49"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
Date: Mon, 25 Feb 2019 11:09:57 -0800
In-Reply-To: <CAKCnT7w5-o7N=TdOLwLD+dWEMCOSzyuQYYpQBKtrZs+CMo22Rw@mail.gmail.com>
Cc: scim@ietf.org
To: Aleksey Chernoraenko <achernoraenko@gmail.com>
References: <CAKCnT7w5-o7N=TdOLwLD+dWEMCOSzyuQYYpQBKtrZs+CMo22Rw@mail.gmail.com>
X-Mailer: Apple Mail (2.3445.9.1)
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9178 signatures=668685
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902250138
Archived-At: <https://mailarchive.ietf.org/arch/msg/scim/RuL-PfjTcrRaHfPQzwkkg3xSEug>
Subject: Re: [scim] How to patch multi-valued nested attributes?
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, 25 Feb 2019 19:10:04 -0000

Aleksey

Unfortunately there is no mass-update style function in SCIM. PATCH only impacts one specific resource at a time. By design each transaction impacts only a single resource at a time. Even inside of “bulk” the transaction semantics a per resource.

You really have to do this in two or more steps.  

1. Query for a set of resources that need updating
2. Apply the patch to each resource

For step 2, you can do as multiple calls for each resource, or be as a “bulk” request if supported by the provider.

Phil Hunt | Cloud Security and Identity Architect
Oracle Corporation, Oracle Cloud Infrastructure
@independentid
www.independentid.com
phil.hunt@oracle.com






> On Feb 25, 2019, at 10:37 AM, Aleksey Chernoraenko <achernoraenko@gmail.com> wrote:
> 
> Hello,
> 
> In our SCIM Resource Provider we have resources that have the nested multi-valued attributes. It looks like this:
> GET /GroupSets/98ae2a7c-40a5-4fff-b59a-5b922908239e
> {    ...
>     "name": "collection #1",
>     "groups": [ { 
>         "value": "a0115001-0fd7-4b50-b7b4-ac29d57cc623",
>         "$ref": ".../groups/a0115001-0fd7-4b50-b7b4-ac29d57cc623",
>         ...
>         }, ...
>     ], ...
> }
> 
> We use groups endpoint when we update group members, like 
> PATCH /Groups/a0115001-0fd7-4b50-b7b4-ac29d57cc623
> {   ...
>     "operations": [ { 
>         "op": "add", "path": "members", "value": "db81119f-5ee0-464e-b7e3-51573b62b56a" 
>         } ]
> }
> 
> I understand how the request should look like if I want to update one group members via parent (groupset) endpoint:
> PATCH /GroupSets/98ae2a7c-40a5-4fff-b59a-5b922908239e
> {   ...
>     "operations": [ { 
>         "op": "add", "path": "groups[value eq \"a0115001-0fd7-4b50-b7b4-ac29d57cc623\"].members", ...
>         } ]
> }
> 
> but wonder how I can specify "members" from all or a filtered set of "groups" without enumeration all of them on client side?
> 
> The path value might look like "groups[].members", or "groups[*].members", or even "groups.members".
> 
> It seems that the spec leaves this question open. What should or can happen if more than one group would be found?
> 
> ---
> Thank you,
> Alexei
> 
> _______________________________________________
> scim mailing list
> scim@ietf.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_scim&d=DwICAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=na5FVzBTWmanqWNy4DpctyXPpuYqPkAI1aLcLN4KZNA&m=J5uAPT1VUXS--3Zqx02iJFx-Kh1FYPojmNLiY1UIV9c&s=3pJVZK_E4QPr_rZxk8h7qoWTXDo2XRCEJTDhYKRAgD0&e=