Commit 639e8e60 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
parent 35aef23f
......@@ -21,7 +21,7 @@ describe GitlabNet, vcr: true do
describe :discover do
it 'should return user has based on key id' do
VCR.use_cassette("discover-ok") do
user = gitlab_net.discover('key-1')
user = gitlab_net.discover('key-126')
user['name'].should == 'Dmitriy Zaporozhets'
end
end
......@@ -31,14 +31,14 @@ describe GitlabNet, vcr: true do
context 'ssh key with access to project' do
it 'should allow pull access for dev.gitlab.org' 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-126', 'master')
access.should be_true
end
end
it 'should allow push access for dev.gitlab.org' 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-126', 'master')
access.should be_true
end
end
......
......@@ -2,13 +2,15 @@
http_interactions:
- request:
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:
encoding: US-ASCII
string: ''
headers:
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- ! '*/*'
- "*/*"
User-Agent:
- Ruby
response:
......@@ -19,7 +21,7 @@ http_interactions:
Server:
- nginx/1.1.19
Date:
- Mon, 11 Mar 2013 12:13:31 GMT
- Mon, 14 Apr 2014 18:25:53 GMT
Content-Type:
- application/json
Content-Length:
......@@ -28,21 +30,17 @@ http_interactions:
- keep-alive
Status:
- 200 OK
X-Ua-Compatible:
- IE=Edge,chrome=1
Etag:
- ! '"b326b5062b2f0e69046810717534cb09"'
- '"b326b5062b2f0e69046810717534cb09"'
Cache-Control:
- max-age=0, private, must-revalidate
X-Request-Id:
- ac00b27743e177559476f6575e45d1c2
- b049c014-05c4-4ec7-a591-1b0661257e33
X-Runtime:
- '0.017272'
X-Rack-Cache:
- miss
- '0.055486'
body:
encoding: US-ASCII
encoding: UTF-8
string: 'true'
http_version:
recorded_at: Mon, 11 Mar 2013 12:13:31 GMT
recorded_at: Mon, 14 Apr 2014 18:25:53 GMT
recorded_with: VCR 2.4.0
......@@ -2,13 +2,15 @@
http_interactions:
- request:
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:
encoding: US-ASCII
string: ''
headers:
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- ! '*/*'
- "*/*"
User-Agent:
- Ruby
response:
......@@ -19,7 +21,7 @@ http_interactions:
Server:
- nginx/1.1.19
Date:
- Mon, 11 Mar 2013 12:13:32 GMT
- Mon, 14 Apr 2014 18:25:54 GMT
Content-Type:
- application/json
Content-Length:
......@@ -28,21 +30,17 @@ http_interactions:
- keep-alive
Status:
- 200 OK
X-Ua-Compatible:
- IE=Edge,chrome=1
Etag:
- ! '"b326b5062b2f0e69046810717534cb09"'
- '"b326b5062b2f0e69046810717534cb09"'
Cache-Control:
- max-age=0, private, must-revalidate
X-Request-Id:
- c65f8ea13ac34cf182fcb6daefeb1bdd
- 7f92ebb7-4f92-4236-a35a-5f15c59b81f8
X-Runtime:
- '0.018934'
X-Rack-Cache:
- miss
- '0.060724'
body:
encoding: US-ASCII
encoding: UTF-8
string: 'true'
http_version:
recorded_at: Mon, 11 Mar 2013 12:13:31 GMT
recorded_at: Mon, 14 Apr 2014 18:25:54 GMT
recorded_with: VCR 2.4.0
......@@ -7,8 +7,10 @@ http_interactions:
encoding: US-ASCII
string: ''
headers:
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- ! '*/*'
- "*/*"
User-Agent:
- Ruby
response:
......@@ -19,30 +21,26 @@ http_interactions:
Server:
- nginx/1.1.19
Date:
- Mon, 11 Mar 2013 13:05:30 GMT
- Mon, 14 Apr 2014 18:25:52 GMT
Content-Type:
- application/json
Content-Length:
- '71'
- '72'
Connection:
- keep-alive
Status:
- 200 OK
X-Ua-Compatible:
- IE=Edge,chrome=1
Etag:
- ! '"cb194c2a4bfe01ae695d15ad834b7f5c"'
- '"263db4ad138ffbada1f94332a1a2e1e8"'
Cache-Control:
- max-age=0, private, must-revalidate
X-Request-Id:
- 66424e020a58b1fc50efcf846e301b40
- 17b6ff1c-e1a5-4443-b053-74cfced03184
X-Runtime:
- '0.003728'
X-Rack-Cache:
- miss
- '0.004863'
body:
encoding: US-ASCII
string: ! '{"api_version":"v3","gitlab_version":"5.0.0pre","gitlab_rev":"473efc8"}'
encoding: UTF-8
string: '{"api_version":"v3","gitlab_version":"6.8.0.pre","gitlab_rev":"352bb97"}'
http_version:
recorded_at: Mon, 11 Mar 2013 13:05:30 GMT
recorded_at: Mon, 14 Apr 2014 18:25:52 GMT
recorded_with: VCR 2.4.0
......@@ -2,13 +2,15 @@
http_interactions:
- request:
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:
encoding: US-ASCII
string: ''
headers:
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- ! '*/*'
- "*/*"
User-Agent:
- Ruby
response:
......@@ -19,7 +21,7 @@ http_interactions:
Server:
- nginx/1.1.19
Date:
- Mon, 11 Mar 2013 12:21:31 GMT
- Mon, 14 Apr 2014 18:25:54 GMT
Content-Type:
- application/json
Content-Length:
......@@ -28,19 +30,15 @@ http_interactions:
- keep-alive
Status:
- 404 Not Found
X-Ua-Compatible:
- IE=Edge,chrome=1
Cache-Control:
- no-cache
X-Request-Id:
- bda6c4046ea050c5bad39a38337f5771
- 7eb4f49d-66a6-4cca-84dd-9dfcd431210a
X-Runtime:
- '0.005632'
X-Rack-Cache:
- miss
- '0.010216'
body:
encoding: US-ASCII
string: ! '{"message":"404 Not found"}'
encoding: UTF-8
string: '{"message":"404 Not found"}'
http_version:
recorded_at: Mon, 11 Mar 2013 12:21:30 GMT
recorded_at: Mon, 14 Apr 2014 18:25:54 GMT
recorded_with: VCR 2.4.0
......@@ -2,13 +2,15 @@
http_interactions:
- request:
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:
encoding: US-ASCII
string: ''
headers:
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- ! '*/*'
- "*/*"
User-Agent:
- Ruby
response:
......@@ -19,7 +21,7 @@ http_interactions:
Server:
- nginx/1.1.19
Date:
- Mon, 11 Mar 2013 12:21:31 GMT
- Mon, 14 Apr 2014 18:25:54 GMT
Content-Type:
- application/json
Content-Length:
......@@ -28,19 +30,15 @@ http_interactions:
- keep-alive
Status:
- 404 Not Found
X-Ua-Compatible:
- IE=Edge,chrome=1
Cache-Control:
- no-cache
X-Request-Id:
- 6242870566154e17170c86ebb7f7a448
- 2a2a3ef9-aaf1-4ffb-8b18-475d52ec5e09
X-Runtime:
- '0.005174'
X-Rack-Cache:
- miss
- '0.013223'
body:
encoding: US-ASCII
string: ! '{"message":"404 Not found"}'
encoding: UTF-8
string: '{"message":"404 Not found"}'
http_version:
recorded_at: Mon, 11 Mar 2013 12:21:31 GMT
recorded_at: Mon, 14 Apr 2014 18:25:54 GMT
recorded_with: VCR 2.4.0
---
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
......@@ -2,13 +2,15 @@
http_interactions:
- request:
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=126
body:
encoding: US-ASCII
string: ''
headers:
Accept-Encoding:
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept:
- ! '*/*'
- "*/*"
User-Agent:
- Ruby
response:
......@@ -19,30 +21,26 @@ http_interactions:
Server:
- nginx/1.1.19
Date:
- Mon, 11 Mar 2013 12:25:45 GMT
- Mon, 14 Apr 2014 18:25:53 GMT
Content-Type:
- application/json
Content-Length:
- '332'
- '56'
Connection:
- keep-alive
Status:
- 200 OK
X-Ua-Compatible:
- IE=Edge,chrome=1
Etag:
- ! '"132e22d01addb4fe7fc1ee9f954b69e1"'
- '"1d75c1cf3d4bfa4d2b7bb6a0bcfd7f55"'
Cache-Control:
- max-age=0, private, must-revalidate
X-Request-Id:
- 47a6a45ce3073d1f7497d15290c109ef
- c3d44ccc-7599-4cc1-879e-281894f9cb39
X-Runtime:
- '0.007938'
X-Rack-Cache:
- miss
- '0.010799'
body:
encoding: US-ASCII
string: ! '{"name":"Dmitriy Zaporozhets"}'
encoding: UTF-8
string: '{"name":"Dmitriy Zaporozhets","username":"dzaporozhets"}'
http_version:
recorded_at: Mon, 11 Mar 2013 12:25:44 GMT
recorded_at: Mon, 14 Apr 2014 18:25:53 GMT
recorded_with: VCR 2.4.0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment