Updating documentation
This commit is contained in:
parent
f4ba415202
commit
a67e5ef83b
|
@ -615,6 +615,11 @@ paths:
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- Challenge
|
- Challenge
|
||||||
|
summary: Submit proof of a challenge completion
|
||||||
|
description: |
|
||||||
|
Some server endpoints (the "send message" endpoint, for example) may return a 428 response indicating the client must complete a challenge before continuing.
|
||||||
|
Clients may use this endpoint to provide proof of a completed challenge. If successful, the client may then
|
||||||
|
continue their original operation.
|
||||||
operationId: handleChallengeResponse
|
operationId: handleChallengeResponse
|
||||||
parameters:
|
parameters:
|
||||||
- name: X-Forwarded-For
|
- name: X-Forwarded-For
|
||||||
|
@ -629,24 +634,80 @@ paths:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/AnswerChallengeRequest'
|
oneOf:
|
||||||
|
- $ref: '#/components/schemas/AnswerPushChallengeRequest'
|
||||||
|
- $ref: '#/components/schemas/AnswerRecaptchaChallengeRequest'
|
||||||
responses:
|
responses:
|
||||||
default:
|
"200":
|
||||||
description: default response
|
description: Indicates the challenge proof was accepted
|
||||||
content:
|
"413":
|
||||||
application/json: {}
|
description: Too many attempts
|
||||||
|
headers:
|
||||||
|
Retry-After:
|
||||||
|
description: "If present, an positive integer indicating the number\
|
||||||
|
\ of seconds before a subsequent attempt could succeed"
|
||||||
|
style: simple
|
||||||
|
"429":
|
||||||
|
description: Too many attempts
|
||||||
|
headers:
|
||||||
|
Retry-After:
|
||||||
|
description: "If present, an positive integer indicating the number\
|
||||||
|
\ of seconds before a subsequent attempt could succeed"
|
||||||
|
style: simple
|
||||||
security:
|
security:
|
||||||
- authenticatedAccount: []
|
- authenticatedAccount: []
|
||||||
/v1/challenge/push:
|
/v1/challenge/push:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- Challenge
|
- Challenge
|
||||||
|
summary: Request a push challenge
|
||||||
|
description: |
|
||||||
|
Clients may proactively request a push challenge by making an empty POST request. Push challenges will only be
|
||||||
|
sent to the requesting account’s main device. When the push is received it may be provided as proof of completed
|
||||||
|
challenge to /v1/challenge.
|
||||||
|
APNs challenge payloads will be formatted as follows:
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"aps": {
|
||||||
|
"sound": "default",
|
||||||
|
"alert": {
|
||||||
|
"loc-key": "APN_Message"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rateLimitChallenge": "{CHALLENGE_TOKEN}"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
FCM challenge payloads will be formatted as follows:
|
||||||
|
```
|
||||||
|
{"rateLimitChallenge": "{CHALLENGE_TOKEN}"}
|
||||||
|
```
|
||||||
|
|
||||||
|
Clients may retry the PUT in the event of an HTTP/5xx response (except HTTP/508) from the server, but must
|
||||||
|
implement an exponential back-off system and limit the total number of retries.
|
||||||
operationId: requestPushChallenge
|
operationId: requestPushChallenge
|
||||||
responses:
|
responses:
|
||||||
default:
|
"200":
|
||||||
description: default response
|
description: |
|
||||||
content:
|
Indicates a payload to the account's primary device has been attempted. When clients receive a challenge push
|
||||||
'*/*': {}
|
notification, they may issue a PUT request to /v1/challenge.
|
||||||
|
"404":
|
||||||
|
description: |
|
||||||
|
The server does not have a push notification token for the authenticated account’s main device; clients may add a push
|
||||||
|
token and try again
|
||||||
|
"413":
|
||||||
|
description: Too many attempts
|
||||||
|
headers:
|
||||||
|
Retry-After:
|
||||||
|
description: "If present, an positive integer indicating the number\
|
||||||
|
\ of seconds before a subsequent attempt could succeed"
|
||||||
|
style: simple
|
||||||
|
"429":
|
||||||
|
description: Too many attempts
|
||||||
|
headers:
|
||||||
|
Retry-After:
|
||||||
|
description: "If present, an positive integer indicating the number\
|
||||||
|
\ of seconds before a subsequent attempt could succeed"
|
||||||
|
style: simple
|
||||||
security:
|
security:
|
||||||
- authenticatedAccount: []
|
- authenticatedAccount: []
|
||||||
/v1/devices/provisioning/code:
|
/v1/devices/provisioning/code:
|
||||||
|
@ -2618,15 +2679,6 @@ components:
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
format: byte
|
format: byte
|
||||||
AnswerChallengeRequest:
|
|
||||||
required:
|
|
||||||
- type
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
discriminator:
|
|
||||||
propertyName: type
|
|
||||||
AnswerPushChallengeRequest:
|
AnswerPushChallengeRequest:
|
||||||
required:
|
required:
|
||||||
- challenge
|
- challenge
|
||||||
|
@ -2637,6 +2689,7 @@ components:
|
||||||
properties:
|
properties:
|
||||||
challenge:
|
challenge:
|
||||||
type: string
|
type: string
|
||||||
|
description: A token provided to the client via a push payload
|
||||||
AnswerRecaptchaChallengeRequest:
|
AnswerRecaptchaChallengeRequest:
|
||||||
required:
|
required:
|
||||||
- captcha
|
- captcha
|
||||||
|
@ -2648,8 +2701,20 @@ components:
|
||||||
properties:
|
properties:
|
||||||
token:
|
token:
|
||||||
type: string
|
type: string
|
||||||
|
description: The value of the token field from the server's 428 response
|
||||||
captcha:
|
captcha:
|
||||||
type: string
|
type: string
|
||||||
|
description: A string representing a solved captcha
|
||||||
|
example: signal-hcaptcha.30b01b46-d8c9-4c30-bbd7-9719acfe0c10.challenge.abcdefg1345
|
||||||
|
AnswerChallengeRequest:
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
discriminator:
|
||||||
|
propertyName: type
|
||||||
VerificationCode:
|
VerificationCode:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|
Loading…
Reference in New Issue