Merge pull request #2055 from matrix-org/travis/1.0/registration-clarification

Clarify guest accounts and `auth` usage on /register
This commit is contained in:
Travis Ralston 2019-06-07 10:05:56 -06:00 committed by GitHub
commit 906d3cd447
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 9 deletions

View file

@ -29,7 +29,8 @@ paths:
post: post:
summary: Register for an account on this homeserver. summary: Register for an account on this homeserver.
description: |- description: |-
This API endpoint uses the `User-Interactive Authentication API`_. This API endpoint uses the `User-Interactive Authentication API`_, except in
the cases where a guest account is being registered.
Register for an account on this homeserver. Register for an account on this homeserver.
@ -59,6 +60,11 @@ paths:
supplied by the client or generated by the server. The server may supplied by the client or generated by the server. The server may
invalidate any access token previously associated with that device. See invalidate any access token previously associated with that device. See
`Relationship between access tokens and devices`_. `Relationship between access tokens and devices`_.
When registering a guest account, all parameters in the request body
with the exception of ``initial_device_display_name`` MUST BE ignored
by the server. The server MUST pick a ``device_id`` for the account
regardless of input.
operationId: register operationId: register
parameters: parameters:
- in: query - in: query
@ -72,7 +78,7 @@ paths:
enum: enum:
- guest - guest
- user - user
description: The kind of account to register. Defaults to `user`. description: The kind of account to register. Defaults to ``user``.
- in: body - in: body
name: body name: body
schema: schema:
@ -80,13 +86,11 @@ paths:
properties: properties:
auth: auth:
description: |- description: |-
Additional authentication information for the Additional authentication information for the
user-interactive authentication API. Note that this user-interactive authentication API. Note that this
information is *not* used to define how the registered user information is *not* used to define how the registered user
should be authenticated, but is instead used to should be authenticated, but is instead used to
authenticate the ``register`` call itself. It should be authenticate the ``register`` call itself.
left empty, or omitted, unless an earlier call returned an
response with status code 401.
"$ref": "definitions/auth_data.yaml" "$ref": "definitions/auth_data.yaml"
bind_email: bind_email:
type: boolean type: boolean
@ -200,6 +204,18 @@ paths:
The homeserver requires additional authentication information. The homeserver requires additional authentication information.
schema: schema:
"$ref": "definitions/auth_response.yaml" "$ref": "definitions/auth_response.yaml"
403:
description: |-
The homeserver does not permit registering the account. This response
can be used to identify that a particular ``kind`` of account is not
allowed, or that registration is generally not supported by the homeserver.
examples:
application/json: {
"errcode": "M_FORBIDDEN",
"error": "Registration is disabled"
}
schema:
"$ref": "definitions/errors/error.yaml"
429: 429:
description: This request was rate-limited. description: This request was rate-limited.
schema: schema:

View file

@ -0,0 +1 @@
Clarify which parameters apply in what scenarios on ``/register``.