|
|
|
# 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.
|
|
|
|
|
|
|
|
swagger: '2.0'
|
|
|
|
info:
|
|
|
|
title: "Matrix Federation Key Exchange API"
|
|
|
|
version: "1.0.0"
|
|
|
|
host: localhost:8448
|
|
|
|
schemes:
|
|
|
|
- https
|
|
|
|
basePath: /_matrix/key/v2
|
|
|
|
produces:
|
|
|
|
- application/json
|
|
|
|
paths:
|
|
|
|
"/query/{serverName}/{keyId}":
|
|
|
|
get:
|
|
|
|
summary: Retrieve a server key.
|
|
|
|
description: Retrieve a server key.
|
|
|
|
operationId: perspectivesKeyQuery
|
|
|
|
parameters:
|
|
|
|
- in: path
|
|
|
|
name: serverName
|
|
|
|
type: string
|
|
|
|
description: Server name.
|
|
|
|
required: true
|
|
|
|
x-example: matrix.org
|
|
|
|
- in: path
|
|
|
|
name: keyId
|
|
|
|
type: string
|
|
|
|
description: Key ID.
|
|
|
|
required: true
|
|
|
|
x-example: TODO # No examples in spec so far
|
|
|
|
- in: query
|
|
|
|
name: minimum_valid_until_ts
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
description: Minimum Valid Until Milliseconds.
|
|
|
|
required: true # TODO: Verify
|
|
|
|
x-example: 1234567890
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: The keys for the server
|
|
|
|
schema:
|
|
|
|
$ref: "definitions/keys_query_response.yaml"
|
|
|
|
"/query":
|
|
|
|
post:
|
|
|
|
summary: Retrieve a server key
|
|
|
|
description: Retrieve a server key.
|
|
|
|
operationId: bulkPerspectivesKeyQuery
|
|
|
|
parameters:
|
|
|
|
- in: body
|
|
|
|
name: body
|
|
|
|
schema:
|
|
|
|
type: object
|
|
|
|
# TODO: Improve example
|
|
|
|
example: {
|
|
|
|
"server_keys": {
|
|
|
|
"{server_name}": {
|
|
|
|
"{key_id}": {
|
|
|
|
"minimum_valid_until_ts": 1234567890
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
properties:
|
|
|
|
server_keys:
|
|
|
|
type: object
|
|
|
|
description: The query criteria.
|
|
|
|
additionalProperties:
|
|
|
|
type: object
|
|
|
|
name: ServerName
|
|
|
|
description: The server names to query.
|
|
|
|
additionalProperties:
|
|
|
|
type: object
|
|
|
|
title: Query Criteria
|
|
|
|
description: The server keys to query.
|
|
|
|
properties:
|
|
|
|
minimum_valid_until_ts:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
description: Minimum Valid Until MS.
|
|
|
|
example: 1234567890
|
|
|
|
required: ['server_keys']
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: The keys for the server.
|
|
|
|
schema:
|
|
|
|
$ref: "definitions/keys_query_response.yaml"
|