Commit b52a9e19 authored by Julien Muchembled's avatar Julien Muchembled

registry: fix error handling in case of handshake with an unknown client

Or with a client whose certificate expired long time ago.
parent 387441b4
Pipeline #39425 passed with stage
in 0 seconds
...@@ -366,9 +366,10 @@ class RegistryServer: ...@@ -366,9 +366,10 @@ class RegistryServer:
cert = self.db.execute("SELECT cert FROM cert" cert = self.db.execute("SELECT cert FROM cert"
" WHERE prefix=? AND cert IS NOT NULL", " WHERE prefix=? AND cert IS NOT NULL",
(client_prefix,)).fetchone() (client_prefix,)).fetchone()
assert cert, (f"No cert result for prefix '{client_prefix}';" if cert:
f" this should not happen, DB is inconsistent") return cert[0]
return cert[0] logging.info("No certificate found for prefix %s.", client_prefix)
raise HTTPError(http.client.NOT_FOUND)
@rpc_private @rpc_private
def isToken(self, token: str): def isToken(self, token: str):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment