Commit 1ba172d4 authored by Małgorzata Ksionek's avatar Małgorzata Ksionek

Update methods to use new path

parent 650ecad9
......@@ -90,7 +90,7 @@ func TestLfsAuthenticateRequests(t *testing.T) {
},
},
{
Path: "/api/v4/internal/allowed",
Path: "/api/v4/internal/allowed/secure",
Handler: func(w http.ResponseWriter, r *http.Request) {
b, err := ioutil.ReadAll(r.Body)
defer r.Body.Close()
......
......@@ -22,7 +22,7 @@ func TestCustomReceivePack(t *testing.T) {
requests := []testserver.TestRequestHandler{
{
Path: "/api/v4/internal/allowed",
Path: "/api/v4/internal/allowed/secure",
Handler: func(w http.ResponseWriter, r *http.Request) {
b, err := ioutil.ReadAll(r.Body)
require.NoError(t, err)
......
......@@ -24,7 +24,7 @@ var (
func setup(t *testing.T) (*Command, *bytes.Buffer, *bytes.Buffer, func()) {
requests := []testserver.TestRequestHandler{
{
Path: "/api/v4/internal/allowed",
Path: "/api/v4/internal/allowed/secure",
Handler: func(w http.ResponseWriter, r *http.Request) {
b, err := ioutil.ReadAll(r.Body)
require.NoError(t, err)
......
......@@ -80,7 +80,7 @@ func (c *Client) Verify(args *commandargs.Shell, action commandargs.CommandType,
request.KeyId = args.GitlabKeyId
}
response, err := c.client.Post("/allowed", request)
response, err := c.client.Post("/allowed/secure", request)
if err != nil {
return nil, err
}
......
......@@ -157,7 +157,7 @@ func setup(t *testing.T) (*Client, func()) {
requests := []testserver.TestRequestHandler{
{
Path: "/api/v4/internal/allowed",
Path: "/api/v4/internal/allowed/secure",
Handler: func(w http.ResponseWriter, r *http.Request) {
b, err := ioutil.ReadAll(r.Body)
require.NoError(t, err)
......
......@@ -13,7 +13,7 @@ import (
func BuildDisallowedByApiHandlers(t *testing.T) []testserver.TestRequestHandler {
requests := []testserver.TestRequestHandler{
{
Path: "/api/v4/internal/allowed",
Path: "/api/v4/internal/allowed/secure",
Handler: func(w http.ResponseWriter, r *http.Request) {
body := map[string]interface{}{
"status": false,
......@@ -31,7 +31,7 @@ func BuildDisallowedByApiHandlers(t *testing.T) []testserver.TestRequestHandler
func BuildAllowedWithGitalyHandlers(t *testing.T, gitalyAddress string) []testserver.TestRequestHandler {
requests := []testserver.TestRequestHandler{
{
Path: "/api/v4/internal/allowed",
Path: "/api/v4/internal/allowed/secure",
Handler: func(w http.ResponseWriter, r *http.Request) {
body := map[string]interface{}{
"status": true,
......
......@@ -28,7 +28,7 @@ class GitlabNet # rubocop:disable Metrics/ClassLength
who_sym, _, who_v = self.class.parse_who(who)
params[who_sym] = who_v
url = "#{internal_api_endpoint}/allowed"
url = "#{internal_api_endpoint}/allowed/secure"
resp = post(url, params)
case resp
......
......@@ -77,7 +77,7 @@ class GitlabShell # rubocop:disable Metrics/ClassLength
end
if @command == GIT_RECEIVE_PACK_COMMAND && access_status.custom_action?
# If the response from /api/v4/allowed is a HTTP 300, we need to perform
# If the response from /api/v4/allowed/secure is a HTTP 300, we need to perform
# a Custom Action and therefore should return and not call process_cmd()
#
return process_custom_action(access_status)
......
......@@ -24,7 +24,7 @@ describe 'Custom bin/gitlab-shell git-receive-pack' do
res.body = {"result" => output}.to_json
end
server.mount_proc('/api/v4/internal/allowed') do |req, res|
server.mount_proc('/api/v4/internal/allowed/secure') do |req, res|
res.content_type = 'application/json'
key_id = req.query['key_id'] || req.query['username']
......
......@@ -26,7 +26,7 @@ describe 'bin/gitlab-shell git-lfs-authentication' do
end
end
server.mount_proc('/api/v4/internal/allowed') do |req, res|
server.mount_proc('/api/v4/internal/allowed/secure') do |req, res|
res.content_type = 'application/json'
key_id = req.query['key_id'] || req.query['username']
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-upload-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=1&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......@@ -41,6 +41,6 @@ http_interactions:
body:
encoding: UTF-8
string: '{"status":true,"gl_repository":"project-3","gl_project_path":"gitlab-org/gitlab.test","repository_path":"/Users/dzaporozhets/Projects/gitlab-development-kit/repositories/gitlab-org/gitlab-test.git"}'
http_version:
http_version:
recorded_at: Wed, 21 Jun 2017 10:44:52 GMT
recorded_with: VCR 2.4.0
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=1&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=1&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=1&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=1&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=1&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=1&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=1&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......@@ -41,6 +41,6 @@ http_interactions:
body:
encoding: UTF-8
string: '{"status":true,"gl_repository":"project-3","gl_project_path":"gitlab-org/gitlab.test","repository_path":"/Users/dzaporozhets/Projects/gitlab-development-kit/repositories/gitlab-org/gitlab-test.git"}'
http_version:
http_version:
recorded_at: Wed, 21 Jun 2017 10:44:52 GMT
recorded_with: VCR 2.4.0
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-upload-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=http&env=%7B%7D&key_id=1&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......@@ -41,6 +41,6 @@ http_interactions:
body:
encoding: UTF-8
string: '{"status":false,"message":"Pulling over HTTP is not allowed."}'
http_version:
http_version:
recorded_at: Wed, 21 Jun 2017 10:32:01 GMT
recorded_with: VCR 2.4.0
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=http&env=%7B%7D&key_id=1&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......@@ -41,6 +41,6 @@ http_interactions:
body:
encoding: UTF-8
string: '{"status":false,"message":"Pushing over HTTP is not allowed."}'
http_version:
http_version:
recorded_at: Wed, 21 Jun 2017 10:32:01 GMT
recorded_with: VCR 2.4.0
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-upload-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=1&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......@@ -41,6 +41,6 @@ http_interactions:
body:
encoding: UTF-8
string: '{"status":false,"message":"Git access over SSH is not allowed"}'
http_version:
http_version:
recorded_at: Wed, 21 Jun 2017 12:23:57 GMT
recorded_with: VCR 2.4.0
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-upload-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=2&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-upload-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=2&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-upload-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=2&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-upload-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&user_id=2&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......@@ -41,6 +41,6 @@ http_interactions:
body:
encoding: UTF-8
string: '{"status":false,"message":"Git access over SSH is not allowed"}'
http_version:
http_version:
recorded_at: Wed, 21 Jun 2017 12:24:05 GMT
recorded_with: VCR 2.4.0
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-upload-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=2&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......@@ -41,6 +41,6 @@ http_interactions:
body:
encoding: UTF-8
string: '{"status":false,"message":"Git access over SSH is not allowed"}'
http_version:
http_version:
recorded_at: Wed, 21 Jun 2017 12:24:04 GMT
recorded_with: VCR 2.4.0
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=1&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......@@ -41,6 +41,6 @@ http_interactions:
body:
encoding: UTF-8
string: '{"status":false,"message":"Git access over SSH is not allowed"}'
http_version:
http_version:
recorded_at: Wed, 21 Jun 2017 12:23:57 GMT
recorded_with: VCR 2.4.0
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=2&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=2&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=2&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......
......@@ -2,7 +2,7 @@
http_interactions:
- request:
method: post
uri: http://localhost:3000/api/v4/internal/allowed
uri: http://localhost:3000/api/v4/internal/allowed/secure
body:
encoding: US-ASCII
string: action=git-receive-pack&changes=0000000000000000000000000000000000000000+92d0970eefd7acb6d548878925ce2208cfe2d2ec+refs%2Fheads%2Fbranch4&gl_repository&project=gitlab-org%2Fgitlab-test.git&protocol=ssh&env=%7B%7D&key_id=2&secret_token=0a3938d9d95d807e94d937af3a4fbbea%0A
......@@ -41,6 +41,6 @@ http_interactions:
body:
encoding: UTF-8
string: '{"status":false,"message":"Git access over SSH is not allowed"}'
http_version:
http_version:
recorded_at: Wed, 21 Jun 2017 12:24:04 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