mirror of
https://github.com/azaion/loader.git
synced 2026-04-22 08:36:31 +00:00
[AZ-182][AZ-184][AZ-187] Batch 1
Made-with: Cursor
This commit is contained in:
@@ -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 []
|
||||
|
||||
Reference in New Issue
Block a user