Skip to content

Commit

Permalink
feat(acl): login channel add ssh options
Browse files Browse the repository at this point in the history
  • Loading branch information
pycook committed Feb 21, 2024
1 parent 208d291 commit f12caeb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmdb-api/api/lib/perm/acl/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ def add_login_log(cls, username, is_ok, description, _id=None, logout_at=None):
logout_at=logout_at,
ip=request.headers.get('X-Real-IP') or request.remote_addr,
browser=request.headers.get('User-Agent'),
channel=request.values.get('channel', 'web'),
)

if logout_at is None:
Expand Down
2 changes: 1 addition & 1 deletion cmdb-api/api/models/acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class AuditLoginLog(Model2):
__tablename__ = "acl_audit_login_logs"

username = db.Column(db.String(64), index=True)
channel = db.Column(db.Enum('web', 'api'), default="web")
channel = db.Column(db.Enum('web', 'api', 'ssh'), default="web")
ip = db.Column(db.String(15))
browser = db.Column(db.String(256))
description = db.Column(db.String(128))
Expand Down

0 comments on commit f12caeb

Please sign in to comment.