1syntax = "proto3"; 2 3package gitaly; 4 5option go_package = "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb"; 6 7import "lint.proto"; 8import "shared.proto"; 9 10service SmartHTTPService { 11 // The response body for GET /info/refs?service=git-upload-pack 12 // Will be invoked when the user executes a `git fetch`, meaning the server 13 // will upload the packs to that user. The user doesn't upload new objects. 14 rpc InfoRefsUploadPack(InfoRefsRequest) returns (stream InfoRefsResponse) { 15 option (op_type) = { 16 op: ACCESSOR 17 }; 18 } 19 20 // The response body for GET /info/refs?service=git-receive-pack 21 // Will be invoked when the user executes a `git push`, but only advertises 22 // references to the user. 23 rpc InfoRefsReceivePack(InfoRefsRequest) returns (stream InfoRefsResponse) { 24 option (op_type) = { 25 op: ACCESSOR 26 }; 27 } 28 29 // Request and response body for POST /upload-pack 30 rpc PostUploadPack(stream PostUploadPackRequest) returns (stream PostUploadPackResponse) { 31 option (op_type) = { 32 op: ACCESSOR 33 }; 34 } 35 36 // Request and response body for POST /upload-pack using sidechannel protocol 37 rpc PostUploadPackWithSidechannel(PostUploadPackWithSidechannelRequest) returns (PostUploadPackWithSidechannelResponse) { 38 option (op_type) = { 39 op: ACCESSOR 40 }; 41 } 42 43 // Request and response body for POST /receive-pack 44 rpc PostReceivePack(stream PostReceivePackRequest) returns (stream PostReceivePackResponse) { 45 option (op_type) = { 46 op: MUTATOR 47 }; 48 } 49} 50 51message InfoRefsRequest { 52 Repository repository = 1 [(target_repository)=true]; 53 // Parameters to use with git -c (key=value pairs) 54 repeated string git_config_options = 2; 55 56 // Git protocol version 57 string git_protocol = 3; 58} 59 60message InfoRefsResponse { 61 bytes data = 1; 62} 63 64message PostUploadPackRequest { 65 // repository should only be present in the first message of the stream 66 Repository repository = 1 [(target_repository)=true]; 67 // Raw data to be copied to stdin of 'git upload-pack' 68 bytes data = 2; 69 // Parameters to use with git -c (key=value pairs) 70 repeated string git_config_options = 3; 71 72 // Git protocol version 73 string git_protocol = 4; 74} 75 76message PostUploadPackResponse { 77 // Raw data from stdout of 'git upload-pack' 78 bytes data = 1; 79} 80 81message PostUploadPackWithSidechannelRequest { 82 // repository should only be present in the first message of the stream 83 Repository repository = 1 [(target_repository)=true]; 84 // Parameters to use with git -c (key=value pairs) 85 repeated string git_config_options = 2; 86 // Git protocol version 87 string git_protocol = 3; 88} 89 90message PostUploadPackWithSidechannelResponse { } 91 92message PostReceivePackRequest { 93 // repository should only be present in the first message of the stream 94 Repository repository = 1 [(target_repository)=true]; 95 // Raw data to be copied to stdin of 'git receive-pack' 96 bytes data = 2; 97 // gl_id, gl_repository, and gl_username become env variables, used by the Git {pre,post}-receive 98 // hooks. They should only be present in the first message of the stream. 99 string gl_id = 3; 100 string gl_repository = 4; 101 string gl_username = 5; 102 // Git protocol version 103 string git_protocol = 6; 104 105 // Parameters to use with git -c (key=value pairs) 106 repeated string git_config_options = 7; 107} 108 109message PostReceivePackResponse { 110 // Raw data from stdout of 'git receive-pack' 111 bytes data = 1; 112} 113