ramitkataria commented on code in PR #49804:
URL: https://github.com/apache/airflow/pull/49804#discussion_r2067044313
##########
devel-common/src/tests_common/test_utils/api_client_helpers.py:
##########
@@ -49,3 +56,24 @@ def generate_access_token(username: str, password: str,
host: str) -> str:
assert access_token, f"Failed to get JWT token from redirect url {url}
with status code {login_response}"
return access_token
+
+
+def make_authenticated_rest_api_request(
+ path: str,
+ method: str,
+ body: dict | None = None,
+ api_username: str = "admin",
+ api_password: str = "admin",
+ api_server_url: str | None = None,
+):
+ if not api_server_url:
+ api_server_url = conf.get("api", "base_url",
fallback="http://localhost:8080")
+ api_server_url = api_server_url.rstrip("/")
+ token = generate_access_token(api_username, api_password, api_server_url)
Review Comment:
I tried this but it still needs a valid token. I think it just makes all
users admin but you still have to login and use the token
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]