Skip to content

Commit

Permalink
refactor token
Browse files Browse the repository at this point in the history
  • Loading branch information
nikellepetrillo committed Dec 12, 2024
1 parent e3a7e7c commit 30fe656
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/firecloud_api/firecloud_api2.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def submit_job(self, submission_data_file):
return None


def upload_test_inputs(self, pipeline_name, test_inputs, branch_name):
def upload_test_inputs(self, pipeline_name, test_inputs, branch_name, credentials: credentials):
"""
Uploads test inputs to the workspace via Firecloud API.
Expand All @@ -131,10 +131,11 @@ def upload_test_inputs(self, pipeline_name, test_inputs, branch_name):
# properly encode the space in WARP Tests as %20 using from urllib.parse import quote
url = f"{self.base_url}/workspaces/{self.namespace}/{quote(self.workspace_name)}/method_configs/{self.namespace}/{pipeline_name}"

print(url)
token = get_user_token(credentials)
headers = build_auth_headers(token)

# get the current method configuration
response = requests.get(url, headers=self.headers)
response = requests.get(url, headers=headers)
config = response.json()
print(f"Current method configuration: {json.dumps(config, indent=2)}")
# update the config with the new inputs
Expand Down

0 comments on commit 30fe656

Please sign in to comment.