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
fd6e03de
Commit
fd6e03de
authored
Oct 24, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor create service
parent
6b87515c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
ee/app/services/ee/applications/create_service.rb
ee/app/services/ee/applications/create_service.rb
+9
-6
ee/app/services/ee/keys/create_service.rb
ee/app/services/ee/keys/create_service.rb
+4
-1
No files found.
ee/app/services/ee/applications/create_service.rb
View file @
fd6e03de
...
...
@@ -3,14 +3,17 @@ module EE
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
audit_event_service
.
for_user
(
application
.
name
).
security_event
end
end
def
audit_event_service
::
AuditEventService
.
new
(
@current_user
,
@current_user
,
action: :custom
,
custom_message:
'OAuth access granted'
,
ip_address:
@ip_address
)
end
end
end
end
ee/app/services/ee/keys/create_service.rb
View file @
fd6e03de
...
...
@@ -8,12 +8,15 @@ module EE
end
def
log_audit_event
(
key
)
audit_event_service
.
for_user
(
key
.
title
).
security_event
end
def
audit_event_service
::
AuditEventService
.
new
(
@user
,
@user
,
action: :custom
,
custom_message:
'Added SSH key'
,
ip_address:
@ip_address
)
.
for_user
(
key
.
title
).
security_event
end
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