As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit 1ba172d4 authored by Małgorzata Ksionek's avatar Małgorzata Ksionek
Browse files

Update methods to use new path

parent 650ecad9
No related branches found
No related tags found
No related merge requests found
Showing
with 25 additions and 25 deletions
Loading
Loading
@@ -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()
Loading
Loading
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -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
}
Loading
Loading
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -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,
Loading
Loading
@@ -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,
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -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']
Loading
Loading
Loading
Loading
@@ -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']
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment