Skip to content
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
14 changes: 5 additions & 9 deletions scripts/download_splunk_mcp_server_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,20 @@ def run() -> None:
client = httpx.Client(follow_redirects=True)
response = client.post(
f"{SPLUNKBASE_URL}/api/account:login",
data={
"username": username,
"password": password,
},
headers={"Content-Type": "application/x-www-form-urlencoded"},
data={"username": username, "password": password},
)

response.raise_for_status()

root = ET.fromstring(response.text)

token = next(elem.text for elem in root if elem.tag.endswith("id"))
response_xml = ET.fromstring(response.text)
token = next(elem.text for elem in response_xml if elem.tag.endswith("id"))
if token is None:
raise AssertionError("token not found in the response")

response = client.get(
f"{SPLUNKBASE_URL}/api/v1/app/{SPLUNK_MCP_APP_ID}/?include=release",
headers={"Authorization": f"Bearer {token}"},
# ? Might not be needed here after all?
# headers={"Authorization": f"Bearer {token}"},
)
response.raise_for_status()

Expand Down
Loading