-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define a collection metadata API to facilitate collaboration with external applications #1003
Comments
The Is Is there even a need for sub-endpoints when If deemed useful query parameters could serve for filtering ( |
Hi @Kissaki and thank you for taking the time to participate in this RFC 😃
The examples are different because in the first example I deliberately include only the minimal attributes of the In the end, if we actually only keep
{
"id": "service1",
"name": "Service 1",
"terms": [ "Terms of Service", "Privacy Policy"]
} Here is an example of a response with all the attributes to know what is available.
{
"id": "service1",
"name": "Service 1",
"terms": [
{
"type": "Terms of Service",
"sourceDocuments": [
{
"location": "https://service1.com/tos-1",
"executeClientScripts": false,
"contentSelectors": "#main",
"insignificantContentSelectors": ".returnToTop",
"filters": ["cleanUrls"],
},
{
"location": "https://service1.com/tos-2",
"executeClientScripts": false,
"contentSelectors": "#main",
"insignificantContentSelectors": ".returnToTop",
"filters": ["cleanUrls"],
}
]
},
{
"type": "Privacy Policy",
"sourceDocuments": [
{
"location": "https://service1.com/privacy-policy"
"executeClientScripts": true,
"contentSelectors": "body",
"insignificantContentSelectors": ".returnToTop",
"filters": ["cleanUrls"],
}
]
}
],
"filters": "function cleanUrls(document) {…}"
} |
I specify that the deadline is 24/04 end of day AoE (Anywhere on Earth). |
Thank you very much @Ndpnt for opening this RFC and for this first clear proposal! Feedback on proposition ABase URLI believe we should allow mounting the route under any arbitrary path, since several collections might be made available on a single host. - <collection host>/api/:version
+ <collection host>[/optional/path]/api/:version
|
Proposition BBase URL
Endpoints
|
Parameter | Type | Description |
---|---|---|
serviceId | URL-encoded string | The ID of the service. |
Returns
The full JSON declaration of the service with the given ID.
Returns a HTTP 404
if no matching service is found.
Example
GET /service/service-1
{
"id": "service-1",
"name": "Service/1",
"terms": [
{
"type": "Terms of Service",
"sourceDocuments": [
{
"location": "https://service1.com/tos-1",
"executeClientScripts": false,
"contentSelectors": "#main",
"insignificantContentSelectors": ".returnToTop",
"filters": ["cleanUrls"],
},
{
"location": "https://service1.com/tos-2",
"executeClientScripts": false,
"contentSelectors": "#main",
"insignificantContentSelectors": ".returnToTop",
"filters": ["cleanUrls"],
}
]
},
{
"type": "Privacy Policy",
"sourceDocuments": [
{
"location": "https://service1.com/privacy-policy"
"executeClientScripts": true,
"contentSelectors": "body",
"insignificantContentSelectors": ".returnToTop",
"filters": ["cleanUrls"],
}
]
}
],
"filters": "function cleanUrls(document) {…}"
}
Thank you @MattiSG for your relevant feedback 🙂.
👍
I was thinking of dealing with case and accents. For example to allow easily find if services like
I was thinking of processing them by encoding them.
👍
I'm in favor or of simply returning a list of IDs and names.
By encoding them.
The idea was to return only the information for a specific terms type. I agree with both of you when only the minimal attributes of the terms are returned, but I think it can be valuable if the full terms object is returned. |
In the first stage, I think that the simple proposal B is very good. But I really like the idea of keeping things simple, so I vote for this proposal and we'll see with our collaboration with ToS;DR if we run into problems 🙂 |
Proposal B sounds good to me |
The deadline has expired, thank you all for your participation. |
Context and Problem Statement
Open Terms Archive (OTA) is a decentralised system that tracks collections of services and documents across multiple servers. Each collection has its own public repository where services and documents declarations are stored. The decentralisation of OTA presents a challenge when it comes to easily identifying which services and documents are currently being tracked.
This can complicate collaborative efforts with external applications, such as Terms of Service; Didn't Read (ToS;DR), whose web application will be adapted to obtain data from public OTA datasets instead of the ToS;DR server database. When users of the application attempt to add a new document, the system must be able to inform them whether the document already exists in an OTA collection or not and in which one.
To address this problem, we propose the creation of an API that allows easy access to the metadata of each OTA collection and thus facilitate collaboration with external applications.
This RFC outlines the details of the proposed collection metadata API.
Proposed solution: Collection metadata API
Base URL
<collection host>/api/:version
Endpoints
GET /services
Retrieve all services, with optional query parameters
Query parameters
Returns
A JSON array of all services including all their terms.
An empty array if no services match the provided query parameters.
Example
Another example with query param
GET /services/:serviceId
Retrieve a specific service by ID
Parameters
Returns
A JSON object representing the service with the specified ID, including its terms.
Returns a HTTP
404
if no service is found.Example
GET /services/:serviceId/terms
Retrieve all terms included in the specified service
Parameters
Returns
A JSON array of all terms included in the specified service
Returns a HTTP
404
if no service is found.Example
GET /services/:serviceId/terms/:termsType
Retrieve a specific terms within a specific service by its type
Parameters
Returns
A JSON object representing the terms.
Returns a HTTP
404
if no service or terms is found.Example
Note
The proposed API will initially be exposed on each OTA instance, and a publicly available description file will list the federated collections and access points. A federated API that consolidates access to multiple OTA instances will be developed at a later stage.
The proposed API will voluntary only expose the minimum attributes of
services
andterms
for now, but if necessary we could add more information in the response. Let us know if you have a specific need.Here is an example with the location of each source documents that constitute a terms:
The text was updated successfully, but these errors were encountered: