URL Scheme for Activity Streams 2.0

Author: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>

Copyright © 2017 Akihiko Odaki. Licensed under CC0 1.0.

Abstract

This specification describes URL scheme to declare it is Activity Streams 2.0.

Author's Note

This draft is written to implement intent feature in Mastodon, an Activity Streams implementation.

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document.

This document was published by the author as a proposal for Mastodon and other Activity Streams applications. Please write comments regarding this document to the following issue in Mastodon:
URL scheme for remote follow, share buttons · Issue #2291 · tootsuite/mastodon

This document is expected to be useful also for other Activity Streams applications. If you have any request to change for them, please contact the author. E-mail is the most reliable means for that, but OStatus2 is also acceptable. Send a note to @fn_aki@pawoo.net.

1. Introduction

Chromium is a popular Web browser, and provides to implement a custom protocol handler for some URL schemes. This defines a URL scheme specific to Activity Streams 2.0 to take advantage of the feature.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", " SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

2. web+activity+data URL Scheme

All of the requirements data scheme listed in [RFC2397] are also requirements for web+activity+data scheme, except that it is explicitly declared to be an Activity Streams representation and <mediatype> defaults to application/activity+json;charset=UTF-8 if it is omitted. As a shorthand, application/activity+json can be omitted but the charset parameter supplied.

3. web+activity+https URL Scheme

All of the requirements for https scheme listed in [RFC7230], Section 2.7.2 are also requirements for the web+activity+https scheme, except that it is explicitly declared to be an Activity Streams representation, and the user agent MUST set application/ld+json; profile="https://www.w3.org/ns/activitystreams" for the Accept header field defined in [RFC7231], Section 5.3.2.

The syntax is specified using the following [ABNF] syntax description.

authority = <authority, see [RFC3986], Section 3.2>
path-abempty = <path-abempty, see [RFC3986], Section 3.3>
query = <query, see [RFC3986], Section 3.4>
fragment = <fragment, see [RFC3986], Section 3.5>
web-activity-https-URI = "web+activity+https:" "//" authority path-abempty [ "?" query ] [ "#" fragment ]

4. Implementation Notes

4.1 Writing URLs of Activity Streams Representations

This section is non-normative.

The main use case of schemes defined in this specification is to allow more Web browsers to have a custom handler. If writing a URL of Activity Streams representation for public and it is intended to be processed by Activity Streams applications, the link SHOULD use those schemes for better compatibility.

If the URLs are intended to be processed by a generic application rather than Activity Streams applications, the link SHOULD NOT use schemes defined in this specification. For example, if a URL is specified as href attribute of a element with truthy download attribute, its scheme SHOULD be https rather than web+activity+https. Here, href attribute, a element and download attribute are specified in [HTML5].

4.2 Consuming URLs of Activity Streams Representations

This section is non-normative.

If a consumer of URLs understands web+activity+data scheme, it SHOULD understand data scheme for the same purposes to achieve interoperability.

If a consumer of URLs understands web+activity+https scheme, it SHOULD understand https scheme for the same purposes to achieve better interoperability.

4.3 Advertising the Use of Schemes

This section is non-normative.

A public provider of schemes defined in this specification SHOULD advertise the use of the schemes for potential consumers.

5. Security Considerations

This section is non-normative.

A scheme corresponding to http scheme is not defined in this document and URLs such a scheme SHOULD NOT be used to deliver them to public.

A. References

A.1 Normative References

[ABNF]
Augmented BNF for Syntax Specifications: ABNF. D. Crocker, Ed.; P. Overell. IETF. January 2008. Internet Standard. URL: https://tools.ietf.org/html/rfc5234
[Activity Streams 2.0]
James M Snell; Evan Prodromou. W3C. URL: https://www.w3.org/TR/activitystreams-core/
[RFC2119]
Key words for use in RFCs to Indicate Requirement Levels. S. Bradner. IETF. March 1997. Best Current Practice. URL: https://tools.ietf.org/html/rfc2119
[RFC2397]
The "data" URL scheme: L. Masinter. Internet Standard. URL: https://tools.ietf.org/html/rfc2397
[RFC3986]
Uniform Resource Identifier (URI): Generic Syntax. T. Berners-Lee; R. Fielding; L. Masinter. IETF. January 2005. Internet Standard. URL: https://tools.ietf.org/html/rfc3986
[RFC7230]
Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing: R. Fielding; J. Reschke. Internet Standard. URL: https://tools.ietf.org/html/rfc7230
[RFC7231]
Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content: R. Fielding; J. Reschke. Internet Standard. URL: https://tools.ietf.org/html/rfc7231

A.2 Informative References

[HTML5]
HTML5. Ian Hickson; Robin Berjon; Steve Faulkner; Travis Leithead; Erika Doyle Navara; Theresa O'Connor; Silvia Pfeiffer. W3C. URL: https://www.w3.org/TR/html5/