For me this is the crux of what we need to figure out. In UMA when a scope is granted, it's granted in the context of a resource. 

For example, granting a "view" scope to Bob who wants to view my landscape photos (where he promises not to download them; ROPolicy) is different than granting Bob a "view" scope to access my family photos. The ROPolicy for the family photos resource could be membership in the family list (which Bob will never be part of).

So, if Bob's client sends the PrevRPT with the "view" scope for "landscape photos" on a request for "family photos", the value of the PrevRPT "view" scope is kind of pointless. The ROPolicy for "family photos" is very different from the ROPolicy for "landscape photos".

In this context PrevRPT doesn't provide much value. The ability to reference claims that have already been met for the RqP:client:RO tuple at the AS seems more valuable.

Thanks,
George

On Mon, Jan 9, 2017 at 12:26 PM Justin Richer <jricher@mit.edu> wrote:
It’s more the case that the ROPolicy set that’s ensconced in PrevRPT is a *different* set than the ROPolicy that’s being currently evaluated against. In which case, you shouldn’t necessarily revoke things. 

But if the AS is smart enough to realize that policies have changed and can do something proactive, go for it.

 — Justin

On Jan 9, 2017, at 5:18 AM, Cigdem Sengul <Cigdem.Sengul@nominet.uk> wrote:

This is incredibly useful.
 
I have a question regarding
“ROPolicy doesn’t let the scope go through, with one exception: if it’s in PrevRPT”
 
I am wondering whether this should always hold: RPTResult = subset(ROPolicy)
 
If the ROPolicy changed from when the prevRPT was granted, shouldn’t AS revoke the previous RPT?
 
Thanks,
--Cigdem 
 
 
 
From: <wg-uma-bounces@kantarainitiative.org> on behalf of Justin Richer <jricher@mit.edu>
Date: Friday, 6 January 2017 at 22:56
To: "wg-uma@kantarainitiative.org UMA" <wg-uma@kantarainitiative.org>
Subject: [WG-UMA] Set Math Discussion
 
I’ve been working on the set math problem and I’ve been trying to lay out scenarios using this spreadsheet to help me sort my thoughts:
 
<image001.png>
 
I’ve left a bit of space in the spreadsheet for additional combinations and use cases I might have missed, so please chime in and we can figure out an algorithm that we can all agree on. I can send out the .xlsx file if people care to play with it at home.
 
So we’ve got six sets of scopes to deal with here, and they’re somewhat independent of each other. 
 
ClientReg - client registers for these scopes at the RS
RSTicket - RS requests a ticket with these scopes
ROPolicy - RO sets a policy with these scopes (and it’s fulfilled by the RqP for our purposes)
ClientReq - client requests these scopes at the token endpoint
RSReg - RS registers these scopes at RS setup time
PrevRPT - client presents a previously-held RPT that’s got some other scopes on it and it’s trying to augment that with new scopes
 
And finally what the token includes:
 
RPTResult - the sets that the resulting token includes on output
 
The one direct relationship seems to be that:
 
ROPolicy = subset(RSReg)
 
Because otherwise the RO could set scopes on a resource that the resource didn’t register, which doesn’t make sense to me. That’s the error in column “F” above. 
 
It’s clear to me that “ROPolicy” is a limiting set, in that if a scope is NOT in that set, then it is not in the result. In other words:
 
RPTResult = subset(ROPolicy)
 
That’s column D, and nearly any other combination without ROPolicy doesn’t let the scope go through, with one exception: if it’s in PrevRPT, it gets carried through no matter what. But in particular, that, I believe, is an AS decision on whether it wants to honor previous RPTs at all. That’s why I’ve coded those K, L in green.
 
This also means that RSReg is also a limiting set, due to transitive subset operations:
 
RPTResult = subset(RSReg)
 
We have both the client and RS request scopes for the token at runtime in their parts, and it makes a lot of sense to combine them. So we get a working set of:
 
Requested = union(ClientReq, RSTicket)
 
We have an open question with what to do with column I: if a client hasn’t requested a scope, and a ticket didn’t request a scope, but the client registered for a scope, do we include it or not? We could choose to either ignore it and leave it out entirely; or add it in, and if it passes ROPolicy then we’ll pass it through to the token. These were the options we were discussing on the call on Thursday. Ignoring it here would effectively ignore the client’s registered scopes entirely, which is valid. The alternative would be coded something like:
 
Requested = union(ClientReg, ClientReq, RSTicket)
 
This could also be done conditionally, like the case where the client didn’t specifically request anything:
 
if (empty(ClientReq)) {
Requested = union(ClientReg, RSTicket)
}
 
Or if the client or ticket didn’t request anything:
 
if (empty(ClientReq) && empty(RSTicket)) {
Requested = ClientReg
}
 
So my proposed implementation would be something like this horrible pseudocode:
 
 
if (ROPolicy is not subset(RSReg)) {
throw error and fail <<sanity check>>
}
 
<< the requested set is made up of the client’s request to the token endpoint and the RS’s request during the ticket issuance step>>
Requested = union(ClientReq, RSTicket)
 
<< if nothing’s been requested, maybe the client’s registered for something we can default to >>
if (empty(Requested)) {
Requested = ClientReg
}
 
<< finally, we take the requested scopes and filter out anything not in a matched policy, and add in anything from a previous RPT if it’s there >>
 
RPTResult = union(
intersection(Requested, ROPolicy),
PrevRPT)
 
 
I’ve tested a little bit of this with the following python truth table code:
 
from truths import Truths
 
print Truths(['ClientReg', 'RSTicket', 'ROPolicy', 'ClientReq', 'RSReg', 'PrevRPT'], ['(((ClientReq or RSTicket) if not (ClientReq or RSTicket) else ClientReg) and ROPolicy) or PrevRPT'])
 
This seems to match up to expectations on a quick inspection, but I’m potentially missing something. 
 
Hopefully this makes sense, and this reflects my current thinking on this topic. I have almost certainly missed some use cases and might have some cases that don’t reflect reality. 
 
 — Justin
_______________________________________________
WG-UMA mailing list
WG-UMA@kantarainitiative.org
http://kantarainitiative.org/mailman/listinfo/wg-uma
--
Distinguished Engineer
Identity Services Engineering, AOL Inc.
Mobile:+1-703-462-3494  Office:+1-703-265-2544