Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
0
Merge Requests
0
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-shell
Commits
c4d63ab0
Commit
c4d63ab0
authored
Jul 26, 2018
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy up GitlabNet
* Remove HTTP related requires * Make protocol = GL_PROTOCOL the default
parent
3087f411
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
lib/gitlab_net.rb
lib/gitlab_net.rb
+2
-7
No files found.
lib/gitlab_net.rb
View file @
c4d63ab0
require
'net/http'
require
'openssl'
require
'json'
require_relative
'gitlab_config'
require_relative
'gitlab_logger'
require_relative
'gitlab_access'
require_relative
'gitlab_lfs_authentication'
require_relative
'httpunix'
require_relative
'http_helper'
class
GitlabNet
# rubocop:disable Metrics/ClassLength
...
...
@@ -15,7 +11,7 @@ class GitlabNet # rubocop:disable Metrics/ClassLength
CHECK_TIMEOUT
=
5
GL_PROTOCOL
=
'ssh'
.
freeze
def
check_access
(
cmd
,
gl_repository
,
repo
,
key_id
,
changes
,
protocol
,
env:
{})
def
check_access
(
cmd
,
gl_repository
,
repo
,
key_id
,
changes
,
protocol
=
GL_PROTOCOL
,
env:
{})
changes
=
changes
.
join
(
"
\n
"
)
unless
changes
.
is_a?
(
String
)
params
=
{
...
...
@@ -28,8 +24,7 @@ class GitlabNet # rubocop:disable Metrics/ClassLength
env:
env
}
url
=
"
#{
internal_api_endpoint
}
/allowed"
resp
=
post
(
url
,
params
)
resp
=
post
(
"
#{
internal_api_endpoint
}
/allowed"
,
params
)
if
resp
.
code
==
'200'
GitAccessStatus
.
create_from_json
(
resp
.
body
)
...
...
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