Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复debug api信息缺失问题 #2447

Merged
merged 1 commit into from
Dec 11, 2023
Merged

Conversation

nick2wang
Copy link
Collaborator

@nick2wang nick2wang commented Dec 8, 2023

sys_config初始获取的是一个空字典,导致config信息为空;敏感信息处理先于goinception与备份库连接导致了连接失败

Get /api/debug
Response:
{
    ......
    "inception": {
        "goinception_info": "获取goInception信息报错:connect() argument 1 must be str, not None",
        "backup_info": "无法连接goInception备份库\ninvalid literal for int() with base 10: ''"
    },
    ......
    "sys_config": {
        "inception_remote_backup_password": "******",
        "ding_app_secret": "******",
        "feishu_app_secret": "******",
        "mail_smtp_password": "******"
    },
    ......
}

Copy link

codecov bot commented Dec 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (79fc811) 76.83% compared to head (0035f28) 76.83%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2447   +/-   ##
=======================================
  Coverage   76.83%   76.83%           
=======================================
  Files         115      115           
  Lines       15884    15886    +2     
=======================================
+ Hits        12204    12206    +2     
  Misses       3680     3680           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@LeoQuote LeoQuote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该可以逐个 get, get_all_configs 消耗太大了

@nick2wang
Copy link
Collaborator Author

应该可以逐个 get, get_all_configs 消耗太大了

原功能就是debug里显示所有配置项,对部分敏感信息进行脱敏;之前有个pr把get_all_configs移出init了所以现在获取不了所有config项
image

@LeoQuote
Copy link
Collaborator

LeoQuote commented Dec 8, 2023

确实, 这边是我写的, 当时是看这个调用方式不合理, 每次初始化都拖库, 消耗太大所以改了, 没注意到这里, 谢谢 pr https://github.com/hhyo/Archery/pull/2333/files#diff-1bacff878451e5aa9c6d164150c7b2daad028d5e7acba90bb720cb73ffdd827b

@nick2wang nick2wang merged commit 22e37cd into hhyo:master Dec 11, 2023
10 checks passed
@nick2wang nick2wang deleted the fix-debug-api branch December 11, 2023 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants