Skip to content

Commit

Permalink
[pre-commit.ci] Apply automatic pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Feb 12, 2025
1 parent 03a970e commit 7fbbdf9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/get_conda_store_token.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import re
import os
import re

import requests


def get_conda_store_session_token(username, password, nebari_hostname):
"""Log into conda-store using the test account and get session"""
session = requests.Session()
r = session.get(
f"https://{nebari_hostname}/conda-store/login/?next=", verify=False
)
r = session.get(f"https://{nebari_hostname}/conda-store/login/?next=", verify=False)
auth_url = re.search('action="([^"]+)"', r.content.decode("utf8")).group(1)
response = session.post(
auth_url.replace("&", "&"),
Expand All @@ -32,9 +31,10 @@ def get_conda_store_session_token(username, password, nebari_hostname):

return token


if __name__ == "__main__":
username = os.environ.get("KEYCLOAK_USERNAME")
password = os.environ.get("KEYCLOAK_PASSWORD")
url = os.environ.get("BASE_URL")
token = get_conda_store_session_token(username, password, url)
print(token)
print(token)

0 comments on commit 7fbbdf9

Please sign in to comment.