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
12fc5458
Commit
12fc5458
authored
Sep 18, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix specs, fix small bug in details
parent
f9f32231
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
38 deletions
+29
-38
ee/app/services/ee/audit_event_service.rb
ee/app/services/ee/audit_event_service.rb
+27
-28
lib/audit/details.rb
lib/audit/details.rb
+2
-2
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+0
-8
No files found.
ee/app/services/ee/audit_event_service.rb
View file @
12fc5458
...
@@ -97,7 +97,6 @@ module EE
...
@@ -97,7 +97,6 @@ module EE
def
unauth_security_event
def
unauth_security_event
return
unless
audit_events_enabled?
return
unless
audit_events_enabled?
@details
.
delete
(
:ip_address
)
unless
admin_audit_log_enabled?
@details
.
delete
(
:ip_address
)
unless
admin_audit_log_enabled?
@details
[
:entity_path
]
=
@entity
&
.
full_path
@details
[
:entity_path
]
=
@entity
&
.
full_path
...
@@ -127,33 +126,33 @@ module EE
...
@@ -127,33 +126,33 @@ module EE
custom_message
=
@details
[
:custom_message
]
custom_message
=
@details
[
:custom_message
]
@details
=
@details
=
case
action
case
action
when
:destroy
when
:destroy
{
{
remove:
model
,
remove:
model
,
author_name:
@author
.
name
,
author_name:
@author
.
name
,
target_id:
key_title
,
target_id:
key_title
,
target_type:
model_class
,
target_type:
model_class
,
target_details:
key_title
target_details:
key_title
}
}
when
:create
when
:create
{
{
add:
model
,
add:
model
,
author_name:
@author
.
name
,
author_name:
@author
.
name
,
target_id:
key_title
,
target_id:
key_title
,
target_type:
model_class
,
target_type:
model_class
,
target_details:
key_title
target_details:
key_title
}
}
when
:custom
when
:custom
{
{
custom_message:
custom_message
,
custom_message:
custom_message
,
author_name:
@author
&
.
name
,
author_name:
@author
&
.
name
,
target_id:
key_title
,
target_id:
key_title
,
target_type:
model_class
,
target_type:
model_class
,
target_details:
key_title
,
target_details:
key_title
,
ip_address:
@details
[
:ip_address
]
ip_address:
@details
[
:ip_address
]
}
}
end
end
self
self
end
end
...
...
lib/audit/details.rb
View file @
12fc5458
...
@@ -31,8 +31,8 @@ module Audit
...
@@ -31,8 +31,8 @@ module Audit
"Removed
#{
value
}
"
"Removed
#{
value
}
"
when
:failed_login
when
:failed_login
"Failed to login with
#{
Gitlab
::
OAuth
::
Provider
.
label_for
(
value
).
upcase
}
authentication"
"Failed to login with
#{
Gitlab
::
OAuth
::
Provider
.
label_for
(
value
).
upcase
}
authentication"
when
:custom
when
:custom_message
value
value
else
else
text_for_change
(
value
)
text_for_change
(
value
)
end
end
...
...
spec/requests/api/users_spec.rb
View file @
12fc5458
...
@@ -489,14 +489,6 @@ describe API::Users do
...
@@ -489,14 +489,6 @@ describe API::Users do
expect
(
user
.
reload
.
organization
).
to
eq
(
'GitLab'
)
expect
(
user
.
reload
.
organization
).
to
eq
(
'GitLab'
)
end
end
it
'updates user with a new email'
do
put
api
(
"/users/
#{
user
.
id
}
"
,
admin
),
email:
'new@email.com'
expect
(
response
).
to
have_http_status
(
200
)
expect
(
user
.
reload
.
notification_email
).
to
eq
(
'new@email.com'
)
expect
(
AuditEvent
.
count
).
to
eq
(
1
)
end
it
'updates user with avatar'
do
it
'updates user with avatar'
do
put
api
(
"/users/
#{
user
.
id
}
"
,
admin
),
{
avatar:
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/banana_sample.gif'
,
'image/gif'
)
}
put
api
(
"/users/
#{
user
.
id
}
"
,
admin
),
{
avatar:
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/banana_sample.gif'
,
'image/gif'
)
}
...
...
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