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
efe58ab2
Commit
efe58ab2
authored
Oct 12, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove private_token from API user entity
parent
f10f00ad
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
20 deletions
+7
-20
doc/api/users.md
doc/api/users.md
+1
-2
lib/api/entities.rb
lib/api/entities.rb
+0
-4
lib/api/users.rb
lib/api/users.rb
+1
-3
spec/fixtures/api/schemas/public_api/v4/user/login.json
spec/fixtures/api/schemas/public_api/v4/user/login.json
+2
-4
spec/support/gitlab_stubs/session.json
spec/support/gitlab_stubs/session.json
+1
-3
spec/support/gitlab_stubs/user.json
spec/support/gitlab_stubs/user.json
+2
-4
No files found.
doc/api/users.md
View file @
efe58ab2
...
...
@@ -415,8 +415,7 @@ GET /user
"can_create_group"
:
true
,
"can_create_project"
:
true
,
"two_factor_enabled"
:
true
,
"external"
:
false
,
"private_token"
:
"dd34asd13as"
"external"
:
false
}
```
...
...
lib/api/entities.rb
View file @
efe58ab2
...
...
@@ -60,10 +60,6 @@ module API
expose
:admin?
,
as: :is_admin
end
class
UserWithPrivateDetails
<
UserWithAdmin
expose
:private_token
end
class
Email
<
Grape
::
Entity
expose
:id
,
:email
end
...
...
lib/api/users.rb
View file @
efe58ab2
...
...
@@ -513,9 +513,7 @@ module API
end
get
do
entity
=
if
sudo?
Entities
::
UserWithPrivateDetails
elsif
current_user
.
admin?
if
current_user
.
admin?
Entities
::
UserWithAdmin
else
Entities
::
UserPublic
...
...
spec/fixtures/api/schemas/public_api/v4/user/login.json
View file @
efe58ab2
...
...
@@ -27,11 +27,9 @@
"can_create_group"
,
"can_create_project"
,
"two_factor_enabled"
,
"external"
,
"private_token"
"external"
],
"properties"
:
{
"$ref"
:
"full.json"
,
"private_token"
:
{
"type"
:
"string"
}
"$ref"
:
"full.json"
}
}
spec/support/gitlab_stubs/session.json
View file @
efe58ab2
...
...
@@ -14,7 +14,5 @@
"provider"
:
null
,
"is_admin"
:
false
,
"can_create_group"
:
false
,
"can_create_project"
:
false
,
"private_token"
:
"Wvjy2Krpb7y8xi93owUz"
,
"access_token"
:
"Wvjy2Krpb7y8xi93owUz"
"can_create_project"
:
false
}
spec/support/gitlab_stubs/user.json
View file @
efe58ab2
...
...
@@ -14,7 +14,5 @@
"provider"
:
null
,
"is_admin"
:
false
,
"can_create_group"
:
false
,
"can_create_project"
:
false
,
"private_token"
:
"Wvjy2Krpb7y8xi93owUz"
,
"access_token"
:
"Wvjy2Krpb7y8xi93owUz"
"can_create_project"
:
false
}
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