App manifest
Every field of awhere-app.json, the file in which an App says what it is, what is required and what each field does.
An App manifest is the file in which an App says what it is: its name, who publishes it, where it is served, how it signs in and what it asks for. The file is called awhere-app.json. An App is installed from its manifest.
Installing an App does two things: it writes one row for the App, which keeps the manifest as it was installed, and it makes the App's OAuth client. Uninstalling takes both back, and installing again restores the same client with the same secret.
An App serves its own manifest at awhere-app.json under its address. When an administrator previews an install, the platform asks the App for that file and warns if it does not answer, if it is not readable, or if its id or version differs from the manifest being installed.
Only official manifests that are built into the platform's image can be installed today. A manifest with "channel": "community" is valid, but the platform refuses to install it until a site can show a person what an App asks for and enforce it.
An example
This is the manifest of Map Studio, as the App publishes it. It uses the required fields and a few optional ones.
{
"manifestVersion": 1,
"id": "map-studio",
"name": "Map Studio",
"shortName": "Map",
"description": "Web maps with layers, styles and measurement.",
"locales": {
"th": { "description": "สร้างแผนที่เว็บที่มีชั้นข้อมูล รูปแบบการแสดงผล และเครื่องมือวัด" }
},
"publisher": {
"name": "MAPBOSS Co., Ltd.",
"url": "https://mapboss.co.th"
},
"channel": "official",
"version": "1.0.0",
"categories": ["maps"],
"path": "/map-studio/",
"oauth": {
"scopes": ["*"]
}
}Required fields
A manifest without every field below is refused, and the reason names the field.
| Field | Value | Meaning |
|---|---|---|
manifestVersion | The number 1 | The version of this file format. No other value is accepted. |
id | Lowercase letters, digits and dashes, up to 64 characters | The App id, the one name the App has. It is also the key of the install and the OAuth client the App signs in as. A community manifest may also use dots between its parts, for example acme.reports. |
name | Text, up to 60 characters | The name the Marketplace shows. |
version | 1.2.3, optionally followed by - or + and a suffix, for example 1.2.3-beta.1 | The version of the App. |
channel | official or community | Who made the App: official Apps are made by MAPBOSS, community Apps by anyone else. |
publisher.name | Text | Who publishes the App. See publisher. |
path or url | See Where the App is served | At least one of the two. |
oauth.scopes | A list of text, which may be empty | What the App asks for. See oauth. |
Optional fields
| Field | Value | Meaning |
|---|---|---|
shortName | Text, up to 12 characters | What the Launcher shows under the icon. When it is missing, the full name is used. |
description | Text | A short description of the App, shown in the Marketplace. |
icon | An https address, a relative path, or an SVG data URI that starts with data:image/svg+xml;base64, | The App's picture in the Marketplace. A relative path is resolved against the App's address when that address has a host, and anything else falls back to the platform logo. |
categories | A list of text | Groups for the Marketplace's filter. admin, files, data, forms, maps and apps have their own words there; any other text is shown as written, with a capital first letter. |
screenshots | A list of { "src": …, "caption": … } | src is an https address or a relative path, caption is optional text. |
homepage | An https address | The App's web page. |
support | An https address | Where to ask for help. |
locales | An object keyed by language, see locales | Text in other languages. |
requires.platform | Text | The platform the App needs. |
A key that is not in these two tables is dropped, and image is reserved and ignored. path and url are in the next section, and the keys inside publisher and oauth are in their own sections.
Where the App is served
path, url or both say where the App's address is. At least one is required.
| Field | Value | Meaning |
|---|---|---|
path | Starts and ends with /, with no spaces, ?, #, . or .. parts, for example /map-studio/ | The App is on the platform's own host. Its address is the platform's address (PLATFORM_URL) followed by this path. |
url | An https address | The App is somewhere else. When both are present, url wins. |
An administrator can give a different address for one install, either an http or https address or a path that ends in /. That address is kept in the install and the manifest stays as it was.
publisher
| Field | Required | Value |
|---|---|---|
publisher.name | Yes | Text |
publisher.url | No | An https address |
publisher.email | No | An email address |
oauth
The App signs in through the platform as an OAuth client whose id is the App id. The platform makes that client from the manifest, so a manifest cannot choose a different one: oauth.clientId is not allowed.
| Field | Required | Value | Meaning |
|---|---|---|---|
oauth.scopes | Yes | A list of text | What the App asks for. The Marketplace lists it under "What this app can do": * reads as acting as the signed-in person with that person's permissions, a scope it knows is described in words, and any other is shown as Access named "…". An empty list reads as asking for no access. |
oauth.redirectPaths | No | A list of relative paths | Where the App's sign-in comes back to, under the App's address. When it is missing, the path is oauth/awhere-callback. Log Monitoring sets it to oauth-callback. |
oauth.redirectUris | No | A list of https addresses | Full addresses for a sign-in that comes back outside the App's address. |
oauth.origins | No | A list of https origins, such as https://reports.example.com, without a path | Kept on the App's OAuth client as its origins. |
redirectPaths become full addresses only when the App's address has a host. When the address is just a path, only redirectUris count. Official Apps ask for ["*"], and the platform does not enforce scopes for an official client.
locales
locales is an object whose keys are languages, such as th. Each value may contain only name, shortName and description, all as text, with shortName up to 12 characters. When the Marketplace is shown in a language that has an entry, those three texts replace the ones above. This is how every official App gives its Thai description.
"locales": {
"th": { "description": "ตั้งค่าแพลตฟอร์ม รวมถึงบทบาท ผู้ใช้ กลุ่ม OAuth client และคีย์ API" }
}What the platform does with each field today
- The Launcher shows
shortName(orname) and the App's picture. The picture is an uploaded logo of the App's client when there is one, and otherwiseicon.svgunder the App's address. - The Marketplace shows
name,description,locales,publisher.name,version,channel,categories,iconandoauth.scopes, and filters bycategories. screenshots,homepage,supportandrequires.platformare checked and kept with the install, but no screen shows them and nothing comparesrequires.platformwith the platform yet.
Official Apps
The nine official Apps each ship with a manifest that is built into the platform's image. Every official manifest is checked before it is built in, and one is refused whose manifestVersion is not 1, whose id is repeated or not made of lowercase letters, digits and dashes, whose channel is not official, whose path does not start and end with /, whose shortName is over 12 characters, or whose categories has anything other than maps, data, forms, apps, files or admin.
An official manifest does not carry its own icon. The platform takes the App's icon.svg and keeps it with the built-in manifest as an SVG data URI, and an icon written in the manifest is ignored.