Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

tickets/DM-36744B: require admin token in status route #4

Merged
merged 1 commit into from
Mar 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/rsp_restspawner/spawner.py
Original file line number Diff line number Diff line change
@@ -56,8 +56,13 @@ async def start(self) -> str:
)
if r.status_code == 409 or r.status_code == 303:
# For the Conflict we need to check the status ourself.
r = await client.get(f"{self.ctrl_url}/labs/{uname}")
print(f"***R -> {r}***")
# This route requires an admin token
r = await client.get(
f"{self.ctrl_url}/labs/{uname}",
headers=await self._configure_client_headers(
token=self.admin_token
),
)
if r.status_code == 200:
obj = r.json()
if "internal_url" in obj: