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
8dc91cde
Commit
8dc91cde
authored
Sep 03, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor alignment adjustments / comments / unnecessary code removal
parent
d8c746f4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
18 deletions
+8
-18
config/routes.rb
config/routes.rb
+0
-1
lib/api/api.rb
lib/api/api.rb
+8
-5
lib/api/v3/github_repos.rb
lib/api/v3/github_repos.rb
+0
-7
lib/api/v3/users.rb
lib/api/v3/users.rb
+0
-5
No files found.
config/routes.rb
View file @
8dc91cde
...
@@ -19,7 +19,6 @@ Rails.application.routes.draw do
...
@@ -19,7 +19,6 @@ Rails.application.routes.draw do
controllers
applications:
'oauth/applications'
,
controllers
applications:
'oauth/applications'
,
authorized_applications:
'oauth/authorized_applications'
,
authorized_applications:
'oauth/authorized_applications'
,
authorizations:
'oauth/authorizations'
authorizations:
'oauth/authorizations'
end
end
scope
path:
'/-/jira/login/oauth'
,
controller:
'oauth/jira/authorizations'
,
as: :oauth_jira
do
scope
path:
'/-/jira/login/oauth'
,
controller:
'oauth/jira/authorizations'
,
as: :oauth_jira
do
...
...
lib/api/api.rb
View file @
8dc91cde
...
@@ -5,9 +5,6 @@ module API
...
@@ -5,9 +5,6 @@ module API
allow_access_with_scope
:api
allow_access_with_scope
:api
prefix
:api
prefix
:api
NO_SLASH_URL_PART_REGEX
=
%r{[^/]+}
PROJECT_ENDPOINT_REQUIREMENTS
=
{
id:
NO_SLASH_URL_PART_REGEX
}.
freeze
version
%w(v3 v4)
,
using: :path
version
%w(v3 v4)
,
using: :path
version
'v3'
,
using: :path
do
version
'v3'
,
using: :path
do
...
@@ -15,8 +12,6 @@ module API
...
@@ -15,8 +12,6 @@ module API
helpers
::
API
::
Helpers
::
CommonHelpers
helpers
::
API
::
Helpers
::
CommonHelpers
mount
::
API
::
V3
::
AwardEmoji
mount
::
API
::
V3
::
AwardEmoji
mount
::
API
::
V3
::
GithubRepos
mount
::
API
::
V3
::
Boards
mount
::
API
::
V3
::
Boards
mount
::
API
::
V3
::
Branches
mount
::
API
::
V3
::
Branches
mount
::
API
::
V3
::
BroadcastMessages
mount
::
API
::
V3
::
BroadcastMessages
...
@@ -54,6 +49,11 @@ module API
...
@@ -54,6 +49,11 @@ module API
mount
::
API
::
V3
::
Triggers
mount
::
API
::
V3
::
Triggers
mount
::
API
::
V3
::
Users
mount
::
API
::
V3
::
Users
mount
::
API
::
V3
::
Variables
mount
::
API
::
V3
::
Variables
# Although the following endpoints are kept behind V3 namespace, they're not
# deprecated neither should be removed when V3 get removed.
# They're needed as a layer to integrate with Jira development panel.
mount
::
API
::
V3
::
GithubRepos
end
end
before
{
header
[
'X-Frame-Options'
]
=
'SAMEORIGIN'
}
before
{
header
[
'X-Frame-Options'
]
=
'SAMEORIGIN'
}
...
@@ -95,6 +95,9 @@ module API
...
@@ -95,6 +95,9 @@ module API
helpers
::
API
::
Helpers
helpers
::
API
::
Helpers
helpers
::
API
::
Helpers
::
CommonHelpers
helpers
::
API
::
Helpers
::
CommonHelpers
NO_SLASH_URL_PART_REGEX
=
%r{[^/]+}
PROJECT_ENDPOINT_REQUIREMENTS
=
{
id:
NO_SLASH_URL_PART_REGEX
}.
freeze
# Keep in alphabetical order
# Keep in alphabetical order
mount
::
API
::
AccessRequests
mount
::
API
::
AccessRequests
mount
::
API
::
AwardEmoji
mount
::
API
::
AwardEmoji
...
...
lib/api/v3/github_repos.rb
View file @
8dc91cde
...
@@ -42,10 +42,6 @@ module API
...
@@ -42,10 +42,6 @@ module API
project
=
params
[
:project
]
project
=
params
[
:project
]
user_project
=
find_project!
(
"
#{
namespace
}
/
#{
project
}
"
)
user_project
=
find_project!
(
"
#{
namespace
}
/
#{
project
}
"
)
branches
=
::
API
::
Entities
::
Github
::
Branch
.
represent
(
user_project
.
repository
.
branches
.
sort_by
(
&
:name
),
project:
user_project
)
.
as_json
branches
=
::
Kaminari
.
paginate_array
(
user_project
.
repository
.
branches
.
sort_by
(
&
:name
))
branches
=
::
Kaminari
.
paginate_array
(
user_project
.
repository
.
branches
.
sort_by
(
&
:name
))
present
paginate
(
branches
),
present
paginate
(
branches
),
...
@@ -65,9 +61,6 @@ module API
...
@@ -65,9 +61,6 @@ module API
not_found!
'Commit'
unless
commit
not_found!
'Commit'
unless
commit
json_commit
=
::
API
::
Entities
::
Github
::
RepoCommit
.
represent
(
commit
).
as_json
Rails
.
logger
.
info
(
"JSON COMMIT:
#{
json_commit
}
"
)
present
commit
,
with:
::
API
::
Entities
::
Github
::
RepoCommit
present
commit
,
with:
::
API
::
Entities
::
Github
::
RepoCommit
end
end
end
end
...
...
lib/api/v3/users.rb
View file @
8dc91cde
...
@@ -64,11 +64,6 @@ module API
...
@@ -64,11 +64,6 @@ module API
end
end
end
end
# desc ':org/repos' do
# Rails.logger.info("Requesting /users/#{params[:org]}/repos with params #{params}")
# Rails.logger.info("User: #{current_user.name}")
# end
desc
'Get the SSH keys of a specified user. Available only for admins.'
do
desc
'Get the SSH keys of a specified user. Available only for admins.'
do
success
::
API
::
Entities
::
SSHKey
success
::
API
::
Entities
::
SSHKey
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