Remove private_token from API user entity
This commit is contained in:
parent
a72d687931
commit
fbdf057898
|
@ -410,8 +410,7 @@ GET /user
|
||||||
"can_create_group": true,
|
"can_create_group": true,
|
||||||
"can_create_project": true,
|
"can_create_project": true,
|
||||||
"two_factor_enabled": true,
|
"two_factor_enabled": true,
|
||||||
"external": false,
|
"external": false
|
||||||
"private_token": "dd34asd13as"
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -57,10 +57,6 @@ module API
|
||||||
expose :admin?, as: :is_admin
|
expose :admin?, as: :is_admin
|
||||||
end
|
end
|
||||||
|
|
||||||
class UserWithPrivateDetails < UserWithAdmin
|
|
||||||
expose :private_token
|
|
||||||
end
|
|
||||||
|
|
||||||
class Email < Grape::Entity
|
class Email < Grape::Entity
|
||||||
expose :id, :email
|
expose :id, :email
|
||||||
end
|
end
|
||||||
|
|
|
@ -507,9 +507,7 @@ module API
|
||||||
end
|
end
|
||||||
get do
|
get do
|
||||||
entity =
|
entity =
|
||||||
if sudo?
|
if current_user.admin?
|
||||||
Entities::UserWithPrivateDetails
|
|
||||||
elsif current_user.admin?
|
|
||||||
Entities::UserWithAdmin
|
Entities::UserWithAdmin
|
||||||
else
|
else
|
||||||
Entities::UserPublic
|
Entities::UserPublic
|
||||||
|
|
|
@ -27,11 +27,9 @@
|
||||||
"can_create_group",
|
"can_create_group",
|
||||||
"can_create_project",
|
"can_create_project",
|
||||||
"two_factor_enabled",
|
"two_factor_enabled",
|
||||||
"external",
|
"external"
|
||||||
"private_token"
|
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"$ref": "full.json",
|
"$ref": "full.json"
|
||||||
"private_token": { "type": "string" }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,5 @@
|
||||||
"provider":null,
|
"provider":null,
|
||||||
"is_admin":false,
|
"is_admin":false,
|
||||||
"can_create_group":false,
|
"can_create_group":false,
|
||||||
"can_create_project":false,
|
"can_create_project":false
|
||||||
"private_token":"Wvjy2Krpb7y8xi93owUz",
|
|
||||||
"access_token":"Wvjy2Krpb7y8xi93owUz"
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,5 @@
|
||||||
"provider":null,
|
"provider":null,
|
||||||
"is_admin":false,
|
"is_admin":false,
|
||||||
"can_create_group":false,
|
"can_create_group":false,
|
||||||
"can_create_project":false,
|
"can_create_project":false
|
||||||
"private_token":"Wvjy2Krpb7y8xi93owUz",
|
|
||||||
"access_token":"Wvjy2Krpb7y8xi93owUz"
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue