Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6f43a409
Commit
6f43a409
authored
Oct 02, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update applications service with EE audit
parent
5457f295
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
app/services/applications/create_service.rb
app/services/applications/create_service.rb
+2
-2
ee/app/services/ee/applications/create_service.rb
ee/app/services/ee/applications/create_service.rb
+16
-0
spec/services/applications/create_service_spec.rb
spec/services/applications/create_service_spec.rb
+6
-0
No files found.
app/services/applications/create_service.rb
View file @
6f43a409
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
...
...
ee/app/services/ee/applications/create_service.rb
0 → 100644
View file @
6f43a409
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
spec/services/applications/create_service_spec.rb
View file @
6f43a409
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment