Skip to content
Snippets Groups Projects
Verified Commit d05dd81b authored by Markus Koller's avatar Markus Koller
Browse files

Don't expose all namespace fields in API

parent 845e2d36
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -88,7 +88,7 @@ module API
expose :shared_runners_enabled
expose :lfs_enabled?, as: :lfs_enabled
expose :creator_id
expose :namespace
expose :namespace, using: 'API::Entities::Namespace'
expose :forked_from_project, using: Entities::BasicProjectDetails, if: lambda{ |project, options| project.forked? }
expose :avatar_url
expose :star_count, :forks_count
Loading
Loading
@@ -391,7 +391,7 @@ module API
end
 
class Namespace < Grape::Entity
expose :id, :path, :kind
expose :id, :name, :path, :kind
end
 
class MemberAccess < Grape::Entity
Loading
Loading
Loading
Loading
@@ -630,6 +630,18 @@ describe API::Projects, api: true do
expect(json_response['name']).to eq(project.name)
end
 
it 'exposes namespace fields' do
get api("/projects/#{project.id}", user)
expect(response).to have_http_status(200)
expect(json_response['namespace']).to eq({
'id' => user.namespace.id,
'name' => user.namespace.name,
'path' => user.namespace.path,
'kind' => user.namespace.kind,
})
end
describe 'permissions' do
context 'all projects' do
before { project.team << [user, :master] }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment