@@ -72,17 +72,17 @@ Table of Contents
72
72
12.1. WebFinger................................................12
73
73
12.2. OAuth dialog form........................................13
74
74
12.3. OAuth dialog form submission.............................14
75
- 12.4. OPTIONS preflight........................................14
75
+ 12.4. OPTIONS preflight........................................15
76
76
12.5. Initial PUT..............................................15
77
- 12.6. Subsequent PUT...........................................15
77
+ 12.6. Subsequent PUT...........................................16
78
78
12.7. GET......................................................16
79
79
12.8. DELETE...................................................17
80
80
13. Distributed versioning........................................17
81
81
14. Security Considerations.......................................19
82
82
15. IANA Considerations...........................................20
83
83
16. Acknowledgments...............................................20
84
- 17. References....................................................20
85
- 17.1. Normative References.....................................20
84
+ 17. References....................................................21
85
+ 17.1. Normative References.....................................21
86
86
17.2. Informative References...................................21
87
87
18. Authors' addresses............................................22
88
88
@@ -147,15 +147,14 @@ Internet-Draft remoteStorage December 2014
147
147
* content type
148
148
* content length
149
149
150
-
150
+ For a document, the server stores, and should be able to produce:
151
151
152
152
153
153
de Jong [Page 3]
154
154
155
155
Internet-Draft remoteStorage December 2014
156
156
157
157
158
- For a document, the server stores, and should be able to produce:
159
158
160
159
* current version
161
160
* content type
@@ -198,14 +197,14 @@ Internet-Draft remoteStorage December 2014
198
197
that content length is measured in octets (bytes), not in
199
198
characters.
200
199
200
+ A folder description is a map containing a string-valued 'ETag'
201
201
202
202
203
203
de Jong [Page 4]
204
204
205
205
Internet-Draft remoteStorage December 2014
206
206
207
207
208
- A folder description is a map containing a string-valued 'ETag'
209
208
field, representing the folder's current version.
210
209
211
210
A successful GET request to a folder MUST be responded to with a
@@ -248,14 +247,14 @@ Internet-Draft remoteStorage December 2014
248
247
the full document contents in the body, the document's content type
249
248
in a 'Content-Type' header, its content length in octets (not in
250
249
characters) in a 'Content-Length' header, and the document's current
250
+ version as a strong ETag in an 'ETag' header.
251
251
252
252
253
253
de Jong [Page 5]
254
254
255
255
Internet-Draft remoteStorage December 2014
256
256
257
257
258
- version as a strong ETag in an 'ETag' header.
259
258
260
259
Note that the use of strong ETags prohibits changing the response
261
260
body based on request headers; in particular, the server will not be
@@ -300,6 +299,7 @@ Internet-Draft remoteStorage December 2014
300
299
301
300
302
301
302
+
303
303
de Jong [Page 6]
304
304
305
305
Internet-Draft remoteStorage December 2014
@@ -329,7 +329,7 @@ Internet-Draft remoteStorage December 2014
329
329
existing folder's name at the same level.
330
330
* 412 for a conditional PUT or DELETE request whose pre-condition
331
331
fails (see "Versioning" below),
332
- * 507 in case the user's account is over its storage quota,
332
+ * 507 in case the account is over its storage quota,
333
333
* 4xx for all malformed requests (e.g. foreign characters in the
334
334
path), as well as for all PUT and DELETE requests to
335
335
folders,
@@ -459,8 +459,9 @@ Internet-Draft remoteStorage December 2014
459
459
10. Application-first bearer token issuance
460
460
461
461
To make a remoteStorage server available as 'the remoteStorage of
462
- <user> at <host>', exactly one link of the following format SHOULD
463
- be added to the WebFinger record [WEBFINGER] of <user> at <host>:
462
+ <account> at <host>', exactly one link of the following format
463
+ SHOULD be added to the WebFinger record [WEBFINGER] of <account> at
464
+ <host>:
464
465
465
466
{
466
467
"href": <storage_root>,
@@ -478,9 +479,11 @@ Internet-Draft remoteStorage December 2014
478
479
presented.
479
480
480
481
If <auth-dialog> is a URL, the user can supply their credentials
481
- there (how, is out of scope), and allow or reject a request by the
482
- connecting application to obtain a bearer token for a certain list
483
- of access scopes.
482
+ for accessing the account (how, is out of scope), and allow or
483
+ reject a request by the connecting application to obtain a bearer
484
+ token for a certain list of access scopes. Note that an account
485
+ will often belong to just one human user, but may also belong to a
486
+ group of multiple users (the remoteStorage of <group> at <host>).
484
487
485
488
If <auth-dialog> is null, the client will not have a way to obtain
486
489
an access token, and SHOULD send all requests without Authorization
@@ -496,15 +499,15 @@ Internet-Draft remoteStorage December 2014
496
499
token in the URI query parameter as per section 2.3 of [BEARER],
497
500
instead of in the request header.
498
501
499
- Another example is "http://tools.ietf.org/html/rfc7233" with a
500
- string value of "GET" if Content-Range headers are supported for
501
-
502
502
503
503
de Jong [Page 10]
504
504
505
505
Internet-Draft remoteStorage December 2014
506
506
507
507
508
+
509
+ Another example is "http://tools.ietf.org/html/rfc7233" with a
510
+ string value of "GET" if Content-Range headers are supported for
508
511
GET requests as per [RANGE], "PUT" if they are supported for PUT
509
512
requests, and "GET,PUT" if supported for both.
510
513
@@ -528,7 +531,6 @@ Internet-Draft remoteStorage December 2014
528
531
client_id parameter in favor of relying on the redirect_uri
529
532
parameter for client identification.
530
533
531
-
532
534
11. Storage-first bearer token issuance
533
535
534
536
The provider MAY also present a dashboard to the user, where they
@@ -546,21 +548,22 @@ Internet-Draft remoteStorage December 2014
546
548
When the user gestures they want to use a certain application whose
547
549
manifest is present on the dashboard, the dashboard SHOULD redirect
548
550
to the application or open it in a new window. To mimic coming back
549
- from the OAuth dialog, it MAY add 'access_token' and 'scope'
550
- fields to the URL fragment.
551
551
552
552
553
553
de Jong [Page 11]
554
554
555
555
Internet-Draft remoteStorage December 2014
556
556
557
557
558
+ from the OAuth dialog, it MAY add 'access_token' and 'scope'
559
+ fields to the URL fragment.
558
560
559
561
Regardless of whether 'access_token' and 'scope' are specified, it
560
562
SHOULD add a 'remotestorage' field to the URL fragment, with a
561
- value of the form <user> '@' <host>. When the application detects
562
- this parameter, it SHOULD resolve the WebFinger record for <user> at
563
- <host> and extract the <storage_root> and <storage_api> information.
563
+ value of the form <account> '@' <host>. When the application detects
564
+ this parameter, it SHOULD resolve the WebFinger record for <account>
565
+ at <host> and extract the <storage_root> and <storage_api>
566
+ information.
564
567
565
568
If no access_token was given, then the application SHOULD also
566
569
extract the <auth_endpoint> information from WebFinger, and continue
@@ -569,10 +572,10 @@ Internet-Draft remoteStorage December 2014
569
572
Note that whereas a remoteStorage server SHOULD offer support for
570
573
the application-first flow with WebFinger and OAuth, it MAY choose
571
574
not to support the storage-first flow, provided that users will
572
- easily remember their <user > '@' <host> WebFinger address at that
575
+ easily remember their <account > '@' <host> WebFinger address at that
573
576
provider. Applications SHOULD, however, support both flows, which
574
577
means checking the URL for a 'remotestorage' parameter, but giving
575
- the user a way to specify their WebFinger address if there is none.
578
+ the user a way to specify the WebFinger address if there is none.
576
579
577
580
If a server provides an application manifest dashboard, then it
578
581
SHOULD merge the list of applications there with the list of
@@ -596,15 +599,15 @@ Internet-Draft remoteStorage December 2014
596
599
In application-first, an in-browser application might issue the
597
600
following request, using XMLHttpRequest and CORS:
598
601
599
- GET /.well-known/webfinger?resource=acct:michiel@michielbdejon\
600
- g.com HTTP/1.1
601
-
602
602
603
603
de Jong [Page 12]
604
604
605
605
Internet-Draft remoteStorage December 2014
606
606
607
607
608
+
609
+ GET /.well-known/webfinger?resource=acct:michiel@michielbdejon\
610
+ g.com HTTP/1.1
608
611
Host: michielbdejong.com
609
612
610
613
and the server's response might look like this:
@@ -644,17 +647,17 @@ motestorage-04",
644
647
end-point, it will typically redirect the user to this URL, in
645
648
order to obtain a bearer token. Say the application is hosted on
646
649
https://drinks-unhosted.5apps.com/ and wants read-write access to
647
- the user's "myfavoritedrinks" scope:
648
-
649
- GET /oauth/michiel?redirect_uri=https%3A%2F%2Fdrinks-unhosted.5\
650
- apps.com%2F&scope=myfavoritedrinks%3Arw&client_id=https%3A%2F%2Fdrinks-\
650
+ the account's "myfavoritedrinks" scope:
651
651
652
652
653
653
de Jong [Page 13]
654
654
655
655
Internet-Draft remoteStorage December 2014
656
656
657
657
658
+
659
+ GET /oauth/michiel?redirect_uri=https%3A%2F%2Fdrinks-unhosted.5\
660
+ apps.com%2F&scope=myfavoritedrinks%3Arw&client_id=https%3A%2F%2Fdrinks-\
658
661
unhosted.5apps.com&response_type=token HTTP/1.1
659
662
Host: 3pp.io
660
663
@@ -668,7 +671,6 @@ unhosted.5apps.com&response_type=token HTTP/1.1
668
671
<title>Allow access?</title>
669
672
...
670
673
671
-
672
674
12.3. OAuth dialog form submission
673
675
674
676
When the user submits the form, the request would look something
@@ -696,15 +698,15 @@ XjzzzHNjkd1CJxoQubA1o%3D&token_type=bearer&state=
696
698
697
699
12.4. OPTIONS preflight
698
700
699
- When an in-browser application makes a cross-origin request which
700
- may affect the server-state, the browser will make a preflight
701
701
702
702
703
703
de Jong [Page 14]
704
704
705
705
Internet-Draft remoteStorage December 2014
706
706
707
707
708
+ When an in-browser application makes a cross-origin request which
709
+ may affect the server-state, the browser will make a preflight
708
710
request first, with the OPTIONS verb, for instance:
709
711
710
712
OPTIONS /storage/michiel/myfavoritedrinks/ HTTP/1.1
@@ -722,7 +724,6 @@ Internet-Draft remoteStorage December 2014
722
724
Access-Control-Allow-Headers: Authorization, Content-Length, Co\
723
725
ntent-Type, Origin, X-Requested-With, If-Match, If-None-Match
724
726
725
-
726
727
12.5. Initial PUT
727
728
728
729
An initial PUT may contain an 'If-None-Match: *' header, like this:
@@ -749,12 +750,12 @@ ntent-Type, Origin, X-Requested-With, If-Match, If-None-Match
749
750
12.6. Subsequent PUT
750
751
751
752
752
-
753
753
de Jong [Page 15]
754
754
755
755
Internet-Draft remoteStorage December 2014
756
756
757
757
758
+
758
759
A subsequent PUT may contain an 'If-Match' header referring to the
759
760
ETag previously returned, like this:
760
761
@@ -797,14 +798,14 @@ e.io/spec/modules/myfavoritedrinks/drink"}
797
798
Or a 200 OK status, plus a response body:
798
799
799
800
HTTP/1.1 200 OK
800
- Access-Control-Allow-Origin: https://drinks-unhosted.5apps.com
801
801
802
802
803
803
de Jong [Page 16]
804
804
805
805
Internet-Draft remoteStorage December 2014
806
806
807
807
808
+ Access-Control-Allow-Origin: https://drinks-unhosted.5apps.com
808
809
Content-Type: application/json; charset=UTF-8
809
810
Content-Length: 106
810
811
ETag: "1382694048000"
@@ -847,14 +848,14 @@ charset=UTF-8","Content-Length":106}}}
847
848
Referer: https://drinks-unhosted.5apps.com/?
848
849
If-Match: "1382694045000"
849
850
850
- And the server may respond with a 412 Conflict or a 200 OK status:
851
851
852
852
853
853
de Jong [Page 17]
854
854
855
855
Internet-Draft remoteStorage December 2014
856
856
857
857
858
+ And the server may respond with a 412 Conflict or a 200 OK status:
858
859
859
860
HTTP/1.1 412 Conflict
860
861
Access-Control-Allow-Origin: https://drinks-unhosted.5apps.com
@@ -897,14 +898,14 @@ Internet-Draft remoteStorage December 2014
897
898
to the root folder, it is not necessary to poll each document for
898
899
changes individually.
899
900
900
- As an example, the root folder may contain 10 directories,
901
901
902
902
903
903
de Jong [Page 18]
904
904
905
905
Internet-Draft remoteStorage December 2014
906
906
907
907
908
+ As an example, the root folder may contain 10 directories,
908
909
each of which contain 10 directories, which each contain 10
909
910
documents, so their paths would be for instance '/0/0/1', '/0/0/2',
910
911
etcetera. Then one GET request to the root folder '/' will be
@@ -930,11 +931,11 @@ Internet-Draft remoteStorage December 2014
930
931
application launch dashboard.
931
932
932
933
A malicious party could link to an application, but specifying a
933
- remoteStorage user address that it controls, thus tricking the user
934
- into using a trusted application to send sensitive data to the wrong
935
- remoteStorage server. To mitigate this, applications SHOULD clearly
936
- display to which remoteStorage server they are sending the user's
937
- data.
934
+ remoteStorage account address that it controls, thus tricking the
935
+ user into using a trusted application to send sensitive data to the
936
+ wrong remoteStorage server. To mitigate this, applications SHOULD
937
+ clearly display to which remoteStorage server they are sending the
938
+ user's data.
938
939
939
940
Applications could request scopes that the user did not intend to
940
941
give access to. The user SHOULD always be prompted to carefully
@@ -947,14 +948,14 @@ Internet-Draft remoteStorage December 2014
947
948
therefore NOT be used for anything else, and the user SHOULD be
948
949
warned not to visit any web pages on that origin. In particular, the
949
950
OAuth dialog and launch dashboard or token revokation interface
950
- SHOULD be on a different origin than the remoteStorage interface.
951
951
952
952
953
953
de Jong [Page 19]
954
954
955
955
Internet-Draft remoteStorage December 2014
956
956
957
957
958
+ SHOULD be on a different origin than the remoteStorage interface.
958
959
959
960
Where the use of bearer tokens is impractical, a user may choose to
960
961
store documents on hard-to-guess URLs whose path after
@@ -999,12 +1000,12 @@ Internet-Draft remoteStorage December 2014
999
1000
Levels", BCP 14, RFC 2119, March 1997.
1000
1001
1001
1002
1002
-
1003
1003
de Jong [Page 20]
1004
1004
1005
1005
Internet-Draft remoteStorage December 2014
1006
1006
1007
1007
1008
+
1008
1009
[IRI]
1009
1010
Duerst, M., "Internationalized Resource Identifiers (IRIs)",
1010
1011
RFC 3987, January 2005.
@@ -1017,7 +1018,6 @@ Internet-Draft remoteStorage December 2014
1017
1018
"Section 4.2: Implicit Grant", in: Hardt, D. (ed), "The OAuth
1018
1019
2.0 Authorization Framework", RFC6749, October 2012.
1019
1020
1020
-
1021
1021
17.2. Informative References
1022
1022
1023
1023
[HTTPS]
0 commit comments