url-payloads.proto 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // # URL Payloads
  2. //
  3. // These payloads are part of universal URLs (e.g. group invite links). After
  4. // serializing the protobuf messages, they are encoded in URL safe Base64
  5. // (according to RFC 3548).
  6. //
  7. // Note: Be aware that there is no canonical representation of a URL if it
  8. // contains a protobuf message.
  9. syntax = "proto3";
  10. package url;
  11. option java_package = "ch.threema.protobuf.url_payloads";
  12. option java_multiple_files = true;
  13. import "common.proto";
  14. import "md-d2d-rendezvous.proto";
  15. // Group invitation containing information to request joining a group.
  16. //
  17. // Generated by the administrator of a group. The resulting URL can be shared
  18. // freely with anyone. The invitation can be invalidated by the administrator
  19. // at any point.
  20. //
  21. // The URL is formed using the `threema.group` domain in the following way:
  22. //
  23. // ```text
  24. // https://threema.group/join#<url-safe-base64(GroupInvite)>
  25. // ```
  26. //
  27. // Example:
  28. //
  29. // ```text
  30. // https://threema.group/join#CghFQ0hPRUNITxIQaNbxfd3QsToW0c_668fXUhobQSBuaWNlIGxpdHRsZSBUaHJlZW1hIGdyb3Vw
  31. // ```
  32. message GroupInvite {
  33. // The admin's Threema ID (8 bytes ASCII)
  34. string admin_identity = 1;
  35. // A random 16-byte token
  36. bytes token = 2;
  37. // The invite confirmation mode
  38. enum ConfirmationMode {
  39. // The admin will auto-accept join requests.
  40. AUTOMATIC = 0;
  41. // The admin needs to manually confirm each join request. The user
  42. // interface should ask the user to pass a message along (e.g. for
  43. // identification purposes).
  44. MANUAL = 1;
  45. }
  46. ConfirmationMode confirmation_mode = 3;
  47. // The group name
  48. string group_name = 4;
  49. }
  50. // Offer or request to join the (multi-)device group.
  51. //
  52. // When generated by an existing or a new device, the URL is formed using the
  53. // `threema` scheme in the following way:
  54. //
  55. // ```text
  56. // threema://device-group/join#<url-safe-base64(DeviceGroupJoinRequestOrOffer)>
  57. // ```
  58. //
  59. // When receiving this message:
  60. //
  61. // 1. If `version` or `variant` is not supported, abort these steps.
  62. // 2. Follow the description of `RendezvousInit` to continue.
  63. message DeviceGroupJoinRequestOrOffer {
  64. // Device join protocol version used by the device.
  65. enum Version {
  66. // Initial version.
  67. V1_0 = 0;
  68. }
  69. Version version = 1;
  70. // D2D protocol version (`d2d.ProtocolVersion`) used by the device
  71. //
  72. // If `0`, assume V0.1 (`0x0001`).
  73. uint32 d2d_protocol_version = 4;
  74. // Variant (_offer_ or _request_)
  75. message Variant {
  76. oneof type {
  77. // A device intends to join the (multi-)device group. `data` is to be
  78. // handled according to the _Device Join Protocol_ with `ND` being the
  79. // initiator.
  80. common.Unit request_to_join = 1;
  81. // A device intends to let another device join the (multi-)device group.
  82. // `data` is to be handled according to the _Device Join Protocol_ with
  83. // `ED` being the initiator.
  84. common.Unit offer_to_join = 2;
  85. }
  86. }
  87. Variant variant = 2;
  88. // Data necessary to initialise a 1:1 connection between two devices.
  89. rendezvous.RendezvousInit rendezvous_init = 3;
  90. }