Merge pull request #114 from matrix-org/daniel/3pidtosigned

Update 3pid invite section to reflect signed property
pull/119/head
Daniel Wagner-Hall 9 years ago
commit a9a9067d7e

@ -8,7 +8,15 @@
"token": "pc98", "token": "pc98",
"public_key": "abc123", "public_key": "abc123",
"key_validity_url": "https://magic.forest/verifykey", "key_validity_url": "https://magic.forest/verifykey",
"signature": "q1w2e3", "signed": {
"mxid": "@alice:localhost",
"token": "pc98",
"signatures": {
"magic.forest": {
"ed25519:0": "poi098"
}
}
},
"sender": "@zun:zun.soft" "sender": "@zun:zun.soft"
} }
}, },

@ -38,16 +38,32 @@
"type": "string", "type": "string",
"description": "A base64-encoded ed25519 key with which token must be signed." "description": "A base64-encoded ed25519 key with which token must be signed."
}, },
"signature": { "signed": {
"type": "string", "type": "object",
"description": "A base64-encoded signature of token with public_key." "title": "signed",
"properties": {
"mxid": {
"type": "string",
"description": "The invited matrix user ID. Must be equal to the user_id property of the event."
},
"token": {
"type": "string",
"description": "The token property of the containing third_party_invite object."
},
"signatures": {
"type": "object",
"description": "A single signature from the verifying server, in the format specified by the Signing Events section.",
"title": "Signatures"
}
},
"required": ["mxid", "signatures", "token"]
}, },
"sender": { "sender": {
"type": "string", "type": "string",
"description": "The matrix user ID of the user who send the invite which is being used." "description": "The matrix user ID of the user who send the invite which is being used."
} }
}, },
"required": ["token", "key_validity_url", "public_key", "signature", "sender"] "required": ["token", "key_validity_url", "public_key", "sender", "signed"]
} }
}, },
"required": ["membership"] "required": ["membership"]

@ -36,7 +36,8 @@ A client asks a server to invite a user by their third party identifier.
Server behaviour Server behaviour
---------------- ----------------
All homeservers MUST verify that sig(``token``, ``public_key``) = ``signature``. All homeservers MUST verify the signature in the event's
``content.third_party_invite.signed`` object.
If a client of the current homeserver is joining by an If a client of the current homeserver is joining by an
``m.room.third_party_invite``, that homesever MUST validate that the public ``m.room.third_party_invite``, that homesever MUST validate that the public
@ -93,11 +94,11 @@ For example:
When the third party user validates their identity, they are told about the When the third party user validates their identity, they are told about the
invite, and ask their homeserver, H3, to join the room. invite, and ask their homeserver, H3, to join the room.
H3 validates that sign(``token``, ``public_key``) = ``signature``, and may check H3 validates the signature in the event's
``key_validity_url``. ``content.third_party_invite.signed`` object.
H3 then asks H1 to join it to the room. H1 *must* validate that H3 then asks H1 to join it to the room. H1 *must* validate the ``signed``
sign(``token``, ``public_key``) = ``signature`` *and* check ``key_validity_url``. property *and* check ``key_validity_url``.
Having validated these things, H1 writes the join event to the room, and H3 Having validated these things, H1 writes the join event to the room, and H3
begins participating in the room. H2 *must* accept this event. begins participating in the room. H2 *must* accept this event.

Loading…
Cancel
Save