v2-ify the v2 api

Note that ping and pubkey doesn't require auth - see MSC2140 for more information.
This commit is contained in:
Travis Ralston 2019-08-28 14:17:51 -06:00
parent 5b53b3d0b8
commit a47c5aeb42
7 changed files with 62 additions and 30 deletions

View file

@ -15,22 +15,26 @@
swagger: '2.0' swagger: '2.0'
info: info:
title: "Matrix Identity Service Establishing Associations API" title: "Matrix Identity Service Establishing Associations API"
version: "1.0.0" version: "2.0.0"
host: localhost:8090 host: localhost:8090
schemes: schemes:
- https - https
basePath: /_matrix/identity/api/v1 basePath: /_matrix/identity/v2
consumes: consumes:
- application/json - application/json
produces: produces:
- application/json - application/json
securityDefinitions:
$ref: definitions/security.yaml
paths: paths:
"/3pid/getValidated3pid": "/3pid/getValidated3pid":
get: get:
summary: Check whether ownership of a 3pid was validated. summary: Check whether ownership of a 3pid was validated.
description: |- description: |-
Determines if a given 3pid has been validated by a user. Determines if a given 3pid has been validated by a user.
operationId: getValidated3pid operationId: getValidated3pidV2
security:
- accessToken: []
parameters: parameters:
- in: query - in: query
type: string type: string
@ -104,7 +108,9 @@ paths:
specification, the parameters may also be specified as specification, the parameters may also be specified as
``application/x-form-www-urlencoded`` data. However, this usage is ``application/x-form-www-urlencoded`` data. However, this usage is
deprecated. deprecated.
operationId: bind operationId: bindV2
security:
- accessToken: []
parameters: parameters:
- in: body - in: body
name: body name: body
@ -221,7 +227,9 @@ paths:
If this endpoint returns a JSON Matrix error, that error should be passed If this endpoint returns a JSON Matrix error, that error should be passed
through to the client requesting an unbind through a homeserver, if the through to the client requesting an unbind through a homeserver, if the
homeserver is acting on behalf of a client. homeserver is acting on behalf of a client.
operationId: unbind operationId: unbindV2
security:
- accessToken: []
parameters: parameters:
- in: body - in: body
name: body name: body

View file

@ -15,15 +15,17 @@
swagger: '2.0' swagger: '2.0'
info: info:
title: "Matrix Identity Service Email Associations API" title: "Matrix Identity Service Email Associations API"
version: "1.0.0" version: "2.0.0"
host: localhost:8090 host: localhost:8090
schemes: schemes:
- https - https
basePath: /_matrix/identity/api/v1 basePath: /_matrix/identity/v2
consumes: consumes:
- application/json - application/json
produces: produces:
- application/json - application/json
securityDefinitions:
$ref: definitions/security.yaml
paths: paths:
"/validate/email/requestToken": "/validate/email/requestToken":
post: post:
@ -46,7 +48,9 @@ paths:
specification, the parameters may also be specified as specification, the parameters may also be specified as
``application/x-form-www-urlencoded`` data. However, this usage is ``application/x-form-www-urlencoded`` data. However, this usage is
deprecated. deprecated.
operationId: emailRequestToken operationId: emailRequestTokenV2
security:
- accessToken: []
parameters: parameters:
- in: body - in: body
name: body name: body
@ -92,7 +96,9 @@ paths:
specification, the parameters may also be specified as specification, the parameters may also be specified as
``application/x-form-www-urlencoded`` data. However, this usage is ``application/x-form-www-urlencoded`` data. However, this usage is
deprecated. deprecated.
operationId: emailSubmitTokenPost operationId: emailSubmitTokenPostV2
security:
- accessToken: []
parameters: parameters:
- in: body - in: body
name: body name: body
@ -142,7 +148,9 @@ paths:
Note that, in contrast with the POST version, this endpoint will be Note that, in contrast with the POST version, this endpoint will be
used by end-users, and so the response should be human-readable. used by end-users, and so the response should be human-readable.
operationId: emailSubmitTokenGet operationId: emailSubmitTokenGetV2
security:
- accessToken: []
parameters: parameters:
- in: query - in: query
type: string type: string

View file

@ -15,15 +15,17 @@
swagger: '2.0' swagger: '2.0'
info: info:
title: "Matrix Identity Service Ephemeral Invitation Signing API" title: "Matrix Identity Service Ephemeral Invitation Signing API"
version: "1.0.0" version: "2.0.0"
host: localhost:8090 host: localhost:8090
schemes: schemes:
- https - https
basePath: /_matrix/identity/api/v1 basePath: /_matrix/identity/v2
consumes: consumes:
- application/json - application/json
produces: produces:
- application/json - application/json
securityDefinitions:
$ref: definitions/security.yaml
paths: paths:
"/sign-ed25519": "/sign-ed25519":
post: post:
@ -33,7 +35,9 @@ paths:
The identity server will look up ``token`` which was stored in a call The identity server will look up ``token`` which was stored in a call
to ``store-invite``, and fetch the sender of the invite. to ``store-invite``, and fetch the sender of the invite.
operationId: blindlySignStuff operationId: blindlySignStuffV2
security:
- accessToken: []
parameters: parameters:
- in: body - in: body
name: body name: body

View file

