Skip to content

Commit

Permalink
Fix: fully remove _generate_header call in get_logs
Browse files Browse the repository at this point in the history
Fix

Fix: using real path server instead of fake server for test

Fix: create playload
  • Loading branch information
1yam committed Jun 19, 2024
1 parent 5c61b9b commit a30f690
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/aleph/sdk/client/vmclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ async def _generate_pubkey_signature_header(self) -> str:

def create_payload(self, vm_id: str, operation: str) -> Dict[str, str]:
path = (
f"/logs/{vm_id}"
if operation == "logs"
else f"/control/machine/{vm_id}/{operation}"
f"/control/machine/{vm_id}/{operation}"
)
payload = {
"time": datetime.datetime.utcnow().isoformat() + "Z",
Expand Down Expand Up @@ -134,8 +132,8 @@ async def get_logs(self, vm_id):

payload = self.create_payload(vm_id, "logs")
signed_operation = self.sign_payload(payload, self.ephemeral_key)

ws_url, header = await self._generate_header(vm_id=vm_id, operation="logs")
path = payload["path"]
ws_url = f"{self.node_url}{path}"

async with self.session.ws_connect(ws_url) as ws:
auth_message = {
Expand Down

0 comments on commit a30f690

Please sign in to comment.