mirror of https://github.com/jumpserver/jumpserver
feat: 添加命令复核逻辑; 添加命令复核工单; 2
parent
50918a3dd2
commit
5a3c67989b
|
@ -115,8 +115,8 @@ class CommandFilterRule(OrgModelMixin):
|
||||||
'apply_run_asset': session.asset,
|
'apply_run_asset': session.asset,
|
||||||
'apply_run_system_user': session.system_user,
|
'apply_run_system_user': session.system_user,
|
||||||
'apply_run_command': run_command,
|
'apply_run_command': run_command,
|
||||||
'apply_from_session': str(session.id),
|
'apply_from_session_id': str(session.id),
|
||||||
'apply_from_cmd_filter_rule': str(cmd_filter_rule.id),
|
'apply_from_cmd_filter_rule_id': str(cmd_filter_rule.id),
|
||||||
},
|
},
|
||||||
'org_id': org_id,
|
'org_id': org_id,
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,8 @@ class Handler(BaseHandler):
|
||||||
apply_run_asset = self.ticket.meta.get('apply_run_asset')
|
apply_run_asset = self.ticket.meta.get('apply_run_asset')
|
||||||
apply_run_system_user = self.ticket.meta.get('apply_run_system_user')
|
apply_run_system_user = self.ticket.meta.get('apply_run_system_user')
|
||||||
apply_run_command = self.ticket.meta.get('apply_run_command')
|
apply_run_command = self.ticket.meta.get('apply_run_command')
|
||||||
apply_from_session = self.ticket.meta.get('apply_from_session')
|
apply_from_session_id = self.ticket.meta.get('apply_from_session_id')
|
||||||
apply_from_cmd_filter_rule = self.ticket.meta.get('apply_from_cmd_filter_rule')
|
apply_from_cmd_filter_rule_id = self.ticket.meta.get('apply_from_cmd_filter_rule_id')
|
||||||
|
|
||||||
applied_body = '''{}: {},
|
applied_body = '''{}: {},
|
||||||
{}: {},
|
{}: {},
|
||||||
|
@ -24,7 +24,7 @@ class Handler(BaseHandler):
|
||||||
_("Applied run asset"), apply_run_asset,
|
_("Applied run asset"), apply_run_asset,
|
||||||
_("Applied run system user"), apply_run_system_user,
|
_("Applied run system user"), apply_run_system_user,
|
||||||
_("Applied run command"), apply_run_command,
|
_("Applied run command"), apply_run_command,
|
||||||
_("Applied from session"), apply_from_session,
|
_("Applied from session"), apply_from_session_id,
|
||||||
_("Applied from command filter rules"), apply_from_cmd_filter_rule,
|
_("Applied from command filter rules"), apply_from_cmd_filter_rule_id,
|
||||||
)
|
)
|
||||||
return applied_body
|
return applied_body
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
from tickets import const
|
from tickets import const
|
||||||
from .ticket_type import apply_asset, apply_application, login_confirm, login_asset_confirm
|
from .ticket_type import (
|
||||||
|
apply_asset, apply_application, login_confirm, login_asset_confirm, command_confirm
|
||||||
|
)
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'type_serializer_classes_mapping',
|
'type_serializer_classes_mapping',
|
||||||
|
@ -35,5 +37,10 @@ type_serializer_classes_mapping = {
|
||||||
'default': login_asset_confirm.LoginAssetConfirmSerializer,
|
'default': login_asset_confirm.LoginAssetConfirmSerializer,
|
||||||
action_open: login_asset_confirm.ApplySerializer,
|
action_open: login_asset_confirm.ApplySerializer,
|
||||||
action_approve: login_asset_confirm.LoginAssetConfirmSerializer(read_only=True),
|
action_approve: login_asset_confirm.LoginAssetConfirmSerializer(read_only=True),
|
||||||
|
},
|
||||||
|
const.TicketTypeChoices.command_confirm.value: {
|
||||||
|
'default': command_confirm.CommandConfirmSerializer,
|
||||||
|
action_open: command_confirm.ApplySerializer,
|
||||||
|
action_approve: command_confirm.CommandConfirmSerializer(read_only=True)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,8 @@ class ApplySerializer(serializers.Serializer):
|
||||||
required=True, max_length=64, label=_('Run system user')
|
required=True, max_length=64, label=_('Run system user')
|
||||||
)
|
)
|
||||||
apply_run_command = serializers.CharField(required=True, label=_('Run command'))
|
apply_run_command = serializers.CharField(required=True, label=_('Run command'))
|
||||||
apply_from_session = serializers.UUIDField(required=False, label=_('From session'))
|
apply_from_session_id = serializers.UUIDField(required=False, label=_('From session'))
|
||||||
apply_from_cmd_filter_rule = serializers.UUIDField(
|
apply_from_cmd_filter_rule_id = serializers.UUIDField(
|
||||||
required=False, label=_('From cmd filter rule')
|
required=False, label=_('From cmd filter rule')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue