Commit fd6e03de authored by James Lopez's avatar James Lopez

refactor create service

parent 6b87515c
...@@ -3,13 +3,16 @@ module EE ...@@ -3,13 +3,16 @@ module EE
module CreateService module CreateService
def execute def execute
super.tap do |application| super.tap do |application|
audit_event_service.for_user(application.name).security_event
end
end
def audit_event_service
::AuditEventService.new(@current_user, ::AuditEventService.new(@current_user,
@current_user, @current_user,
action: :custom, action: :custom,
custom_message: 'OAuth access granted', custom_message: 'OAuth access granted',
ip_address: @ip_address) ip_address: @ip_address)
.for_user(application.name).security_event
end
end end
end end
end end
......
...@@ -8,12 +8,15 @@ module EE ...@@ -8,12 +8,15 @@ module EE
end end
def log_audit_event(key) def log_audit_event(key)
audit_event_service.for_user(key.title).security_event
end
def audit_event_service
::AuditEventService.new(@user, ::AuditEventService.new(@user,
@user, @user,
action: :custom, action: :custom,
custom_message: 'Added SSH key', custom_message: 'Added SSH key',
ip_address: @ip_address) ip_address: @ip_address)
.for_user(key.title).security_event
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment