baptistegh commented on code in PR #75938:
URL: https://github.com/apache/airflow/pull/75938#discussion_r4440949571


##########
airflow-ctl/src/airflowctl/ctl/commands/auth_command.py:
##########
@@ -42,6 +73,31 @@
     password = args.password
     token = args.api_token or os.environ.get("AIRFLOW_CLI_TOKEN")
 
+    if args.sso:
+        if args.api_token or username or password:
+            rich.print("[red]--sso is not compatible with --api-token, 
--username or --password.")
+            sys.exit(1)
+        try:
+            api_token = _get_token_with_browser(args, api_client)
+        except Exception as e:
+            rich.print(f"[red]Login failed: {escape(str(e))}")
+            sys.exit(1)
+        Credentials(
+            api_url=args.api_url,
+            api_token=api_token,
+            api_environment=args.env,
+            client_kind=ClientKind.AUTH,
+        ).save(args.skip_keyring)
+        if args.skip_keyring:
+            # Nothing stores the token, so this is the only way to use the 
login that just happened.
+            print(api_token)

Review Comment:
   @vincbeck, what should we do about this? In my opinion, this is a false 
positive.
   The flagged line prints the CLI token to stdout on purpose.



-- 
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]

Reply via email to