File: smarthttp.proto

package info (click to toggle)
golang-gitaly-proto 1.37.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 372 kB
  • sloc: ruby: 216; makefile: 93
file content (91 lines) | stat: -rw-r--r-- 2,733 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
syntax = "proto3";

package gitaly;

option go_package = "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb";

import "shared.proto";

service SmartHTTPService {
  // The response body for GET /info/refs?service=git-upload-pack
  // Will be invoked when the user executes a `git fetch`, meaning the server
  // will upload the packs to that user. The user doesn't upload new objects.
  rpc InfoRefsUploadPack(InfoRefsRequest) returns (stream InfoRefsResponse) {
    option (op_type).op = ACCESSOR;
  }

  // The response body for GET /info/refs?service=git-receive-pack
  // Will be invoked when the user executes a `git push`, meaning the server
  // will receive new objects in the pack from the user.
  rpc InfoRefsReceivePack(InfoRefsRequest) returns (stream InfoRefsResponse) {
    option (op_type) = {
      op: MUTATOR
      target_repository_field: "1"
    };
  }

  // Request and response body for POST /upload-pack
  rpc PostUploadPack(stream PostUploadPackRequest) returns (stream PostUploadPackResponse) {
    option (op_type).op = ACCESSOR;
  }

  // Request and response body for POST /receive-pack
  rpc PostReceivePack(stream PostReceivePackRequest) returns (stream PostReceivePackResponse) {
    option (op_type) = {
      op: MUTATOR
      target_repository_field: "1"
    };
  }
}

message InfoRefsRequest {
  Repository repository = 1;
  // Parameters to use with git -c (key=value pairs)
  repeated string git_config_options = 2;

  // Git protocol version
  string git_protocol = 3;
}

message InfoRefsResponse {
  bytes data = 1;
}

message PostUploadPackRequest {
  // repository should only be present in the first message of the stream
  Repository repository = 1;
  // Raw data to be copied to stdin of 'git upload-pack'
  bytes data = 2;
  // Parameters to use with git -c (key=value pairs)
  repeated string git_config_options = 3;

  // Git protocol version
  string git_protocol = 4;
}

message PostUploadPackResponse {
  // Raw data from stdout of 'git upload-pack'
  bytes data = 1;
}

message PostReceivePackRequest {
  // repository should only be present in the first message of the stream
  Repository repository = 1;
  // Raw data to be copied to stdin of 'git receive-pack'
  bytes data = 2;
  // gl_id, gl_repository, and gl_username become env variables, used by the Git {pre,post}-receive
  // hooks. They should only be present in the first message of the stream.
  string gl_id = 3;
  string gl_repository = 4;
  string gl_username = 5;
  // Git protocol version
  string git_protocol = 6;

  // Parameters to use with git -c (key=value pairs)
  repeated string git_config_options = 7;
}

message PostReceivePackResponse {
  // Raw data from stdout of 'git receive-pack'
  bytes data = 1;
}