blob: 728016b053d48a08dcd897006f9a37622f668359 [file] [log] [blame]
syntax = 'proto3';
package chromite.api;
import "build_api.proto";
// Messages used to test build_api message and service handling.
// Simple input message.
message TestRequestMessage {
string id = 1;
}
// Simple output message.
message TestResultMessage {
string result = 1;
}
// The test service.
service TestApiService {
// Mocking the method returns means we don't have an implementation of this
// module, but we do require it.
option (service_options) = {
module: "build_api_test",
};
// Method that has input and output messages.
rpc InputOutputMethod(TestRequestMessage) returns (TestResultMessage);
// Method name override.
rpc RenamedMethod(TestRequestMessage) returns (TestResultMessage) {
option (method_options) = {
implementation_name: 'CorrectName'
};
}
}
// Inside chroot service.
service InsideChrootApiService {
// Mocking the method returns means we don't have an implementation of this
// module, but we do require it.
option (service_options) = {
module: "build_api_test",
service_chroot_assert: INSIDE,
};
// No override of service level inside assertion.
rpc InsideServiceInsideMethod(TestRequestMessage) returns (TestResultMessage);
// Override service level inside assertion with outside assertion.
rpc InsideServiceOutsideMethod(TestRequestMessage)
returns (TestResultMessage) {
option (method_options) = {
method_chroot_assert: OUTSIDE,
};
}
}
// Outside chroot service.
service OutsideChrootApiService {
// Mocking the method returns means we don't have an implementation of this
// module, but we do require it.
option (service_options) = {
module: "build_api_test",
service_chroot_assert: OUTSIDE,
};
// No override of service level outside assertion.
rpc OutsideServiceOutsideMethod(TestRequestMessage)
returns (TestResultMessage);
// Override service level outside assertion with inside assertion.
rpc OutsideServiceInsideMethod(TestRequestMessage)
returns (TestResultMessage) {
option (method_options) = {
method_chroot_assert: INSIDE,
};
}
}