Commit 11b57d979c42008cabaa49a60b52c1523133b5a8
1 parent
a29c883b
Exists in
master
and in
4 other branches
Reduce amount of user info provided with internal api
Showing
2 changed files
with
5 additions
and
1 deletions
Show diff stats
lib/api/entities.rb
| @@ -5,6 +5,10 @@ module Gitlab | @@ -5,6 +5,10 @@ module Gitlab | ||
| 5 | :dark_scheme, :theme_id, :state, :created_at, :extern_uid, :provider | 5 | :dark_scheme, :theme_id, :state, :created_at, :extern_uid, :provider |
| 6 | end | 6 | end |
| 7 | 7 | ||
| 8 | + class UserSafe < Grape::Entity | ||
| 9 | + expose :name | ||
| 10 | + end | ||
| 11 | + | ||
| 8 | class UserBasic < Grape::Entity | 12 | class UserBasic < Grape::Entity |
| 9 | expose :id, :username, :email, :name, :state, :created_at | 13 | expose :id, :username, :email, :name, :state, :created_at |
| 10 | end | 14 | end |
lib/api/internal.rb
| @@ -44,7 +44,7 @@ module Gitlab | @@ -44,7 +44,7 @@ module Gitlab | ||
| 44 | # | 44 | # |
| 45 | get "/discover" do | 45 | get "/discover" do |
| 46 | key = Key.find(params[:key_id]) | 46 | key = Key.find(params[:key_id]) |
| 47 | - present key.user, with: Entities::User | 47 | + present key.user, with: Entities::UserSafe |
| 48 | end | 48 | end |
| 49 | 49 | ||
| 50 | get "/check" do | 50 | get "/check" do |