venkateshwaracholan commented on code in PR #4770:
URL: https://github.com/apache/polaris/pull/4770#discussion_r3416104063


##########
client/python/apache_polaris/cli/profile_config.py:
##########
@@ -0,0 +1,80 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+import json
+import os
+import stat
+import tempfile
+from typing import Any, Dict
+
+from apache_polaris.cli.constants import CONFIG_DIR, CONFIG_FILE
+
+CONFIG_FILE_MODE = 0o600
+
+
+def mask_client_secret(client_secret: str | None) -> str | None:
+    if client_secret is None:
+        return None
+    if len(client_secret) <= 4:
+        return "*" * len(client_secret)
+    return "*" * (len(client_secret) - 4) + client_secret[-4:]

Review Comment:
   I originally exposed the last few characters as a usability cue so users 
could distinguish between stored secrets without revealing the full value.
   
   I've updated the implementation to fully mask the client secret in displayed 
output instead.
   



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