drone/gitrpc/proto/http.proto
Enver Bisevac 578dd13d8d [maint] eb/gitrpc refactor (#51)
* pull/push impl done

* Basic auth for harness

* gitrpc as top level package

* New ctor for package

* gitrpcserver instead of server2
2022-11-03 13:17:03 +01:00

56 lines
1.7 KiB
Protocol Buffer

syntax = "proto3";
package rpc;
option go_package = "github.com/harness/gitness/gitrpc/rpc";
// SmartHTTPService is a service that provides RPCs required for HTTP-based Git
// clones via the smart HTTP protocol.
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 InfoRefs(InfoRefsRequest) returns (stream InfoRefsResponse) {}
// ServicePack is just upload-pack or receive-pack
rpc ServicePack(stream ServicePackRequest) returns (stream ServicePackResponse) {}
}
message InfoRefsRequest {
string repo_uid = 1;
// Service can be: upload-pack or receive-pack
string service = 2;
// Parameters to use with git -c (key=value pairs)
repeated string git_config_options = 3;
// Git protocol version
string git_protocol = 4;
}
message InfoRefsResponse {
bytes data = 1;
}
message ServicePackRequest {
// repository should only be present only in the first message of the stream
string repo_uid = 1;
// Service can be: upload-pack or receive-pack
string service = 2;
// Raw data to be copied to stdin of 'git upload-pack'
bytes data = 3;
// Parameters to use with git -c (key=value pairs)
repeated string git_config_options = 4;
// Git protocol version
string git_protocol = 5;
// user_id become env variable, used by the Git {pre,post}-receive
// hooks. They should only be present in the first message of the stream.
string principal_id = 6;
}
message ServicePackResponse {
// Raw data from stdout of 'git upload-pack'
bytes data = 1;
}