fix(auth): 移除日志中AccessKeySecret明文打印#14
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes sensitive credential logging (AccessKeyId and AccessKeySecret) from the Aliyun SMS client configuration and replaces it with a success log. The reviewer suggested moving the success log statement to after the client is successfully instantiated to prevent misleading logs in case of an instantiation failure.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| log.info("阿里云短信客户端初始化成功"); | ||
|
|
||
| return new com.aliyun.dypnsapi20170525.Client(config); |
There was a problem hiding this comment.
当前日志“阿里云短信客户端初始化成功”在创建 Client 实例之前打印。由于 new com.aliyun.dypnsapi20170525.Client(config) 可能会抛出异常并被 catch 块捕获,如果在实例化时发生异常,日志中仍会先输出“初始化成功”的信息,随后又输出错误日志,这会产生误导。建议在成功创建 Client 实例后再打印成功日志。
| log.info("阿里云短信客户端初始化成功"); | |
| return new com.aliyun.dypnsapi20170525.Client(config); | |
| com.aliyun.dypnsapi20170525.Client client = new com.aliyun.dypnsapi20170525.Client(config); | |
| log.info("阿里云短信客户端初始化成功"); | |
| return client; |
移除AliyunSmsClientConfig中AccessKeyId和AccessKeySecret的明文日志打印,改为不泄露密钥的初始化确认日志