oppf.schema.yml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. $schema: 'http://json-schema.org/draft-07/schema#'
  2. description: Threema OnPrem Provision File (OPPF) Format
  3. type: object
  4. properties:
  5. version:
  6. type: string
  7. description: OPPF file format version, currently always `1.0`
  8. examples:
  9. - '1.0'
  10. signatureKey:
  11. type: string
  12. description: A 32 byte, base64 encoded Ed25519 public key
  13. examples:
  14. - ek1qBp4DyRmLL9J5sCmsKSfwbsiGNB4veDAODjkwe/k=
  15. refresh:
  16. type: integer
  17. description: |-
  18. The refresh interval in seconds
  19. Clients should fetch the OPPF after the specified amount of time has
  20. passed.
  21. minimum: 1800
  22. examples:
  23. - 86400
  24. license:
  25. type: object
  26. description: OnPrem license information
  27. properties:
  28. id:
  29. type: string
  30. description: License ID, for internal use only
  31. expires:
  32. type: string
  33. description: |-
  34. An ISO-Date that holds the expiration date of the license
  35. Clients should not accept the OPPF after this date.
  36. examples:
  37. - '2024-03-15'
  38. count:
  39. type: integer
  40. description: |-
  41. The number of licenses in the package
  42. Servers should not accept more user accounts (active Threema IDs) than
  43. this.
  44. examples:
  45. - 1000
  46. required:
  47. - id
  48. - expires
  49. - count
  50. domains:
  51. type: object
  52. description: |-
  53. Configure domains accessed by the Threema clients.
  54. If this key is missing, then no constraints are applied.
  55. properties:
  56. rules:
  57. type: array
  58. items:
  59. type: object
  60. description: |-
  61. Domain configuration rule to be applied to a domain (and potentially
  62. subdomains).
  63. Note: Generally, rules are applied on a first-match basis. However, the
  64. exact order of which SPKI will be applied is not well-defined and
  65. depends on the underlying platform.
  66. When processing this entry:
  67. 1. If `matchMode` is unknown, log a warning and abort these steps.
  68. 2. If `spkis` is present, run the associated steps for each entry.
  69. properties:
  70. fqdn:
  71. type: string
  72. description: An FQDN
  73. matchMode:
  74. type: string
  75. description: How to match domains and apply the respective rules.
  76. anyOf:
  77. - title: Exact
  78. description: The rule shall only be applied to the exact FQDN.
  79. const: exact
  80. - title: Include subdomains
  81. description:
  82. The rule shall be applied to all subdomains recursively.
  83. const: include-subdomains
  84. - {}
  85. spkis:
  86. type: array
  87. items:
  88. type: object
  89. description: |-
  90. SPKI for certificate pinning to be applied to one or more domains.
  91. When processing this entry:
  92. 1. Let `fqdn` and `matchMode` be the associated domain's FQDN and
  93. match mode.
  94. 2. If `algorithm` is unknown, log a warning and abort these steps.
  95. 3. Pin the SPKI to `fqdn` according to `matchMode`. All subsequent
  96. TLS-based communication must match the SPKI or be rejected.
  97. properties:
  98. value:
  99. type: string
  100. description: The base64 encoded public key hash
  101. examples:
  102. - 'DTJU4+0HObYPrx9lF4Kz8hhjcJL3WBL4k829L++UlSk='
  103. algorithm:
  104. type: string
  105. description: The SPKI hashing algorithm.
  106. anyOf:
  107. - const: sha256
  108. - {}
  109. required:
  110. - value
  111. - algorithm
  112. required:
  113. - fqdn
  114. - matchMode
  115. examples:
  116. - fqdn: threemaonprem.initrode.com
  117. matchMode: include-subdomains
  118. spkis:
  119. - value: 'DTJU4+0HObYPrx9lF4Kz8hhjcJL3WBL4k829L++UlSk='
  120. algorithm: sha256
  121. - value: 'C19RmQgZXzwovKRRJ2st7bsokiRchKcYjBo3m63fvn8='
  122. algorithm: sha256
  123. - fqdn: another-host.initrode.com
  124. matchMode: exact
  125. spkis:
  126. - value: 'XIglSWPJ6aJ7LeIz6KsOrr0fNgNZ0PzGgDCDEZq5/U4='
  127. algorithm: sha256
  128. required:
  129. - rules
  130. chat:
  131. type: object
  132. description: Configuration for the chat server
  133. properties:
  134. hostname:
  135. type: string
  136. description: Chat server hostname
  137. examples:
  138. - threemaonprem.initrode.com
  139. publicKey:
  140. type: string
  141. description:
  142. The 32-byte, base64 encoded permanent public key of the chat server
  143. examples:
  144. - r9utIHN9ngo21q9OlZcotsQu1f2HwAW2Wi+u6Psp4Wc=
  145. ports:
  146. type: array
  147. items:
  148. type: integer
  149. minimum: 1
  150. maximum: 65535
  151. description: Array of chat server ports
  152. examples:
  153. - [5222]
  154. required:
  155. - hostname
  156. - publicKey
  157. - ports
  158. directory:
  159. type: object
  160. description: Configuration for the directory server
  161. properties:
  162. url:
  163. type: string
  164. description: |-
  165. Base URL of the directory server (protocol: `https://`, ending with
  166. `/`, no parameters, no fragment)
  167. pattern: '^https://.*/$'
  168. required:
  169. - url
  170. blob:
  171. type: object
  172. description: Configuration for the blob server
  173. properties:
  174. uploadUrl:
  175. type: string
  176. description: |-
  177. URL to the blob upload endpoint (protocol: `https://`, no parameters,
  178. no fragment)
  179. pattern: '^https://'
  180. examples:
  181. - https://blob-threemaonprem.initrode.com/blob/upload
  182. downloadUrl:
  183. type: string
  184. description: |-
  185. URL to the blob download endpoint (protocol: `https://`, no
  186. parameters, no fragment)
  187. Valid placeholders:
  188. - `{blobId}`: The blob ID (32 hex nibbles)
  189. - `{blobIdPrefix}`: The first two hex nibbles of the blob ID
  190. pattern: '^https://'
  191. examples:
  192. - https://blob-{blobIdPrefix}-threemaonprem.initrode.com/blob/{blobId}
  193. doneUrl:
  194. type: string
  195. description: |-
  196. URL to the blob done endpoint (protocol: `https://`, no parameters, no
  197. fragment)
  198. Valid placeholders:
  199. - `{blobId}`: The blob ID (32 hex nibbles)
  200. - `{blobIdPrefix}`: The first two hex nibbles of the blob ID
  201. pattern: '^https://'
  202. examples:
  203. - https://blob-{blobIdPrefix}-threemaonprem.initrode.com/blob/{blobId}/done
  204. required:
  205. - uploadUrl
  206. - downloadUrl
  207. - doneUrl
  208. work:
  209. type: object
  210. description: Configuration for Threema Work
  211. properties:
  212. url:
  213. type: string
  214. description: |-
  215. Base URL of the Threema Work server (protocol: `https://`, ending with
  216. `/`, no parameters, no fragment)
  217. pattern: '^https://.*/$'
  218. examples:
  219. - https://threemaonprem.initrode.com/work/
  220. required:
  221. - url
  222. avatar:
  223. description:
  224. Configuration for the avatar server, used for Threema Gateway IDs
  225. type: object
  226. properties:
  227. url:
  228. type: string
  229. description: |-
  230. Base URL of the avatar server (protocol: `https://`, ending with `/`,
  231. no parameters, no fragment)
  232. pattern: '^https://.*/$'
  233. examples:
  234. - https://threemaonprem.initrode.com/avatar/
  235. required:
  236. - url
  237. safe:
  238. type: object
  239. description: Configuration for Threema Safe
  240. properties:
  241. url:
  242. type: string
  243. description: |-
  244. Base URL of the Threema Safe server (protocol: `https://`, ending with
  245. `/`, no parameters, no fragment)
  246. pattern: '^https://.*/$'
  247. examples:
  248. - https://threemaonprem.initrode.com/safe/
  249. required:
  250. - url
  251. web:
  252. type: object
  253. description: Configuration for Threema Web
  254. properties:
  255. url:
  256. type: string
  257. description: |-
  258. URL to the Threema Web endpoint (protocol: `https://`, may have
  259. parameters, no fragment)
  260. Not required for app functionality, but is displayed in the app
  261. (help/info text) so user knows where to go.
  262. pattern: '^https://'
  263. overrideSaltyRtcHost:
  264. type: string
  265. description: Override the SaltyRTC host specified in the QR code
  266. overrideSaltyRtcPort:
  267. type: integer
  268. minimum: 1
  269. maximum: 65535
  270. description: Override the SaltyRTC port specified in the QR code
  271. required:
  272. - url
  273. rendezvous:
  274. type: object
  275. description: |-
  276. Configuration for the rendezvous server
  277. Required for multi-device support.
  278. properties:
  279. url:
  280. type: string
  281. description: |-
  282. Base URL of the rendezvous server (protocol: `wss://`, ending with
  283. `/`, no parameters, no fragment)
  284. Valid placeholders:
  285. - `{rendezvousPathPrefix4}`: The first hex nibble (4 bits) of the
  286. rendezvous path
  287. - `{rendezvousPathPrefix8}`: The first two hex nibbles (8 bits) of the
  288. rendezvous path
  289. pattern: '^wss://.*/$'
  290. examples:
  291. - wss://threemaonprem.initrode.com/rendezvous/
  292. - wss://rendezvous-{rendezvousPathPrefix4}.initrode.com/{rendezvousPathPrefix8}/
  293. required:
  294. - url
  295. mediator:
  296. type: object
  297. description: |-
  298. Configuration for the mediator server and blob mirror
  299. Required for multi-device support.
  300. properties:
  301. url:
  302. type: string
  303. description: |-
  304. Base URL of the rendezvous server (protocol: `wss://`, ending with
  305. `/`, no parameters, no fragment)
  306. Valid placeholders:
  307. - `{deviceGroupIdPrefix4}`: The first hex nibble (4 bits) of the
  308. device group ID
  309. - `{deviceGroupIdPrefix8}`: The first two hex nibbles (8 bits) of the
  310. device group ID
  311. pattern: '^wss://.*/$'
  312. examples:
  313. - wss://threemaonprem.initrode.com/mediator/
  314. - wss://mediator-{deviceGroupIdPrefix4}.initrode.com/{deviceGroupIdPrefix8}/
  315. blob:
  316. type: object
  317. description: Configuration for the blob mirror
  318. properties:
  319. uploadUrl:
  320. type: string
  321. description: |-
  322. URL to the blob upload endpoint (protocol: `https://`, no
  323. parameters, no fragment)
  324. pattern: '^https://'
  325. examples:
  326. - https://blob-mirror-threemaonprem.initrode.com/blob/upload
  327. downloadUrl:
  328. type: string
  329. description: |-
  330. URL to the blob download endpoint (protocol: `https://`, no
  331. parameters, no fragment)
  332. Valid placeholders:
  333. - `{blobId}`: The blob ID (32 hex nibbles)
  334. - `{blobIdPrefix}`: The first two hex nibbles of the blob ID
  335. pattern: '^https://'
  336. examples:
  337. - https://blob-mirror-{blobIdPrefix}-threemaonprem.initrode.com/blob/{blobId}
  338. doneUrl:
  339. type: string
  340. description: |-
  341. URL to the blob done endpoint (protocol: `https://`, no
  342. parameters, no fragment)
  343. Valid placeholders:
  344. - `{blobId}`: The blob ID (32 hex nibbles)
  345. - `{blobIdPrefix}`: The first two hex nibbles of the blob ID
  346. pattern: '^https://'
  347. examples:
  348. - https://blob-mirror-{blobIdPrefix}-threemaonprem.initrode.com/blob/{blobId}/done
  349. required:
  350. - uploadUrl
  351. - downloadUrl
  352. - doneUrl
  353. required:
  354. - url
  355. - blob
  356. updates:
  357. type: object
  358. description: URLs for update checks
  359. properties:
  360. desktop:
  361. type: object
  362. properties:
  363. autoUpdate:
  364. type: boolean
  365. description:
  366. Whether or not the Threema Servers should be called to check if an
  367. update is available
  368. required:
  369. - version
  370. - signatureKey
  371. - refresh
  372. - license
  373. - chat
  374. - directory
  375. - blob
  376. - work
  377. - avatar
  378. - safe
  379. - web