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
aa931c12
Commit
aa931c12
authored
Feb 14, 2020
by
Rajendra Kadam
Committed by
James Lopez
Feb 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separate application and blob entities into own class files
parent
744e7c17
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
28 deletions
+48
-28
changelogs/unreleased/refactoring-entities-file-29.yml
changelogs/unreleased/refactoring-entities-file-29.yml
+5
-0
lib/api/entities.rb
lib/api/entities.rb
+0
-28
lib/api/entities/application.rb
lib/api/entities/application.rb
+13
-0
lib/api/entities/application_with_secret.rb
lib/api/entities/application_with_secret.rb
+10
-0
lib/api/entities/blob.rb
lib/api/entities/blob.rb
+20
-0
No files found.
changelogs/unreleased/refactoring-entities-file-29.yml
0 → 100644
View file @
aa931c12
---
title
:
Separate Application and Blob entities into own class files
merge_request
:
24997
author
:
Rajendra Kadam
type
:
added
lib/api/entities.rb
View file @
aa931c12
...
...
@@ -215,34 +215,6 @@ module API
expose
:expired?
,
as: :expired
expose
:expiration
end
class
Application
<
Grape
::
Entity
expose
:id
expose
:uid
,
as: :application_id
expose
:name
,
as: :application_name
expose
:redirect_uri
,
as: :callback_url
expose
:confidential
end
# Use with care, this exposes the secret
class
ApplicationWithSecret
<
Application
expose
:secret
end
class
Blob
<
Grape
::
Entity
expose
:basename
expose
:data
expose
:path
# TODO: :filename was renamed to :path but both still return the full path,
# in the future we can only return the filename here without the leading
# directory path.
# https://gitlab.com/gitlab-org/gitlab/issues/34521
expose
:filename
,
&
:path
expose
:id
expose
:ref
expose
:startline
expose
:project_id
end
end
end
...
...
lib/api/entities/application.rb
0 → 100644
View file @
aa931c12
# frozen_string_literal: true
module
API
module
Entities
class
Application
<
Grape
::
Entity
expose
:id
expose
:uid
,
as: :application_id
expose
:name
,
as: :application_name
expose
:redirect_uri
,
as: :callback_url
expose
:confidential
end
end
end
lib/api/entities/application_with_secret.rb
0 → 100644
View file @
aa931c12
# frozen_string_literal: true
module
API
module
Entities
# Use with care, this exposes the secret
class
ApplicationWithSecret
<
Entities
::
Application
expose
:secret
end
end
end
lib/api/entities/blob.rb
0 → 100644
View file @
aa931c12
# frozen_string_literal: true
module
API
module
Entities
class
Blob
<
Grape
::
Entity
expose
:basename
expose
:data
expose
:path
# TODO: :filename was renamed to :path but both still return the full path,
# in the future we can only return the filename here without the leading
# directory path.
# https://gitlab.com/gitlab-org/gitlab/issues/34521
expose
:filename
,
&
:path
expose
:id
expose
:ref
expose
:startline
expose
:project_id
end
end
end
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