BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
fbdf0578
Commit
fbdf0578
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
a72d6879
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
21 deletions
+7
-21
users.md
doc/api/users.md
+1
-2
entities.rb
lib/api/entities.rb
+0
-4
users.rb
lib/api/users.rb
+1
-3
login.json
spec/fixtures/api/schemas/public_api/v4/user/login.json
+2
-4
session.json
spec/support/gitlab_stubs/session.json
+1
-3
user.json
spec/support/gitlab_stubs/user.json
+2
-5
No files found.
doc/api/users.md
View file @
fbdf0578
...
...
@@ -410,8 +410,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 @
fbdf0578
...
...
@@ -57,10 +57,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 @
fbdf0578
...
...
@@ -507,9 +507,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 @
fbdf0578
...
...
@@ -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 @
fbdf0578
...
...
@@ -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 @
fbdf0578
...
...
@@ -14,7 +14,5 @@
"provider"
:
null
,
"is_admin"
:
false
,
"can_create_group"
:
false
,
"can_create_project"
:
false
,
"private_token"
:
"Wvjy2Krpb7y8xi93owUz"
,
"access_token"
:
"Wvjy2Krpb7y8xi93owUz"
}
\ No newline at end of file
"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