@ -15,15 +15,17 @@
swagger: '2.0' swagger: '2.0'
info: info:
title: "Matrix Identity Service Phone Number Associations API" title: "Matrix Identity Service Phone Number Associations API"
version: "1.0.0" version: "2.0.0"
host: localhost:8090 host: localhost:8090
schemes: schemes:
- https - https
basePath: /_matrix/identity/api/v1 basePath: /_matrix/identity/v2
consumes: consumes:
- application/json - application/json
produces: produces:
- application/json - application/json
securityDefinitions:
$ref: definitions/security.yaml
paths: paths:
"/validate/msisdn/requestToken": "/validate/msisdn/requestToken":
post: post:
@ -46,7 +48,9 @@ paths:
specification, the parameters may also be specified as specification, the parameters may also be specified as
``application/x-form-www-urlencoded`` data. However, this usage is ``application/x-form-www-urlencoded`` data. However, this usage is
deprecated. deprecated.
operationId: msisdnRequestToken operationId: msisdnRequestTokenV2
security:
- accessToken: []
parameters: parameters:
- in: body - in: body
name: body name: body
@ -94,7 +98,9 @@ paths:
specification, the parameters may also be specified as specification, the parameters may also be specified as
``application/x-form-www-urlencoded`` data. However, this usage is ``application/x-form-www-urlencoded`` data. However, this usage is
deprecated. deprecated.
operationId: msisdnSubmitTokenPost operationId: msisdnSubmitTokenPostV2
security:
- accessToken: []
parameters: parameters:
- in: body - in: body
name: body name: body
@ -144,7 +150,9 @@ paths:
Note that, in contrast with the POST version, this endpoint will be Note that, in contrast with the POST version, this endpoint will be
used by end-users, and so the response should be human-readable. used by end-users, and so the response should be human-readable.
operationId: msisdnSubmitTokenGet operationId: msisdnSubmitTokenGetV2
security:
- accessToken: []
parameters: parameters:
- in: query - in: query
type: string type: string

View file

@ -17,7 +17,7 @@
swagger: "2.0" swagger: "2.0"
info: info:
title: "Matrix Identity Service Ping API" title: "Matrix Identity Service Ping API"
version: "1.0.0" version: "2.0.0"
host: localhost:8090 host: localhost:8090
schemes: schemes:
- https - https
@ -25,7 +25,7 @@ basePath: /_matrix/identity
produces: produces:
- application/json - application/json
paths: paths:
"/api/v1": "/v2":
get: get:
summary: Checks that an identity server is available at this API endpoint. summary: Checks that an identity server is available at this API endpoint.
description: |- description: |-
@ -36,7 +36,7 @@ paths:
This is primarly used for auto-discovery and health check purposes This is primarly used for auto-discovery and health check purposes
by entities acting as a client for the identity server. by entities acting as a client for the identity server.
operationId: ping operationId: pingV2
responses: responses:
200: 200:
description: An identity server is ready to serve requests. description: An identity server is ready to serve requests.

View file

@ -15,11 +15,11 @@
swagger: '2.0' swagger: '2.0'
info: info:
title: "Matrix Identity Service Public Key API" title: "Matrix Identity Service Public Key API"
version: "1.0.0" version: "2.0.0"
host: localhost:8090 host: localhost:8090
schemes: schemes:
- https - https
basePath: /_matrix/identity/api/v1 basePath: /_matrix/identity/v2
consumes: consumes:
- application/json - application/json
produces: produces:
@ -30,7 +30,7 @@ paths:
summary: Get a public key. summary: Get a public key.
description: |- description: |-
Get the public key for the passed key ID. Get the public key for the passed key ID.
operationId: getPubKey operationId: getPubKeyV2
parameters: parameters:
- in: path - in: path
type: string type: string
@ -72,7 +72,7 @@ paths:
description: |- description: |-
Check whether a long-term public key is valid. The response should always Check whether a long-term public key is valid. The response should always
be the same, provided the key exists. be the same, provided the key exists.
operationId: isPubKeyValid operationId: isPubKeyValidV2
parameters: parameters:
- in: query - in: query
type: string type: string
@ -101,7 +101,7 @@ paths:
summary: Check whether a short-term public key is valid. summary: Check whether a short-term public key is valid.
description: |- description: |-
Check whether a short-term public key is valid. Check whether a short-term public key is valid.
operationId: isEphemeralPubKeyValid operationId: isEphemeralPubKeyValidV2
parameters: parameters:
- in: query - in: query
type: string type: string

View file

@ -15,15 +15,17 @@
swagger: '2.0' swagger: '2.0'
info: info:
title: "Matrix Identity Service Store Invitations API" title: "Matrix Identity Service Store Invitations API"
version: "1.0.0" version: "2.0.0"
host: localhost:8090 host: localhost:8090
schemes: schemes:
- https - https
basePath: /_matrix/identity/api/v1 basePath: /_matrix/identity/v2
consumes: consumes:
- application/json - application/json
produces: produces:
- application/json - application/json
securityDefinitions:
$ref: definitions/security.yaml
paths: paths:
"/store-invite": "/store-invite":
post: post:
@ -48,14 +50,16 @@ paths:
``address`` parameter, notifying them of the invitation. ``address`` parameter, notifying them of the invitation.
Also, the generated ephemeral public key will be listed as valid on Also, the generated ephemeral public key will be listed as valid on
requests to ``/_matrix/identity/api/v1/pubkey/ephemeral/isvalid``. requests to ``/_matrix/identity/v2/pubkey/ephemeral/isvalid``.
Currently, invites may only be issued for 3pids of the ``email`` medium. Currently, invites may only be issued for 3pids of the ``email`` medium.
Optional fields in the request should be populated to the best of the Optional fields in the request should be populated to the best of the
server's ability. Identity servers may use these variables when notifying server's ability. Identity servers may use these variables when notifying
the ``address`` of the pending invite for display purposes. the ``address`` of the pending invite for display purposes.
operationId: storeInvite operationId: storeInviteV2
security:
- accessToken: []
parameters: parameters:
- in: body - in: body
name: body name: body