Clean up and flesh out all three editions of the /requestToken API
Fixes https://github.com/matrix-org/matrix-doc/issues/1634 Addresses some of https://github.com/matrix-org/matrix-doc/issues/1396pull/977/head
parent
2f55dd66da
commit
dfaed5b525
@ -0,0 +1,47 @@
|
|||||||
|
# Copyright 2018 New Vector Ltd
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
type: object
|
||||||
|
example: {
|
||||||
|
"client_secret": "monkeys_are_GREAT",
|
||||||
|
"email": "foo@example.com",
|
||||||
|
"send_attempt": 1
|
||||||
|
}
|
||||||
|
properties:
|
||||||
|
client_secret:
|
||||||
|
type: string
|
||||||
|
description: A unique string used to identify the validation attempt.
|
||||||
|
example: "monkeys_are_GREAT"
|
||||||
|
email:
|
||||||
|
type: string
|
||||||
|
description: The email address to validate.
|
||||||
|
example: "alice@example.org"
|
||||||
|
send_attempt:
|
||||||
|
type: integer
|
||||||
|
description: |-
|
||||||
|
Optional. If specified, the server will only send an email if
|
||||||
|
the ``send_attempt`` is a number greater than the most recent
|
||||||
|
one which it has seen (or if it has never seen one), scoped
|
||||||
|
to that ``email`` + ``client_secret`` pair. This is to avoid
|
||||||
|
repeatedly sending the same email in the case of request
|
||||||
|
retries between the POSTing user and the identity
|
||||||
|
service. The client should increment this value if they
|
||||||
|
desire a new email (e.g. a reminder) to be sent.
|
||||||
|
example: 1
|
||||||
|
next_link:
|
||||||
|
type: string
|
||||||
|
description: |-
|
||||||
|
Optional. When the validation is completed, the identity
|
||||||
|
service will redirect the user to this URL.
|
||||||
|
example: "https://example.org/congratulations.html"
|
||||||
|
required: ["client_secret", "email", "send_attempt"]
|
@ -0,0 +1,54 @@
|
|||||||
|
# Copyright 2018 New Vector Ltd
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
type: object
|
||||||
|
example: {
|
||||||
|
"client_secret": "monkeys_are_GREAT",
|
||||||
|
"country": "GB",
|
||||||
|
"phone_number": "07700900001",
|
||||||
|
"send_attempt": 1
|
||||||
|
}
|
||||||
|
properties:
|
||||||
|
client_secret:
|
||||||
|
type: string
|
||||||
|
description: A unique string used to identify the validation attempt.
|
||||||
|
example: "monkeys_are_GREAT"
|
||||||
|
country:
|
||||||
|
type: string
|
||||||
|
description: |-
|
||||||
|
The two-letter uppercase ISO country code that the number in
|
||||||
|
``phone_number`` should be parsed as if it were dialled from.
|
||||||
|
example: "GB"
|
||||||
|
phone_number:
|
||||||
|
type: string
|
||||||
|
description: The phone number to validate.
|
||||||
|
example: "07700900001"
|
||||||
|
send_attempt:
|
||||||
|
type: integer
|
||||||
|
description: |-
|
||||||
|
Optional. If specified, the server will only send an SMS if
|
||||||
|
the ``send_attempt`` is a number greater than the most recent
|
||||||
|
one which it has seen (or if it has never seen one), scoped
|
||||||
|
to that ``country`` + ``phone_number`` + ``client_secret``
|
||||||
|
triple. This is to avoid repeatedly sending the same SMS in
|
||||||
|
the case of request retries between the POSTing user and the
|
||||||
|
identity service. The client should increment this value if
|
||||||
|
they desire a new SMS (e.g. a reminder) to be sent.
|
||||||
|
example: 1
|
||||||
|
next_link:
|
||||||
|
type: string
|
||||||
|
description: |-
|
||||||
|
Optional. When the validation is completed, the identity
|
||||||
|
service will redirect the user to this URL.
|
||||||
|
example: "https://example.org/congratulations.html"
|
||||||
|
required: ["client_secret", "country", "phone_number", "send_attempt"]
|
@ -0,0 +1,20 @@
|
|||||||
|
# Copyright 2018 New Vector Ltd
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
sid:
|
||||||
|
type: string
|
||||||
|
description: The session ID.
|
||||||
|
example: "123abc"
|
||||||
|
required: ['sid']
|
Loading…
Reference in New Issue