Commit 6f43a409 authored by James Lopez's avatar James Lopez

update applications service with EE audit

parent 5457f295
module Applications
class CreateService < ::Emails::BaseService
#prepend ::EE::Applications::CreateService
class CreateService
prepend ::EE::Applications::CreateService
def initialize(current_user, params)
@current_user = current_user
......
module EE
module Applications
module CreateService
def execute
super.tap do |application|
::AuditEventService.new(@current_user,
@current_user,
action: :custom,
custom_message: 'OAuth access granted',
ip_address: @ip_address)
.for_user(application.name).security_event
end
end
end
end
end
......@@ -9,4 +9,10 @@ describe ::Applications::CreateService do
it 'creates an application' do
expect { subject.execute }.to change { Doorkeeper::Application.count }.by(1)
end
it 'creates an audit log' do
stub_licensed_features(extended_audit_events: true)
expect { subject.execute }.to change { SecurityEvent.count }.by(1)
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