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

增加展示数据库和用户信息 #1398

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

unknowissue
Copy link
Contributor

1、增加未录入的数据库和账号
数据库和数据库账号比较多的情况下,想查看哪些数据库没有录入比较麻烦
2、增加数据库在用状态
对于已录入的数据库,数据库如果不在使用了,可以在页面上修改数据库状态为停用
需要修改表结构

alter table instance_database add in_use varchar(1) COMMENT '在用状态';

3、增加数据库账号密码查看功能
不在维护如“confluence”中记录的密码
这个问题不晓得要不要单独做个权限控制?

@codecov
Copy link

codecov bot commented Feb 24, 2022

Codecov Report

Merging #1398 (6d1bbe9) into master (4d96ac6) will decrease coverage by 0.11%.
The diff coverage is 12.50%.

@@            Coverage Diff             @@
##           master    #1398      +/-   ##
==========================================
- Coverage   76.84%   76.73%   -0.12%     
==========================================
  Files          91       91              
  Lines       14309    14334      +25     
==========================================
+ Hits        10996    10999       +3     
- Misses       3313     3335      +22     
Impacted Files Coverage Δ
sql/urls.py 100.00% <ø> (ø)
sql/instance_account.py 10.44% <9.09%> (+<0.01%) ⬆️
sql/instance_database.py 18.08% <11.11%> (-1.02%) ⬇️
sql/models.py 96.57% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d96ac6...6d1bbe9. Read the comment docs.

@hhyo
Copy link
Owner

hhyo commented Feb 24, 2022

第一个看了半天才明白

  1. 数据库和用户列表增加了未录入的筛选,这个可以
  2. 不用的数据库建议迁移到归档集群后删除,平台标记貌似意义不大?
  3. 前面不在列表加密码是为了安全问题,这种还是建议通过单独接口请求而不是直接全部在列表返回

@@ -19,6 +19,12 @@ def users(request):
instance_id = request.POST.get('instance_id')
saved = True if request.POST.get('saved') == 'true' else False # 平台是否保存

if request.POST.get('saved') == 'True' :
Copy link
Owner

Choose a reason for hiding this comment

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

直接在下面过滤的地方判断 字符串 false、true 和空串会更简洁

Copy link
Contributor Author

Choose a reason for hiding this comment

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

直接在下面过滤的地方判断 字符串 false、true 和空串会更简洁

这个地方我改好了

@unknowissue
Copy link
Contributor Author

  • 不用的数据库建议迁移到归档集群后删除,平台标记貌似意义不大?
    我是觉得这个状态是个中间状态,因为我们的数据库比较多,也并不是都需要归档,rd同学标记为停用之后,过段时间就可以删除了。
  • 前面不在列表加密码是为了安全问题,这种还是建议通过单独接口请求而不是直接全部在列表返回
    那我考虑一下。

@unknowissue
Copy link
Contributor Author

3. 前面不在列表加密码是为了安全问题,这种还是建议通过单独接口请求而不是直接全部在列表返回

请教一下,这个单独的接口是指如
@permission_required('sql.menu_database', raise_exception=True)
def databases(request):
这样的方法么。

@unknowissue
Copy link
Contributor Author

额,有冲突,晚点看看

@unknowissue
Copy link
Contributor Author

@hhyo 这个要不然合并进去?

@hhyo
Copy link
Owner

hhyo commented May 6, 2022

@hhyo 这个要不然合并进去?

敏感的操作,查看密码这种往可以审计日志表记录一条数据

数据库是否使用,这个个人觉得不是很有必要,建议暂时剔除

@unknowissue
Copy link
Contributor Author

敏感的操作,查看密码这种往可以审计日志表记录一条数据

数据库是否使用,这个个人觉得不是很有必要,建议暂时剔除

行,我有空搞下
我去做Oracle了,以后基本不用MySQL了。

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.

None yet

2 participants