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
Kazuhiko Shiozaki
gitlab-shell
Commits
639e8e60
Commit
639e8e60
authored
Apr 14, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
35aef23f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
126 deletions
+66
-126
spec/gitlab_net_spec.rb
spec/gitlab_net_spec.rb
+3
-3
spec/vcr_cassettes/allowed-pull.yml
spec/vcr_cassettes/allowed-pull.yml
+10
-12
spec/vcr_cassettes/allowed-push.yml
spec/vcr_cassettes/allowed-push.yml
+10
-12
spec/vcr_cassettes/check-ok.yml
spec/vcr_cassettes/check-ok.yml
+11
-13
spec/vcr_cassettes/denied-pull.yml
spec/vcr_cassettes/denied-pull.yml
+10
-12
spec/vcr_cassettes/denied-push.yml
spec/vcr_cassettes/denied-push.yml
+10
-12
spec/vcr_cassettes/dev_gitlab_org.yml
spec/vcr_cassettes/dev_gitlab_org.yml
+0
-48
spec/vcr_cassettes/discover-ok.yml
spec/vcr_cassettes/discover-ok.yml
+12
-14
No files found.
spec/gitlab_net_spec.rb
View file @
639e8e60
...
@@ -21,7 +21,7 @@ describe GitlabNet, vcr: true do
...
@@ -21,7 +21,7 @@ describe GitlabNet, vcr: true do
describe
:discover
do
describe
:discover
do
it
'should return user has based on key id'
do
it
'should return user has based on key id'
do
VCR
.
use_cassette
(
"discover-ok"
)
do
VCR
.
use_cassette
(
"discover-ok"
)
do
user
=
gitlab_net
.
discover
(
'key-1'
)
user
=
gitlab_net
.
discover
(
'key-1
26
'
)
user
[
'name'
].
should
==
'Dmitriy Zaporozhets'
user
[
'name'
].
should
==
'Dmitriy Zaporozhets'
end
end
end
end
...
@@ -31,14 +31,14 @@ describe GitlabNet, vcr: true do
...
@@ -31,14 +31,14 @@ describe GitlabNet, vcr: true do
context
'ssh key with access to project'
do
context
'ssh key with access to project'
do
it
'should allow pull access for dev.gitlab.org'
do
it
'should allow pull access for dev.gitlab.org'
do
VCR
.
use_cassette
(
"allowed-pull"
)
do
VCR
.
use_cassette
(
"allowed-pull"
)
do
access
=
gitlab_net
.
allowed?
(
'git-receive-pack'
,
'gitlab/gitlabhq.git'
,
'key-1'
,
'master'
)
access
=
gitlab_net
.
allowed?
(
'git-receive-pack'
,
'gitlab/gitlabhq.git'
,
'key-1
26
'
,
'master'
)
access
.
should
be_true
access
.
should
be_true
end
end
end
end
it
'should allow push access for dev.gitlab.org'
do
it
'should allow push access for dev.gitlab.org'
do
VCR
.
use_cassette
(
"allowed-push"
)
do
VCR
.
use_cassette
(
"allowed-push"
)
do
access
=
gitlab_net
.
allowed?
(
'git-upload-pack'
,
'gitlab/gitlabhq.git'
,
'key-1'
,
'master'
)
access
=
gitlab_net
.
allowed?
(
'git-upload-pack'
,
'gitlab/gitlabhq.git'
,
'key-1
26
'
,
'master'
)
access
.
should
be_true
access
.
should
be_true
end
end
end
end
...
...
spec/vcr_cassettes/allowed-pull.yml
View file @
639e8e60
...
@@ -2,13 +2,15 @@
...
@@ -2,13 +2,15 @@
http_interactions
:
http_interactions
:
-
request
:
-
request
:
method
:
get
method
:
get
uri
:
https://dev.gitlab.org/api/v3/internal/allowed?action=git-receive-pack&
key_id=1
&project=gitlab/gitlabhq&ref=master
uri
:
https://dev.gitlab.org/api/v3/internal/allowed?action=git-receive-pack&
forced_push=false&key_id=126
&project=gitlab/gitlabhq&ref=master
body
:
body
:
encoding
:
US-ASCII
encoding
:
US-ASCII
string
:
'
'
string
:
'
'
headers
:
headers
:
Accept-Encoding
:
-
gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept
:
Accept
:
-
!
'
*/*'
-
"
*/*"
User-Agent
:
User-Agent
:
-
Ruby
-
Ruby
response
:
response
:
...
@@ -19,7 +21,7 @@ http_interactions:
...
@@ -19,7 +21,7 @@ http_interactions:
Server
:
Server
:
-
nginx/1.1.19
-
nginx/1.1.19
Date
:
Date
:
-
Mon, 1
1 Mar 2013 12:13:31
GMT
-
Mon, 1
4 Apr 2014 18:25:53
GMT
Content-Type
:
Content-Type
:
-
application/json
-
application/json
Content-Length
:
Content-Length
:
...
@@ -28,21 +30,17 @@ http_interactions:
...
@@ -28,21 +30,17 @@ http_interactions:
-
keep-alive
-
keep-alive
Status
:
Status
:
-
200 OK
-
200 OK
X-Ua-Compatible
:
-
IE=Edge,chrome=1
Etag
:
Etag
:
-
!
'
"b326b5062b2f0e69046810717534cb09"'
-
'
"b326b5062b2f0e69046810717534cb09"'
Cache-Control
:
Cache-Control
:
-
max-age=0, private, must-revalidate
-
max-age=0, private, must-revalidate
X-Request-Id
:
X-Request-Id
:
-
ac00b27743e177559476f6575e45d1c2
-
b049c014-05c4-4ec7-a591-1b0661257e33
X-Runtime
:
X-Runtime
:
-
'
0.017272'
-
'
0.055486'
X-Rack-Cache
:
-
miss
body
:
body
:
encoding
:
U
S-ASCII
encoding
:
U
TF-8
string
:
'
true'
string
:
'
true'
http_version
:
http_version
:
recorded_at
:
Mon, 1
1 Mar 2013 12:13:31
GMT
recorded_at
:
Mon, 1
4 Apr 2014 18:25:53
GMT
recorded_with
:
VCR 2.4.0
recorded_with
:
VCR 2.4.0
spec/vcr_cassettes/allowed-push.yml
View file @
639e8e60
...
@@ -2,13 +2,15 @@
...
@@ -2,13 +2,15 @@
http_interactions
:
http_interactions
:
-
request
:
-
request
:
method
:
get
method
:
get
uri
:
https://dev.gitlab.org/api/v3/internal/allowed?action=git-upload-pack&
key_id=1
&project=gitlab/gitlabhq&ref=master
uri
:
https://dev.gitlab.org/api/v3/internal/allowed?action=git-upload-pack&
forced_push=false&key_id=126
&project=gitlab/gitlabhq&ref=master
body
:
body
:
encoding
:
US-ASCII
encoding
:
US-ASCII
string
:
'
'
string
:
'
'
headers
:
headers
:
Accept-Encoding
:
-
gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept
:
Accept
:
-
!
'
*/*'
-
"
*/*"
User-Agent
:
User-Agent
:
-
Ruby
-
Ruby
response
:
response
:
...
@@ -19,7 +21,7 @@ http_interactions:
...
@@ -19,7 +21,7 @@ http_interactions:
Server
:
Server
:
-
nginx/1.1.19
-
nginx/1.1.19
Date
:
Date
:
-
Mon, 1
1 Mar 2013 12:13:32
GMT
-
Mon, 1
4 Apr 2014 18:25:54
GMT
Content-Type
:
Content-Type
:
-
application/json
-
application/json
Content-Length
:
Content-Length
:
...
@@ -28,21 +30,17 @@ http_interactions:
...
@@ -28,21 +30,17 @@ http_interactions:
-
keep-alive
-
keep-alive
Status
:
Status
:
-
200 OK
-
200 OK
X-Ua-Compatible
:
-
IE=Edge,chrome=1
Etag
:
Etag
:
-
!
'
"b326b5062b2f0e69046810717534cb09"'
-
'
"b326b5062b2f0e69046810717534cb09"'
Cache-Control
:
Cache-Control
:
-
max-age=0, private, must-revalidate
-
max-age=0, private, must-revalidate
X-Request-Id
:
X-Request-Id
:
-
c65f8ea13ac34cf182fcb6daefeb1bdd
-
7f92ebb7-4f92-4236-a35a-5f15c59b81f8
X-Runtime
:
X-Runtime
:
-
'
0.018934'
-
'
0.060724'
X-Rack-Cache
:
-
miss
body
:
body
:
encoding
:
U
S-ASCII
encoding
:
U
TF-8
string
:
'
true'
string
:
'
true'
http_version
:
http_version
:
recorded_at
:
Mon, 1
1 Mar 2013 12:13:31
GMT
recorded_at
:
Mon, 1
4 Apr 2014 18:25:54
GMT
recorded_with
:
VCR 2.4.0
recorded_with
:
VCR 2.4.0
spec/vcr_cassettes/check-ok.yml
View file @
639e8e60
...
@@ -7,8 +7,10 @@ http_interactions:
...
@@ -7,8 +7,10 @@ http_interactions:
encoding
:
US-ASCII
encoding
:
US-ASCII
string
:
'
'
string
:
'
'
headers
:
headers
:
Accept-Encoding
:
-
gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept
:
Accept
:
-
!
'
*/*'
-
"
*/*"
User-Agent
:
User-Agent
:
-
Ruby
-
Ruby
response
:
response
:
...
@@ -19,30 +21,26 @@ http_interactions:
...
@@ -19,30 +21,26 @@ http_interactions:
Server
:
Server
:
-
nginx/1.1.19
-
nginx/1.1.19
Date
:
Date
:
-
Mon, 1
1 Mar 2013 13:05:30
GMT
-
Mon, 1
4 Apr 2014 18:25:52
GMT
Content-Type
:
Content-Type
:
-
application/json
-
application/json
Content-Length
:
Content-Length
:
-
'
7
1
'
-
'
7
2
'
Connection
:
Connection
:
-
keep-alive
-
keep-alive
Status
:
Status
:
-
200 OK
-
200 OK
X-Ua-Compatible
:
-
IE=Edge,chrome=1
Etag
:
Etag
:
-
!
'
"cb194c2a4bfe01ae695d15ad834b7f5c
"'
-
'
"263db4ad138ffbada1f94332a1a2e1e8
"'
Cache-Control
:
Cache-Control
:
-
max-age=0, private, must-revalidate
-
max-age=0, private, must-revalidate
X-Request-Id
:
X-Request-Id
:
-
66424e020a58b1fc50efcf846e301b40
-
17b6ff1c-e1a5-4443-b053-74cfced03184
X-Runtime
:
X-Runtime
:
-
'
0.003728'
-
'
0.004863'
X-Rack-Cache
:
-
miss
body
:
body
:
encoding
:
U
S-ASCII
encoding
:
U
TF-8
string
:
!
'
{"api_version":"v3","gitlab_version":"5.0.0pre","gitlab_rev":"473efc8
"}'
string
:
'
{"api_version":"v3","gitlab_version":"6.8.0.pre","gitlab_rev":"352bb97
"}'
http_version
:
http_version
:
recorded_at
:
Mon, 1
1 Mar 2013 13:05:30
GMT
recorded_at
:
Mon, 1
4 Apr 2014 18:25:52
GMT
recorded_with
:
VCR 2.4.0
recorded_with
:
VCR 2.4.0
spec/vcr_cassettes/denied-pull.yml
View file @
639e8e60
...
@@ -2,13 +2,15 @@
...
@@ -2,13 +2,15 @@
http_interactions
:
http_interactions
:
-
request
:
-
request
:
method
:
get
method
:
get
uri
:
https://dev.gitlab.org/api/v3/internal/allowed?action=git-receive-pack&key_id=2&project=gitlab/gitlabhq&ref=master
uri
:
https://dev.gitlab.org/api/v3/internal/allowed?action=git-receive-pack&
forced_push=false&
key_id=2&project=gitlab/gitlabhq&ref=master
body
:
body
:
encoding
:
US-ASCII
encoding
:
US-ASCII
string
:
'
'
string
:
'
'
headers
:
headers
:
Accept-Encoding
:
-
gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept
:
Accept
:
-
!
'
*/*'
-
"
*/*"
User-Agent
:
User-Agent
:
-
Ruby
-
Ruby
response
:
response
:
...
@@ -19,7 +21,7 @@ http_interactions:
...
@@ -19,7 +21,7 @@ http_interactions:
Server
:
Server
:
-
nginx/1.1.19
-
nginx/1.1.19
Date
:
Date
:
-
Mon, 1
1 Mar 2013 12:21:31
GMT
-
Mon, 1
4 Apr 2014 18:25:54
GMT
Content-Type
:
Content-Type
:
-
application/json
-
application/json
Content-Length
:
Content-Length
:
...
@@ -28,19 +30,15 @@ http_interactions:
...
@@ -28,19 +30,15 @@ http_interactions:
-
keep-alive
-
keep-alive
Status
:
Status
:
-
404 Not Found
-
404 Not Found
X-Ua-Compatible
:
-
IE=Edge,chrome=1
Cache-Control
:
Cache-Control
:
-
no-cache
-
no-cache
X-Request-Id
:
X-Request-Id
:
-
bda6c4046ea050c5bad39a38337f5771
-
7eb4f49d-66a6-4cca-84dd-9dfcd431210a
X-Runtime
:
X-Runtime
:
-
'
0.005632'
-
'
0.010216'
X-Rack-Cache
:
-
miss
body
:
body
:
encoding
:
U
S-ASCII
encoding
:
U
TF-8
string
:
!
'
{"message":"404
Not
found"}'
string
:
'
{"message":"404
Not
found"}'
http_version
:
http_version
:
recorded_at
:
Mon, 1
1 Mar 2013 12:21:30
GMT
recorded_at
:
Mon, 1
4 Apr 2014 18:25:54
GMT
recorded_with
:
VCR 2.4.0
recorded_with
:
VCR 2.4.0
spec/vcr_cassettes/denied-push.yml
View file @
639e8e60
...
@@ -2,13 +2,15 @@
...
@@ -2,13 +2,15 @@
http_interactions
:
http_interactions
:
-
request
:
-
request
:
method
:
get
method
:
get
uri
:
https://dev.gitlab.org/api/v3/internal/allowed?action=git-upload-pack&key_id=2&project=gitlab/gitlabhq&ref=master
uri
:
https://dev.gitlab.org/api/v3/internal/allowed?action=git-upload-pack&
forced_push=false&
key_id=2&project=gitlab/gitlabhq&ref=master
body
:
body
:
encoding
:
US-ASCII
encoding
:
US-ASCII
string
:
'
'
string
:
'
'
headers
:
headers
:
Accept-Encoding
:
-
gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept
:
Accept
:
-
!
'
*/*'
-
"
*/*"
User-Agent
:
User-Agent
:
-
Ruby
-
Ruby
response
:
response
:
...
@@ -19,7 +21,7 @@ http_interactions:
...
@@ -19,7 +21,7 @@ http_interactions:
Server
:
Server
:
-
nginx/1.1.19
-
nginx/1.1.19
Date
:
Date
:
-
Mon, 1
1 Mar 2013 12:21:31
GMT
-
Mon, 1
4 Apr 2014 18:25:54
GMT
Content-Type
:
Content-Type
:
-
application/json
-
application/json
Content-Length
:
Content-Length
:
...
@@ -28,19 +30,15 @@ http_interactions:
...
@@ -28,19 +30,15 @@ http_interactions:
-
keep-alive
-
keep-alive
Status
:
Status
:
-
404 Not Found
-
404 Not Found
X-Ua-Compatible
:
-
IE=Edge,chrome=1
Cache-Control
:
Cache-Control
:
-
no-cache
-
no-cache
X-Request-Id
:
X-Request-Id
:
-
6242870566154e17170c86ebb7f7a448
-
2a2a3ef9-aaf1-4ffb-8b18-475d52ec5e09
X-Runtime
:
X-Runtime
:
-
'
0.005174'
-
'
0.013223'
X-Rack-Cache
:
-
miss
body
:
body
:
encoding
:
U
S-ASCII
encoding
:
U
TF-8
string
:
!
'
{"message":"404
Not
found"}'
string
:
'
{"message":"404
Not
found"}'
http_version
:
http_version
:
recorded_at
:
Mon, 1
1 Mar 2013 12:21:31
GMT
recorded_at
:
Mon, 1
4 Apr 2014 18:25:54
GMT
recorded_with
:
VCR 2.4.0
recorded_with
:
VCR 2.4.0
spec/vcr_cassettes/dev_gitlab_org.yml
deleted
100644 → 0
View file @
35aef23f
---
http_interactions
:
-
request
:
method
:
get
uri
:
https://dev.gitlab.org/api/v3/internal/allowed?action=git-receive-pack&key_id=100&project=gitlab/gitlabhq&ref=master
body
:
encoding
:
US-ASCII
string
:
'
'
headers
:
Accept
:
-
!
'
*/*'
User-Agent
:
-
Ruby
response
:
status
:
code
:
200
message
:
OK
headers
:
Server
:
-
nginx/1.1.19
Date
:
-
Mon, 11 Mar 2013 12:13:05 GMT
Content-Type
:
-
application/json
Content-Length
:
-
'
4'
Connection
:
-
keep-alive
Status
:
-
200 OK
X-Ua-Compatible
:
-
IE=Edge,chrome=1
Etag
:
-
!
'
"b326b5062b2f0e69046810717534cb09"'
Cache-Control
:
-
max-age=0, private, must-revalidate
X-Request-Id
:
-
aabf04bba02ad88d256633dc34097095
X-Runtime
:
-
'
0.017099'
X-Rack-Cache
:
-
miss
body
:
encoding
:
US-ASCII
string
:
'
true'
http_version
:
recorded_at
:
Mon, 11 Mar 2013 12:13:05 GMT
recorded_with
:
VCR 2.4.0
spec/vcr_cassettes/discover-ok.yml
View file @
639e8e60
...
@@ -2,13 +2,15 @@
...
@@ -2,13 +2,15 @@
http_interactions
:
http_interactions
:
-
request
:
-
request
:
method
:
get
method
:
get
uri
:
https://dev.gitlab.org/api/v3/internal/discover?key_id=1
uri
:
https://dev.gitlab.org/api/v3/internal/discover?key_id=1
26
body
:
body
:
encoding
:
US-ASCII
encoding
:
US-ASCII
string
:
'
'
string
:
'
'
headers
:
headers
:
Accept-Encoding
:
-
gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept
:
Accept
:
-
!
'
*/*'
-
"
*/*"
User-Agent
:
User-Agent
:
-
Ruby
-
Ruby
response
:
response
:
...
@@ -19,30 +21,26 @@ http_interactions:
...
@@ -19,30 +21,26 @@ http_interactions:
Server
:
Server
:
-
nginx/1.1.19
-
nginx/1.1.19
Date
:
Date
:
-
Mon, 1
1 Mar 2013 12:25:45
GMT
-
Mon, 1
4 Apr 2014 18:25:53
GMT
Content-Type
:
Content-Type
:
-
application/json
-
application/json
Content-Length
:
Content-Length
:
-
'
332
'
-
'
56
'
Connection
:
Connection
:
-
keep-alive
-
keep-alive
Status
:
Status
:
-
200 OK
-
200 OK
X-Ua-Compatible
:
-
IE=Edge,chrome=1
Etag
:
Etag
:
-
!
'
"132e22d01addb4fe7fc1ee9f954b69e1
"'
-
'
"1d75c1cf3d4bfa4d2b7bb6a0bcfd7f55
"'
Cache-Control
:
Cache-Control
:
-
max-age=0, private, must-revalidate
-
max-age=0, private, must-revalidate
X-Request-Id
:
X-Request-Id
:
-
47a6a45ce3073d1f7497d15290c109ef
-
c3d44ccc-7599-4cc1-879e-281894f9cb39
X-Runtime
:
X-Runtime
:
-
'
0.007938'
-
'
0.010799'
X-Rack-Cache
:
-
miss
body
:
body
:
encoding
:
U
S-ASCII
encoding
:
U
TF-8
string
:
!
'
{"name":"Dmitriy
Z
aporozhets"}'
string
:
'
{"name":"Dmitriy
Zaporozhets","username":"dz
aporozhets"}'
http_version
:
http_version
:
recorded_at
:
Mon, 1
1 Mar 2013 12:25:44
GMT
recorded_at
:
Mon, 1
4 Apr 2014 18:25:53
GMT
recorded_with
:
VCR 2.4.0
recorded_with
:
VCR 2.4.0
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