fix(legacy): keep static shell available during migration
This commit is contained in:
@@ -281,6 +281,22 @@ class PublicKnowledgePermissionTests(unittest.TestCase):
|
||||
self.handler("/api/heaven/sector-phases/%E6%B2%B9%E6%B0%94", "send_json")
|
||||
)
|
||||
|
||||
def test_static_shell_bypasses_the_api_access_registry(self):
|
||||
handler = RequestHandler.__new__(RequestHandler)
|
||||
handler.path = "/"
|
||||
handler.require_auth = lambda: (_ for _ in ()).throw(
|
||||
AssertionError("static request required authentication")
|
||||
)
|
||||
handler.require_access = lambda *_: (_ for _ in ()).throw(
|
||||
AssertionError("static request entered the API registry")
|
||||
)
|
||||
served: list[str] = []
|
||||
handler.serve_static = served.append
|
||||
|
||||
RequestHandler.do_GET(handler)
|
||||
|
||||
self.assertEqual(served, ["/"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user