@@ -565,16 +565,16 @@ Internet-Draft remoteStorage June 2016
565
565
566
566
The server MAY expire bearer tokens, and MAY require the user to
567
567
register applications as OAuth clients before first use; if no
568
- client registration is required, then the server MAY ignore the
569
- value of the client_id parameter in favor of relying on the origin
570
- of the redirect_uri parameter for unique client identification. See
571
- section 4 of [ORIGIN] for computing the Origin .
568
+ client registration is required, the server MUST ignore the value of
569
+ the client_id parameter in favor of relying on the origin of the
570
+ redirect_uri parameter for unique client identification. See section
571
+ 4 of [ORIGIN] for computing the origin .
572
572
573
573
11. Storage-first bearer token issuance
574
574
575
575
To request that the application connects to the user account
576
576
<account> ' ' <host>, providers MAY redirect to applications with a
577
- ` remotestorage` field in the URL fragment, with the user account as
577
+ ' remotestorage' field in the URL fragment, with the user account as
578
578
value.
579
579
580
580
The appplication MUST make sure this request is intended by the
@@ -583,6 +583,11 @@ Internet-Draft remoteStorage June 2016
583
583
SHOULD connect to the given provider account, as defined in Section
584
584
10.
585
585
586
+ If the 'remotestorage' field exists in the URL fragment, the
587
+ application SHOULD ignore any other parameters such as
588
+ 'access_token' or 'state', to ensure compatibility with servers
589
+ that implement older versions of this specification.
590
+
586
591
12. Example wire transcripts
587
592
588
593
The following examples are not normative ("\" indicates a line was
@@ -593,18 +598,18 @@ Internet-Draft remoteStorage June 2016
593
598
In application-first, an in-browser application might issue the
594
599
following request, using XMLHttpRequest and CORS:
595
600
596
- GET /.well-known/webfinger?resource=acct:michiel@michielbdejon\
597
- g.com HTTP/1.1
598
- Host: michielbdejong.com
599
-
600
- and the server's response might look like this:
601
601
602
602
603
603
de Jong [Page 12]
604
604
605
605
Internet-Draft remoteStorage June 2016
606
606
607
607
608
+ GET /.well-known/webfinger?resource=acct:michiel@michielbdejon\
609
+ g.com HTTP/1.1
610
+ Host: michielbdejong.com
611
+
612
+ and the server's response might look like this:
608
613
609
614
HTTP/1.1 200 OK
610
615
Access-Control-Allow-Origin: *
@@ -643,18 +648,18 @@ motestorage-06",
643
648
644
649
GET /oauth/michiel?redirect_uri=https%3A%2F%2Fdrinks-unhosted.5\
645
650
apps.com%2F&scope=myfavoritedrinks%3Arw&client_id=https%3A%2F%2Fdrinks-\
646
- unhosted.5apps.com&response_type=token HTTP/1.1
647
- Host: 3pp.io
648
-
649
- The server's response might look like this (truncated for brevity):
650
-
651
651
652
652
653
653
de Jong [Page 13]
654
654
655
655
Internet-Draft remoteStorage June 2016
656
656
657
657
658
+ unhosted.5apps.com&response_type=token HTTP/1.1
659
+ Host: 3pp.io
660
+
661
+ The server's response might look like this (truncated for brevity):
662
+
658
663
HTTP/1.1 200 OK
659
664
660
665
<!DOCTYPE html>
@@ -694,17 +699,17 @@ low
694
699
may affect the server-state, the browser will make a preflight
695
700
request first, with the OPTIONS verb, for instance:
696
701
697
- OPTIONS /storage/michiel/myfavoritedrinks/ HTTP/1.1
698
- Host: 3pp.io:4439
699
- Access-Control-Request-Method: GET
700
- Origin: https://drinks-unhosted.5apps.com
701
-
702
702
703
703
de Jong [Page 14]
704
704
705
705
Internet-Draft remoteStorage June 2016
706
706
707
707
708
+
709
+ OPTIONS /storage/michiel/myfavoritedrinks/ HTTP/1.1
710
+ Host: 3pp.io:4439
711
+ Access-Control-Request-Method: GET
712
+ Origin: https://drinks-unhosted.5apps.com
708
713
Access-Control-Request-Headers: Authorization
709
714
Referer: https://drinks-unhosted.5apps.com/
710
715
@@ -744,17 +749,17 @@ ntent-Type, Origin, X-Requested-With, If-Match, If-None-Match
744
749
A subsequent PUT may contain an 'If-Match' header referring to the
745
750
ETag previously returned, like this:
746
751
747
- PUT /storage/michiel/myfavoritedrinks/test HTTP/1.1
748
- Host: 3pp.io:4439
749
- Content-Length: 91
750
- Origin: https://drinks-unhosted.5apps.com
751
-
752
752
753
753
de Jong [Page 15]
754
754
755
755
Internet-Draft remoteStorage June 2016
756
756
757
757
758
+
759
+ PUT /storage/michiel/myfavoritedrinks/test HTTP/1.1
760
+ Host: 3pp.io:4439
761
+ Content-Length: 91
762
+ Origin: https://drinks-unhosted.5apps.com
758
763
Authorization: Bearer j2YnGtXjzzzHNjkd1CJxoQubA1o=
759
764
Content-Type: application/json; charset=UTF-8
760
765
Referer: https://drinks-unhosted.5apps.com/
@@ -793,18 +798,18 @@ e.io/spec/modules/myfavoritedrinks/drink"}
793
798
Access-Control-Allow-Origin: https://drinks-unhosted.5apps.com
794
799
Content-Type: application/json; charset=UTF-8
795
800
Content-Length: 106
796
- ETag: "1382694048000"
797
- Cache-Control: no-cache
798
-
799
- {"name":"test", "updated":true, "@context":"http://remotestora\
800
- ge.io/spec/modules/myfavoritedrinks/drink"}
801
801
802
802
803
803
de Jong [Page 16]
804
804
805
805
Internet-Draft remoteStorage June 2016
806
806
807
807
808
+ ETag: "1382694048000"
809
+ Cache-Control: no-cache
810
+
811
+ {"name":"test", "updated":true, "@context":"http://remotestora\
812
+ ge.io/spec/modules/myfavoritedrinks/drink"}
808
813
809
814
If the GET URL would have been "/storage/michiel/myfavoritedrinks/",
810
815
a 200 OK response would have a folder description as the response
@@ -843,18 +848,18 @@ charset=UTF-8","Content-Length":106}}}
843
848
And the server may respond with a 412 Conflict or a 200 OK status:
844
849
845
850
HTTP/1.1 412 Conflict
846
- Access-Control-Allow-Origin: https://drinks-unhosted.5apps.com
847
- ETag: "1382694048000"
848
-
849
-
850
-
851
851
852
852
853
853
de Jong [Page 17]
854
854
855
855
Internet-Draft remoteStorage June 2016
856
856
857
857
858
+ Access-Control-Allow-Origin: https://drinks-unhosted.5apps.com
859
+ ETag: "1382694048000"
860
+
861
+
862
+
858
863
13. Distributed versioning
859
864
860
865
This section is non-normative, and is intended to explain some of
@@ -893,18 +898,18 @@ Internet-Draft remoteStorage June 2016
893
898
changes individually.
894
899
895
900
As an example, the root folder may contain 10 directories,
896
- each of which contain 10 directories, which each contain 10
897
- documents, so their paths would be for instance '/0/0/1', '/0/0/2',
898
- etcetera. Then one GET request to the root folder '/' will be
899
- enough to know if any of these 1000 documents has changed.
900
-
901
901
902
902
903
903
de Jong [Page 18]
904
904
905
905
Internet-Draft remoteStorage June 2016
906
906
907
907
908
+ each of which contain 10 directories, which each contain 10
909
+ documents, so their paths would be for instance '/0/0/1', '/0/0/2',
910
+ etcetera. Then one GET request to the root folder '/' will be
911
+ enough to know if any of these 1000 documents has changed.
912
+
908
913
Say document '/7/9/2' has changed; then the GET request to '/' will
909
914
come back with a different ETag, and entry '7/' will have a
910
915
different value in its JSON content. The client could then request
@@ -944,17 +949,17 @@ Internet-Draft remoteStorage June 2016
944
949
OAuth dialog and launch dashboard or token revocation interface
945
950
SHOULD be on a different origin than the remoteStorage interface.
946
951
947
- Where the use of bearer tokens is impractical, a user may choose to
948
- store documents on hard-to-guess URLs [CAPABILITIES] whose path
949
- after <storage_root> starts with '/public/', while sharing this URL
950
- only with the intended audience. That way, only parties who know the
951
-
952
952
953
953
de Jong [Page 19]
954
954
955
955
Internet-Draft remoteStorage June 2016
956
956
957
957
958
+
959
+ Where the use of bearer tokens is impractical, a user may choose to
960
+ store documents on hard-to-guess URLs [CAPABILITIES] whose path
961
+ after <storage_root> starts with '/public/', while sharing this URL
962
+ only with the intended audience. That way, only parties who know the
958
963
document's hard-to-guess URL, can access it. The server SHOULD
959
964
therefore make an effort to detect and stop brute-force attacks that
960
965
attempt to guess the location of such documents.
@@ -993,18 +998,18 @@ Internet-Draft remoteStorage June 2016
993
998
Levels", BCP 14, RFC 2119, March 1997.
994
999
995
1000
[IRI]
996
- Duerst, M., "Internationalized Resource Identifiers (IRIs)",
997
- RFC 3987, January 2005.
998
-
999
- [URI]
1000
- Fielding, R., "Uniform Resource Identifier (URI): Generic
1001
1001
1002
1002
1003
1003
de Jong [Page 20]
1004
1004
1005
1005
Internet-Draft remoteStorage June 2016
1006
1006
1007
1007
1008
+ Duerst, M., "Internationalized Resource Identifiers (IRIs)",
1009
+ RFC 3987, January 2005.
1010
+
1011
+ [URI]
1012
+ Fielding, R., "Uniform Resource Identifier (URI): Generic
1008
1013
Syntax", RFC 3986, January 2005.
1009
1014
1010
1015
[WEBFINGER]
@@ -1043,18 +1048,18 @@ Internet-Draft remoteStorage June 2016
1043
1048
[JSON-LD]
1044
1049
M. Sporny, G. Kellogg, M. Lanthaler, "JSON-LD 1.0", W3C
1045
1050
Proposed Recommendation,
1046
- http://www.w3.org/TR/2014/REC-json-ld-20140116/, January 2014.
1047
-
1048
- [CORS]
1049
- van Kesteren, Anne (ed), "Cross-Origin Resource Sharing --
1050
- W3C Candidate Recommendation 29 January 2013",
1051
1051
1052
1052
1053
1053
de Jong [Page 21]
1054
1054
1055
1055
Internet-Draft remoteStorage June 2016
1056
1056
1057
1057
1058
+ http://www.w3.org/TR/2014/REC-json-ld-20140116/, January 2014.
1059
+
1060
+ [CORS]
1061
+ van Kesteren, Anne (ed), "Cross-Origin Resource Sharing --
1062
+ W3C Candidate Recommendation 29 January 2013",
1058
1063
http://www.w3.org/TR/cors/, January 2013.
1059
1064
1060
1065
[KERBEROS]
@@ -1095,9 +1100,4 @@ Internet-Draft remoteStorage June 2016
1095
1100
1096
1101
1097
1102
1098
-
1099
-
1100
-
1101
-
1102
-
1103
1103
de Jong [Page 22]
0 commit comments