Skip to content

Commit 6a3f609

Browse files
author
Tim Berners-Lee
committed
Working on web app authorization
1 parent 34b55a9 commit 6a3f609

File tree

2 files changed

+61
-13
lines changed

2 files changed

+61
-13
lines changed

Background.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ What could be done? The browser manufacturers implemented some hooks to allow da
2828
Access-control-allow-Origin: *
2929
```
3030
At the same time they added a feature to allow the data publisher to specify other a limited set of other origins which would be allowed access. This makes running a bank easier if also the credit card company code can access your customers data.
31-
31+
```
3232
Access-control-allow-Origin: credit card company.example.com
33-
33+
```
3434
This meant that anyone publishing public data has to add
3535

3636
```
@@ -39,6 +39,24 @@ Access-control-allow-Origin: *
3939
in any response. This meant a huge amount of work for random open data publishers
4040
all over the web, an effort which in many cases for many reasonable reasons was not done, leaving the data available to browsers, but unavailable to web apps.
4141

42+
The browser actually looks for these headers not on the request itself, but in
43+
on a "Pre-flight" OPTIONS request which is inserted before the main request. So while the developer may see in the browser console only the main request, the number of round trips has in fact increased.
44+
45+
### Header blocking
46+
47+
As well as blocking the data, the CORS system blocks headers from the server to the web app.
48+
To prevent this this, the server must send another [header](https://www.w3.org/TR/cors/#access-control-allow-headers-response-header):
49+
```
50+
Access-Control-Allow-Headers: Authorization, User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Accept-Post, Updates-Via, Allow, WAC-Allow, Content-Length, WWW-Authenticate
51+
```
52+
This must include things like the Link: header which are normal headers blocked by the browser, and also any new headers the app and serve are using for any purpose.
53+
54+
### Method blocking
55+
56+
### Example
57+
58+
One solid server does CORS [this way](https://github.com/solid/node-solid-server/blob/master/lib/create-app.js#L26)
59+
4260
## The CORS twist
4361

4462
The twist is that in fact the designers of CORS make it even more difficult.
@@ -142,6 +160,8 @@ It seems also that Firefox showed the same behavior for in 2018-07
142160
## References
143161

144162
- [WXSS] [Wikipedia, "Cross-site scripting"](https://en.wikipedia.org/wiki/Cross-site_scripting)
163+
- [CORS] [Cross-Origin Resource Sharing
164+
W3C Recommendation](https://www.w3.org/TR/cors/) 16 January 2014
145165
- [WCORS][Cross-origin resource sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)
146166
- [WSOP] [Wikipedia, "
147167
Same-origin policy"](https://en.wikipedia.org/wiki/Same-origin_policy)

README.md

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -394,22 +394,29 @@ In solid a maxim is, you have complete control of he data. Therefore it is up to
394394
- A writer could give in their profile a statement that they will allow readers to use a given app.
395395

396396
```
397-
<#me> acl:trusts <https://calendar.example.com>.
398-
<#me> acl:trustsForRead <https://contacts.example.com>.
397+
<#me> acl:trustedApp [acl:origin <https://calendar.example.com> acl:mode acl:Read , acl:Append].
398+
<#me> acl:trustedApp [acl:origin <https://contacts.example.com> acl:mode acl:Read , acl:Write, acl:Control] .
399399
```
400400

401-
- A reader can ask to use a given app, by publishing the fact that she trusts a given app.
401+
We define the owners of the resource as people given explicit Control access to it.
402+
(Possible future change: also anyone with Control access, even through a group, as the group can be used as a role)
402403

403-
```
404-
<#me> acl:trustsForUse <https://calendar.example.com>.
405-
<#me> acl:trustsForUseForRead <https://contacts.example.com>.
406-
```
404+
For each owner x, the server looks up the (extended?) profile, and looks in it for a
405+
triple of the form
406+
407+
```
408+
?x acl:trustedApp ?y .
409+
```
410+
The set of trust objects is the accumulated set of ?y found in this way.
411+
412+
For the app ?z to have access, for every mode of access ?m required
413+
there must be some trust object ?y such that
414+
```
415+
?y acl:origin ?z ; acl:mode ?m .
416+
```
417+
Note access to different modes may be given in the same or different trust objects.
407418

408-
A writer could have also more sophisticated requirements, such as that any app Alice
409-
wants to use must be signed by developer from a given list, and so on.
410419

411-
Therefore, by pulling the profiles of the reader and/or the writer, and/or the Origin app itself,
412-
the system can be adjusted to allow new apps to be added without bad things happening
413420

414421
## Referring to Resources
415422

@@ -500,6 +507,10 @@ An example ACL for a container would look something like:
500507
`acl:default`, both in the specs and in implementing servers. The semantics, as
501508
described here, will remain the same
502509

510+
## See also
511+
512+
[Background on CORS](https://sold.github.io/web-access-control-spec/Background)
513+
503514
## Old discussion of access to group files
504515

505516
##### Group Listings - Authentication of External Requests
@@ -619,6 +630,23 @@ If the loop was created by malicious actors, this is comparable to a very
619630
small, low volume DDOS attack, which experienced server operators know how to
620631
guard against. In either case, the consequences are not disastrous.
621632

633+
634+
### Other ideas about specifying trusted apps
635+
636+
- A reader can ask to use a given app, by publishing the fact that she trusts a given app.
637+
638+
```
639+
<#me> acl:trustsForUse [acl:origin <https://calendar.example.com> acl:mode acl:Read , acl:Append].
640+
<#me> acl:trustsForUse [acl:origin <https://contacts.example.com> acl:mode acl:Read , acl:Write, acl:Control] .
641+
```
642+
643+
A writer could have also more sophisticated requirements, such as that any app Alice
644+
wants to use must be signed by developer from a given list, and so on.
645+
646+
Therefore, by pulling the profiles of the reader and/or the writer, and/or the Origin app itself,
647+
the system can be adjusted to allow new apps to be added without bad things happening
648+
649+
622650
## Not Supported by Design
623651

624652
This section describes some features or acl-related terms that are not included

0 commit comments

Comments
 (0)