[AZ-182][AZ-184][AZ-187] Batch 1

Made-with: Cursor
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-04-15 07:23:47 +03:00
parent 765d3d32c1
commit d244799f02
22 changed files with 1622 additions and 16 deletions
+22
View File
@@ -35,6 +35,12 @@ class LoginBody(BaseModel):
password: str
class GetUpdateBody(BaseModel):
dev_stage: str = ""
architecture: str = ""
current_versions: dict[str, str] = {}
def _calc_hash(key: str) -> str:
h = hashlib.sha384(key.encode("utf-8")).digest()
return base64.b64encode(h).decode("utf-8")
@@ -117,3 +123,19 @@ def binary_split_key_fragment():
async def resources_check(request: Request):
await request.body()
return Response(status_code=200)
@app.post("/get-update")
def get_update(body: GetUpdateBody):
ann = body.current_versions.get("annotations", "")
if not ann or ann < "2026-04-13":
return [
{
"resourceName": "annotations",
"version": "2026-04-13",
"cdnUrl": f"{CDN_HOST}/fleet/annotations",
"sha256": "a" * 64,
"encryptionKey": "mock-fleet-encryption-key",
}
]
return []