1# Copyright 2015, 2016 OpenMarket Ltd 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15from typing import TYPE_CHECKING 16 17from twisted.web.resource import Resource 18 19from .local_key_resource import LocalKey 20from .remote_key_resource import RemoteKey 21 22if TYPE_CHECKING: 23 from synapse.server import HomeServer 24 25 26class KeyApiV2Resource(Resource): 27 def __init__(self, hs: "HomeServer"): 28 Resource.__init__(self) 29 self.putChild(b"server", LocalKey(hs)) 30 self.putChild(b"query", RemoteKey(hs)) 31