1. Introduction
Sometimes, it would be useful to share certain information between SS14 servers, such as playtime data for playtime transfers. This spec defines a simple but (hopefully) flexible protocol for doing so.
2. Protocol Endpoints
2.1. Instance Information Endpoint
The Instance Information Endpoint is used to retrieve information for an ATS instance.
A GET request to an Instance Information Endpoint MUST be responded to with a [JSON] document, following InstanceInfo.
The document MAY have additional attributes not described in this specification.
interface {InstanceInfo attribute USVString ; // The display name for the instancename attribute USVString ?;desc attribute sequence <InstanceInfoLinks >?;links attribute InstanceInfoAts ; };ats interface {InstanceInfoAts attribute object ; // Signing Key in JWK formatsigningKey attribute USVString ?;pullUrl attribute USVString ?;pushUrl attribute boolean ; // Whether this instance exports data at least partly from another ATS instance. };relayed interface {InstanceInfoLinks attribute USVString ;url attribute USVString ;icon attribute USVString ; };name
2.2. Pull Endpoint
The Pull Endpoint is used to request a specific piece of information from an ATS instance.
If an ATS instance supports the Pull action, the pullUrl attribute MUST point to the Pull Endpoint.
Clients MUST first send an OPTIONS request with the intended request body.
The server MUST respond with one the following:
-
a
204 No Contentresponse, alongside theAccept-Signaturefield as defined in HTTP Message Signatures § section-5.1 if the requesting ATS instance may access the information. -
a
403 Forbiddenresponse if the requesting ATS instance is not allowed access to the requested information. -
a
404 Not Foundresponse if the server cannot provide the requested information.
Instances MAY also respond with 204 No Content instead of 403 Forbidden to prevent public knowledge of which servers are allowed to access what information.
If an 204 No Content response is received, the client can now proceed by sending a POST request with:
-
The same request body as in
OPTIONS. -
A valid HTTP Message Signature defined in [rfc9421], signed using the signing key of the ATS instance.
The request body MUST be a [JSON] document following PullRequest:
interface {PullRequest attribute USVString ; // The Instance Information Endpoint for the requesting instance.requester attribute USVString ; // The category of information requested.category attribute object ?; // More details on the information requested, defined by the category. };specifier
The response body format is a [JSON] document with format defined by the category.
2.3. Push Endpoint
The Push Endpoint is used to notify that a specific piece of information has been updated to an ATS instance.
If an ATS instance supports the Push action, the pushUrl attribute MUST point to the Push Endpoint.
Clients notify the server of an update by sending a POST request with a valid HTTP Message Signature, covering at least the request body, and a body including a [JSON] document following PushRequest:
interface {PushRequest attribute USVString ; // The Instance Information Endpoint for the requesting instance.requester attribute USVString ; // The category of information requested.category attribute object ?; // More details on the information requested, defined by the category.specifier attribute object ; };data
3. Standard Categories
Implementations MAY implement none, some or all of the categories listed in this specification. However, implementations MUST NOT use a category name in the specification in a way incompatible with the specification.
3.1. playtime Category
The playtime category represents the recorded per-role playtime of a player.
Its specifier type is PlaytimeSpecifier and its data type is PlaytimeData.
interface {PlaytimeSpecifier attribute USVString ; // Authentication server of the user.authServer attribute USVString ; // UUID of the user. };user interface {PlaytimeData attribute sequence <PlaytimeEntry >; };jobs interface {PlaytimeEntry attribute USVString ; // ID of the PlayTimeTrackerPrototype, if using wizden system.tracker attribute double ; };minutes
4. Signing Requirements
4.1. Algorithm Requirements
All implementations MUST support theed25519 algorithm as defined in HTTP Message Signatures § section-5.1.
All implementations MUST understand the [rfc8037] format for Ed25519 JWKs.
4.2. Signature Requirements
Implementations MAY reject any signatures or signature requests including any of the following:-
HTTP Message Components other than
@signature-params,@method,@target-uri,content-digest,content-length, andcontent-type. -
The
expiressignature parameter. -
A
Content-Digestheader without asha-256entry. -
A
Content-Digestheader with an entry that is notsha-256.
Implementations SHOULD reject any signature requests including any of the following:
-
More than one signatures.
-
The
alg,keyid, ortagsignature parameters.