Skip to content

Commit 7ba0d2b

Browse files
Merge pull request #209 from solid/minutes-2021-04-28
Minutes 2021-04-28
2 parents 0209f45 + dfa8ecd commit 7ba0d2b

File tree

1 file changed

+370
-0
lines changed

1 file changed

+370
-0
lines changed

meetings/2021-04-28.md

Lines changed: 370 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,370 @@
1+
# 2021-04-28 Solid Authorization
2+
3+
* [Meeting](https://meet.jit.si/solid-authorization)
4+
* [Chat](https://gitter.im/solid/authorization-panel?at=6088092ac1a9210b3c23a55a)
5+
* [Notes](https://hackmd.io/mFgvpYMZR7Co_DIDgUaNwA)
6+
7+
## Agenda
8+
9+
* Minutes https://github.com/solid/authorization-panel/pull/207
10+
* Cleanup minutes: standard filename and extension https://github.com/solid/authorization-panel/pull/208
11+
* Add issue template https://github.com/solid/authorization-panel/pull/205
12+
* Commit [PR 201](https://github.com/solid/authorization-panel/pull/201)?
13+
* AnyOf, AllOf, etc...
14+
15+
16+
## Present
17+
18+
* Justin Bingham
19+
* Eric Prud'hommeaux
20+
* Henry Story
21+
* Matthieu Bosquet
22+
* Sarven Capadisli
23+
24+
25+
## Minutes
26+
27+
1. Commited Meeting Cleanups
28+
2. Appropve minutes from 207 without the ACP code discused in the last few minutes in the last call
29+
3. Elf Accept changed and then Commit on PR 205
30+
4. Merged 201
31+
32+
33+
## ACP apply policy algorithm
34+
35+
**Henry**: Last week, we discussed a PR I made to
36+
[the wac-acp-diff story](https://github.com/solid/authorization-panel/blob/main/proposals/wac-acp-diff-story.md) which we just committed.
37+
We looked at how the ACL ontology allows a behavior similar to ACP by creating an inferred `:authorizes` relation
38+
defined as:
39+
40+
```Turtle
41+
acl:accessTo owl:inverseOf [
42+
owl:propertyChainAxiom ( acl:accessControl :authorizes )
43+
] .
44+
```
45+
(note: for an interesting discussion on this rule see also the discussion on the [PR for the meeting notes](https://github.com/solid/authorization-panel/pull/209#discussion_r624180407))
46+
47+
This relation, which is already implicit in ACL, as it can be defined purely in terms of those concepts, allows one to get similar behavior to the one put forward as a distinguishing feature of ACP.
48+
49+
We then looked at the ShEx examples and showed that with a very simple inferencing step -- adding one
50+
triple to the graph after following an `:accessControl` `Link` header relation -- one could even apply that WAC ShEx to that graph and get clients written to the old ACL ontology to continue working.
51+
52+
But the question then was what do the `allOf`, `anyOf`, `noneOf` and `apply*` relations bring to the picture. How do they work?
53+
54+
We were about to start on that when time ran out.
55+
We had just pasted this code into the chat.
56+
57+
```typescript
58+
/**
59+
* # The apply policy algorithm
60+
*
61+
* A policy is applied if:
62+
* - At least one matcher it uses matches the given context; and
63+
* - All the conditions it defines are satisfied.
64+
*
65+
* Policy conditions behave like intersection, union and exclusion operators. In
66+
* order to be satisfied:
67+
* - allOf requires all of its matchers to match the given context;
68+
* - anyOf requires one of its matchers to match the given context;
69+
* - noneOf requires none of its matchers to match the given context.
70+
*
71+
* Note: Given that the noneOf condition excludes matches, a policy without a
72+
* satisfied allOf or anyOf condition never applies.
73+
*
74+
* @param policy The policy to evaluate
75+
* @param context The context in which the policy is evaluated
76+
* @returns True if the policy applies, false otherwise
77+
*/
78+
export function applyPolicy(policy: IPolicy, context: IContext): boolean {
79+
const matchContext = (matcher: IMatcher) => {
80+
return matcher.match(context);
81+
};
82+
83+
// A policy without positive match doesn't apply
84+
if (policy.allOf.length + policy.anyOf.length === 0) {
85+
return false;
86+
}
87+
88+
return (
89+
(policy.allOf.length === 0 || policy.allOf.every(matchContext)) &&
90+
(policy.anyOf.length === 0 || policy.anyOf.some(matchContext)) &&
91+
(policy.noneOf.length === 0 || !policy.noneOf.some(matchContext))
92+
);
93+
}
94+
```
95+
96+
**Henry**: before we look at that code, can we look at some simple RDF examples of a policy using that vocabulary?
97+
98+
**Matthieu**:
99+
100+
Yes, I can write it out here.
101+
102+
```Turtle
103+
prefix ex: <https://example.com/>
104+
105+
ex:PolicyX
106+
acp:allow acl:Read ; #CSarven comments below
107+
acp:deny acl:Write ;
108+
acp:allOf ex:AgentMatcher1, ex:IssuerMatcher1, ex:TimeMatcher1, ex:CredentialIssueTimeMatcher1 .
109+
110+
ex:AgentMatcher1
111+
acp:agent ex:Bob, ex:Alice .
112+
113+
ex:IssuerMatcher1
114+
acp:issuer ex:IdP1 .
115+
116+
ex:TimeMatcher1
117+
acp:time [
118+
some owl time range e.g. sunday 10am to 2pm
119+
]
120+
```
121+
122+
**C Sarven**: would only having acp:allow acl:Read imply anything other than Read? Why would acp:deny be necessary?
123+
124+
**Matthieu**:
125+
Allowing read doesn't imply anything else than read.
126+
However being able to forbid access following sets of rules could be seen as useful because:
127+
- You can design Policies that deny certain access following set of conditions that are as intricate as required.
128+
- You can design standard Policies that deny access and can be widely applied.
129+
130+
To be clear, an access mode is only allowed if at least one policy that applies allows it and none of the policies that apply deny it.
131+
Here the Policy X will apply if all the matchers are satisfied in the current context.
132+
A context would be the description of a resource access. (note: We have `acp:deny` which is new compared to WAC.)
133+
134+
So a Policy is what gives access to a resource.
135+
With the above Policy applied to the below context, Bob is allowed to read a resource.
136+
137+
```turtle
138+
ex:ResourceAccess1
139+
acp:time "2021-04-26T15:30:00Z" ;
140+
acp:agent ex:Bob ;
141+
acp:issuer ex:IdP1 ;
142+
acp:resource ex:MyResource1 .
143+
```
144+
145+
**Henry**:
146+
Note: it looks like `acp:resource` is equivalent to `acl:accessTo`.
147+
148+
**Matthieu**
149+
Note: `acp:resource` describes which resource is being accessed, above is a context graph describing an instance of resource access. The `acl:accessTo` would be closer to the inverse of the predicate that links resources to their access controls in ACP, that is, `acp:accessControl`.
150+
151+
**Henry** :
152+
153+
So we can get the equivalent of `allOf` with `owl:intersectionOf`
154+
For example, one can describe EU Citizens over 18 if one has already defined two groups, one the set of Citizens and the other of being over18 as here:
155+
156+
```Turtle
157+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
158+
159+
<#EUOver18> owl:equivalentClass [
160+
owl:intersectionOf ( eu:Citizen iso:Over18 )
161+
].
162+
```
163+
164+
**Matthieu**
165+
166+
ACP `someOf` is the union of the sets described by all matchers.
167+
168+
```turtle
169+
prefix ex: <https://example.com/>
170+
171+
ex:PolicyY
172+
acp:allow acl:Read ;
173+
acp:someOf ex:AgentMatcherFriends1, ex:AgentMatcherFamily1 .
174+
175+
ex:AgentMatcherFriends1
176+
acp:agent ex:Henry, ex:Jay .
177+
178+
ex:AgentMatcherFamily1
179+
acp:agent ex:Bob, ex:Alice .
180+
```
181+
182+
This Policy will apply if you are any of the agents defined by AgentMatcherFriends1 and AgentMatcherFamily1.
183+
184+
185+
**Henry**
186+
187+
Note that one can get that with `owl:unionOf`
188+
189+
```Turtle
190+
<#EUOrOver18> owl:equivalentClass [
191+
owl:unionOf ( eu:Citizen iso:Over18 )
192+
] .
193+
```
194+
195+
This gives us the set of citizens over18 or those that are European Union Citizens.
196+
197+
The range of `acp:allow` is a set of agents right?
198+
199+
**Matthieu** : It is more than that: it can be selecting credentials, issuers and times too.
200+
201+
Access to a resource based on credentials. For example, giving access to those over 18.
202+
Note: This example is not normative. There has been no formalisation of verifiable credentials in acp yet. The important point is that `acp:attributes` that describe an instance of resource access are an extension point of acp. Each attribute corresponding to a specific matching algorithm. Currently, formally defined and in use are the standard attributes for describing agent, client and issuer.
203+
204+
```turtle
205+
ex:PolicyVC
206+
acp:allow acl:Read ;
207+
acp:allOf ex:VCMatcher1 .
208+
209+
ex:VCMatcher1
210+
rdfs:label "Over 18 VC Matcher" ;
211+
acp:vc ex:over18 .
212+
```
213+
214+
**Henry**: Is it not selecting sets of agents that have certain relations to credential issuers, times, birth dates, capabilities (e.g. the ability to drive) etc...?
215+
This is what Description Logic allows one to do: define sets of things by describing their relations to other things? That is: we can get
216+
the same effect by using descriptions to constrain the set of agents in the `acl:agentClass` relation.
217+
218+
Here are a few examples I put together over the past few months in various issues:
219+
220+
From [Issue 135: OWL for anyOf, allOf, noneOf?](https://github.com/solid/authorization-panel/issues/135)
221+
One can model a class minus another, giving us the equivalent of deny perhaps
222+
223+
```Turtle
224+
<#Responsible> owl:equivalentClass [
225+
owl:intersectionOf ( iso:Over18 [ owl:complementOf <g0#Trolls> ] )
226+
]
227+
```
228+
229+
In [issue 147](https://github.com/solid/authorization-panel/issues/147#issuecomment-743158893) I show how one can describe people over 21
230+
231+
```Turtle
232+
<#PersonOver21> owl:equivalentClass [ a owl:Restriction;
233+
owl:onProperty :hasAge ;
234+
owl:someValuesFrom
235+
[ rdf:type rdfs:Datatype ;
236+
owl:onDatatype xsd:integer ;
237+
owl:withRestrictions ( [ xsd:minExclusive 21 ] [ xsd:maxInclusive 150 ] )
238+
]
239+
].
240+
```
241+
242+
This example is taken directly from the OWL spec btw.
243+
Here again, we describe a set of agents by their relation to some other thing (an age).
244+
And in [issue 176: Only Trust Certain issuers of Identity](https://github.com/solid/authorization-panel/issues/176) I put together an example that creates a subclass of agents, restricted to those that have credentials issued by certain trusted issuers:
245+
246+
```Turtle
247+
<verified#agents> rdf:type owl:Class ;
248+
owl:equivalentClass [
249+
rdf:type owl:Restriction ;
250+
owl:onProperty wac:hasCredentialIssuer ;
251+
owl:someValuesFrom <trusted#issuers> .
252+
] .
253+
```
254+
255+
So we only need a relation of a Policy or Access control Rule to a set of agents.
256+
We can then specify what that set of agents is.
257+
258+
```Turtle
259+
<> :authorizes [
260+
a acl:Authorization;
261+
acl:agentClass </grps/verified#agents>; # Authenticated Agents from verified issuers
262+
acl:mode acl:Read, acl:Write # has Read/Write access to the collection
263+
].
264+
```
265+
266+
This gives us the same properties as `allOf`, `anyOf`, `noneOf` relations it seems.
267+
Perhaps then `allOf`, `anyOf`, `noneOf` can be mapped to OWL.
268+
Writing up such a mapping would allow us to leverage well-known, widely researched and deployed standards in what we are doing.
269+
270+
So we see that we can certainly both define the restrictions on the set of agents using ACL or extensions thereof (in the ACP namespace, why not?).
271+
272+
## Flow from Resource to Policy
273+
274+
But there are a few other relations I have been wondering about.
275+
Perhaps we can go back to the beginning so that I can make sure I follow the path from the access-controlled resource.
276+
277+
**Matthieu**
278+
279+
Certainly, we can start with the relation from LDPR to the Access control resource with the following relation, via the header:
280+
281+
```turtle
282+
<mydoc> acp:accessControl <mydoc.acp#> .
283+
```
284+
285+
The ACR doc contains a policy X mandating access over the resource controlled by <#>.
286+
287+
```Turtle
288+
<#> acp:apply ex:PolicyX .
289+
```
290+
291+
**Henry**: this looks very much like `:authorizes` relation defined in
292+
[issue 184](https://github.com/solid/authorization-panel/issues/184)
293+
which we discussed last week.
294+
295+
The `apply` name is not very clear, perhaps because it is so general. (In functional programming and Category Theory it is used for all applications of arguments to a function). I found this makes its
296+
role difficult to understand. That explains perhaps why I could not work out how it fits into [wac-acp diff](https://github.com/solid/authorization-panel/blob/main/proposals/acp/wac-acp-diff.ttl).
297+
So I find it helps to see that it is playing the role of `acp:authorizes`.
298+
I had not understood that.
299+
300+
But there is also another set of relations named `access*` if I remember correctly.
301+
Why do we need all of those?
302+
303+
**Matthieu**:
304+
305+
This is useful when the ACR doc contains another policy Y mandating access over itself (<>).
306+
307+
308+
```Turtle
309+
<#>
310+
acp:access ex:PolicyY .
311+
acp:applyProtected ex:ProtectedAccessControl1 .
312+
```
313+
314+
**Henry**:
315+
316+
So that is specifying what rights we have to access the ACR itself?
317+
Why not reuse the same `acp:accessControl` mentioned at the beginning?
318+
319+
**Matthieu**: Indeed `acp:access` is very similar to that.
320+
But it helps avoid infinite recursion in cases like this:
321+
322+
```turtle
323+
ex:resource1 acp:access ex:acr1 .
324+
ex:acr1 acp:access ex:acr2 .
325+
ex:acr2 acp:access ex:acr3 .
326+
```
327+
328+
**Henry**: I am not sure that actually is a problem. It would need to
329+
be argued for carefully.
330+
I have not found there to be a problem when a resource claims to be its own ACR.
331+
(And recursion is not problematic if it has a fixed point. Functional programming relies on that.)
332+
333+
There is a fundamental distinction in philosophy between Epistemology (what you know) versus ontology (how things are) that can help us here.
334+
We can see the ACL ontology as telling us that every resource on the web has access control rules.
335+
And indeed, they do: most web pages cannot be written to by just anyone. Even places like Wikipedia that allow wide-open contributions can limit access. So if I had full *knowledge* of the access control state of a website, I could write out a document describing all resources there and who had access.
336+
So we can think of those statements as not being published at present, but as potentially publishable.
337+
Indeed those statements are written somewhere: in some binary or textual form, Apache config files, databases, XML documents, ... and could be given an RDF representation.
338+
All publishing the ACRs is doing is allowing a client to "know" what the rules of access are (epistemology).
339+
At present browsers don't have access to the policies,
340+
and humans have to work those out by reading text and filling in forms.
341+
342+
In short: there is no difference ontologically that one can make between ACRs and other resources -- all resources have access control rules, even access control rule resources.
343+
344+
So, in that case, why build up a new type of relation, when we already have what we need? It seems furthermore that this complicates things: instead of 1 `acp:accessControl` relation you now have 4 or so more.
345+
346+
## Discussion on Resource restrictions
347+
348+
**Henry**
349+
350+
I was wondering how in ACP one restricts policies to sets of resources?
351+
If I remember correctly, EricP had a use case for the transitive closure of resources he needed for a health care example.
352+
353+
**EricP**
354+
355+
Diagnosis > Conditions > Observations
356+
357+
Access inheritance via specific paths.
358+
359+
Condition 456 -> Observation 789 ->
360+
361+
362+
Henry: How do you describe sets of resources that have a set of properties in addition to describing agents that have sets of properties? And how do you describe the relationships between those?
363+
364+
Sarven: How does the shapetree work through HTTP resources where the target of a request is a resource. It is a document with a body... How does shapetree work in context of a resource targeted?
365+
366+
The chain of how information is preserved (host a medical image XRay is an ldp resource is this shapetree the shapetree has resources to other resources)
367+
368+
## Actions
369+
370+
* Elf to Accept suggestions and commit [PR 205](https://github.com/solid/authorization-panel/pull/205) - done

0 commit comments

Comments
 (0)