solid / authorization-panel

Github repository for the Solid Authorization Panel
MIT License
19 stars 20 forks source link

Create a Generalizable baseline for interop #74

Open jaxoncreed opened 4 years ago

jaxoncreed commented 4 years ago

Hair-Brained Scheme for Data Interop

The Problem

Solution Summary

Implementation Summary

justinwb commented 4 years ago

Thanks @jaxoncreed - can you also provide a use case or two with examples?

kjetilk commented 4 years ago

Actually, I didn't understand the problem. Is it intended as a future generalization of current WAC and Link-based access control and discovery?

If it is, I think I kinda get the high-level idea, but not the details. On a high level, I think the idea of using SPARQL to define subgraphs and access control to those subgraphs are sound. In principle, you can do that now, by having a conventional SPARQL Endpoint with the query encoded in the parameters. You'd probably bump into problems of normalizing the query, since the ACL would only apply to that very URL.

So, certainly worth exploring further.

One note on the details, you write that:

Each triple in Solid should instead be a quad. The graph portion of the quad should be the resource in which a triple is located

and this is an assumption it seems safe to make, it has been done many times and there seems to be consensus around it.

On the call, you mentioned something around constraints around existing data. In that vein, let me point out Boundz, a vocabulary that initially competed with SHACL and SHEX, but that has some other interesting properties in that acceptable data is defined in terms of data that is already in the model. It sounds like it might be relevant to that.

jaxoncreed commented 4 years ago

Here's a simple example of how this might work. Though sorry I hastily wrote this, so there may be a few mistakes in my through process:

To illustrate this concept, we will use the following hypothetical dataset:

|-root
|| .meta
||-chats
||| .meta
||| chat1.ttl
||| chat1.ttl.meta
||| chat2.ttl
||| chat2.ttl.meta

root/chat1.ttl

@prefix : <#>.
@prefix mee: <http://www.w3.org/ns/pim/meeting#>.
@prefix ic: <http://www.w3.org/2002/12/cal/ical#>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix flow: <http://www.w3.org/2005/01/wf/flow#>.
@prefix c: </profile/card#>.
@prefix ui: <http://www.w3.org/ns/ui#>.
@prefix n0: <http://purl.org/dc/elements/1.1/>.

:participation
    ic:dtstart "2020-01-07T01:16:43Z"^^XML:dateTime;
    flow:participant c:me;
    ui:backgroundColor "#e1c6c7".
:this
    a mee:LongChat;
    n0:author c:me;
    n0:created "2020-01-07T01:16:41Z"^^XML:dateTime;
    n0:title "Chat channel";
    flow:participation :id1578359803324;
    ui:sharedPreferences :SharedPreferences.

root/chat2.ttl

Resource Based Access Control

The following metadata would grant public read access to chat1.ttl

chat1.ttl.meta

@prefix : <#>.
@prefix n0: <http://www.w3.org/ns/auth/acl#>.
@prefix solid: <https://solidproject.org/ont>

:Read
    a n0:Authorization;
    n0:accessTo <./>:;
    n0:agentClass faof:Agent;
    n0:mode n0:Read.
    solid:constructQuery: "
        CONSTRUCT { ?s ?p ?o } WHERE {
            GRAPH <https://example.com/chats/chat1.ttl>
            { ?s ?p ?o }
        }
    "

Notice that this is very close to an acl. You do not need to define acls anymore, but you can choose to if this server supports and understands acls. This could allow the server to apply queries more efficiently.

However, the only things that MUST be provided are the access mode, the construct query, and the agent class. You can consider this construct query identical to the acl rule's accessTo predicate.

elf-pavlik commented 4 years ago

However, the only things that MUST be provided are the access mode, the construct query, and the agent class. You can consider this construct query identical to the acl rule's accessTo predicate.

In your example I still see :Read n0:accessTo <./> . not sure if you left it in there by accident.

In general it doesn't look to me like current WAC would 'translate' to something else, it looks like extending WAC with solid:constructQuery to write more specific rules.

@ericprud how similar / different do you see it from SHACL https://www.w3.org/TR/shacl/#sparql-constraints?

One more thing we might want to search for in our use cases. Some example which has statement(s) using predicate in reverse direction. Maybe we could even pick up an example from ShEx primer where we have relation between a user and an issue https://shex.io/shex-primer/#inverse-properties or in chat1.ttl we would find statement like c:me ex:moderates :this . so the chat channel appears in the object position. Chat channel moderators could have write access to that channel for example.

In https://github.com/solid/authorization-and-access-control-panel/issues/51#issuecomment-570874556 we can find an example of shape based rule. I think we could take something like that and compare how such property based rule would work based on

jaxoncreed commented 4 years ago

In your example I still see :Read n0:accessTo <./> . not sure if you left it in there by accident.

That was left in on purpose. All rules must have a solid:constructQuery but they could optionally have implementation-specific triples as well, like accessTo

kjetilk commented 4 years ago

There is a simple form of SPARQL CONSTRUCT, BTW.

RubenVerborgh commented 4 years ago

I've been trying to jump into the discussion, as this issue seems very relevant, but I find its current text quite impenetrable.

The above consists of a list of things, which when combined, provide a solution to what specifically?

Note that the current problem section is a listing of techniques, not a problem statement. It's fine to point to other issues to describe it, I just need to understand first exactly what is being solved before I can wrap my head around any potential solution.

kjetilk commented 4 years ago

@RubenVerborgh we're on a call about it right now, please jump in

RubenVerborgh commented 4 years ago

On my way.

bblfish commented 4 years ago

I think it may be worth looking into whether one cannot just extend the current wACL by enlarging the classes of agents as related by the wac:agentClass to groups of agents as defined by an OWL class restriction. That is actually what I proposed to do in my second year report a year ago.