Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shape of ACL #169

Closed
csarven opened this issue Apr 23, 2020 · 5 comments
Closed

Shape of ACL #169

csarven opened this issue Apr 23, 2020 · 5 comments

Comments

@csarven
Copy link
Member

csarven commented Apr 23, 2020

As clients can create ACLs, servers need to have deterministic handling of the request. Clients and servers need to have a shared understanding and expectation of the information within ACL documents. Invalid ACLs pose potential security issues. Defining an ACL shape to validate request payload can be a way to address this.

Related issues: #56 , #57 , solid/web-access-control-spec#78 , #130 , #67 , #193

@NSeydoux
Copy link

Related issue: #186

@tpluscode
Copy link

tpluscode commented Mar 16, 2021

I'd like to propose SHACL as one standards-based way to describe these shapes.

Questions:

  1. Should acl:mode allow custom modes other than the predefined three?

Authorization

@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix acl: <http://www.w3.org/ns/auth/acl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

acl:Authorization
    a rdfs:Class, sh:NodeShape ;
    sh:or
        (
            [
                # either an acl:agent
                sh:property
                    [
                        a sh:PropertyShape ;
                        sh:minCount 1 ;
                        sh:nodeKind sh:IRI ;
                        sh:path acl:agent
                    ]
            ] [
                  # or class of agents
                  sh:property
                      [
                          a sh:PropertyShape ;
                          sh:minCount 1 ;
                          sh:path acl:agentClass ;
                          sh:nodeKind sh:IRI ;
                      ]
              ] [
                    # or multiple groups
                    sh:property
                        [
                            a sh:PropertyShape ;
                            sh:minCount 1 ;
                            sh:path acl:agentGroup ;
                            sh:class vcard:Group ;
                        ]
                ]
        ) ;
    sh:or
        (
            [
                # either direct resource access
                sh:property
                    [
                        a sh:PropertyShape ;
                        sh:minCount 1 ;
                        sh:nodeKind sh:IRI ;
                        sh:path acl:accessTo
                    ]
            ]
            [
                # or class access
                sh:property
                    [
                        a sh:PropertyShape ;
                        sh:minCount 1 ;
                        sh:nodeKind sh:IRI ;
                        sh:path acl:accessToClass
                    ]
            ]
        ) ;
    sh:property
        [
            a sh:PropertyShape ;
            sh:in ( acl:Read acl:Write acl:Control ) ;
            sh:minCount 1 ;
            sh:path acl:mode
        ],
        [
            a sh:PropertyShape ;
            sh:hasValue acl:Authorization ;
            sh:path rdf:type
        ] ;
.

Group:

@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

vcard:Group a rdfs:Class, sh:NodeShape ;
  sh:property
    [
      a sh:PropertyShape ;
      sh:datatype xsd:dateTime ;
      sh:maxCount 1 ;
      sh:path dcterms:modified ;
    ],
    [
      a sh:PropertyShape ;
      sh:datatype xsd:dateTime ;
      sh:maxCount 1 ;
      sh:path dcterms:created ;
    ],
    [
      a sh:PropertyShape ;
      sh:maxCount 1 ;
      sh:minCount 1 ;
      sh:nodeKind sh:IRI ;
      sh:path vcard:hasUID ;
      sh:pattern "^urn:uuid:"
    ],
    [
      a sh:PropertyShape ;
      sh:nodeKind sh:IRI ;
      sh:path vcard:hasMember
    ],
    [
      a sh:PropertyShape ;
      sh:hasValue vcard:Group ;
      sh:path rdf:type
    ] .

By the way, I think that the readme uses the wrong Dublin Core namespace.

EDIT: it's also missing acl:agentClass (added above)

@acoburn
Copy link
Member

acoburn commented Mar 16, 2021

acl:agent should not have a sh:maxCount 1

And acl:Append is missing from the list of modes

@tpluscode
Copy link

tpluscode commented Mar 16, 2021

Ok, I removed this restriction from properties

@csarven
Copy link
Member Author

csarven commented Jul 1, 2021

Thanks for this issue and discussion. Closing this issue as consensus is deemed to be captured in WAC Editor's Draft: https://solid.github.io/web-access-control-spec/ . See #authorization-conformance . Please use https://github.com/solid/web-access-control-spec for future discussion.

@csarven csarven closed this as completed Jul 1, 2021
Specification automation moved this from To Do to Done Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Specification
  
Done
Development

No branches or pull requests

4 participants