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
3087f411
Commit
3087f411
authored
Jul 26, 2018
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actor is always key_id in GitlabNet
parent
99a65d67
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 @
3087f411
...
...
@@ -15,24 +15,19 @@ class GitlabNet # rubocop:disable Metrics/ClassLength
CHECK_TIMEOUT
=
5
GL_PROTOCOL
=
'ssh'
.
freeze
def
check_access
(
cmd
,
gl_repository
,
repo
,
actor
,
changes
,
protocol
,
env:
{})
def
check_access
(
cmd
,
gl_repository
,
repo
,
key_id
,
changes
,
protocol
,
env:
{})
changes
=
changes
.
join
(
"
\n
"
)
unless
changes
.
is_a?
(
String
)
params
=
{
action:
cmd
,
changes:
changes
,
gl_repository:
gl_repository
,
key_id:
key_id
.
gsub
(
'key-'
,
''
),
project:
sanitize_path
(
repo
),
protocol:
protocol
,
env:
env
}
if
actor
=~
/\Akey\-\d+\Z/
params
[
:key_id
]
=
actor
.
gsub
(
"key-"
,
""
)
elsif
actor
=~
/\Auser\-\d+\Z/
params
[
:user_id
]
=
actor
.
gsub
(
"user-"
,
""
)
end
url
=
"
#{
internal_api_endpoint
}
/allowed"
resp
=
post
(
url
,
params
)
...
...
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