Files
paralus/proto/rpc/sentry/bootstrap.proto
Abhijit Mukherjee 6b8cc3163d docs: added api keys as headers for all grpc messages (#163)
* added api keys as headers for all grpc messages

Signed-off-by: mabhi <abhijit.mukherjee@infracloud.io>

* changes to have multiple api keys for auth in partner swagger docs

Signed-off-by: niravparikh05 <nir.parikh05@gmail.com>

---------

Signed-off-by: mabhi <abhijit.mukherjee@infracloud.io>
Signed-off-by: niravparikh05 <nir.parikh05@gmail.com>
Co-authored-by: niravparikh05 <nir.parikh05@gmail.com>
2023-03-30 15:20:58 +05:30

198 lines
5.4 KiB
Protocol Buffer

syntax = "proto3";
package paralus.dev.sentry.rpc;
import "google/api/annotations.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "proto/types/commonpb/v3/common.proto";
import "proto/types/sentry/sentry.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info : {
title : "Sentry Bootstrap Service"
version : "2.0"
contact : {name : "Paralus Dev"}
}
schemes : HTTPS
consumes : "application/json"
consumes : "application/yaml"
produces : "application/json"
produces : "application/yaml"
security_definitions : {
security : {
key : "BasicAuth"
value : {type : TYPE_BASIC}
}
security : {
key : "ApiKeyAuth"
value : {type : TYPE_API_KEY in : IN_HEADER name : "X-API-KEYID"}
}
security : {
key : "ApiTokenAuth"
value : {
type : TYPE_API_KEY in : IN_HEADER name : "X-API-TOKEN"
}
}
}
security : {
security_requirement : {
key : "BasicAuth"
value : {}
}
security_requirement : {
key : "ApiKeyAuth"
value : {}
}
security_requirement : {
key : "ApiTokenAuth"
value : {}
}
}
responses : {
key : "403"
value : {
description : "Returned when the user does not have permission to access "
"the resource."
}
}
responses : {
key : "404"
value : {description : "Returned when the resource does not exist."}
}
responses : {
key : "500"
value : {description : "Returned for internal server error"}
}
};
message RegisterAgentRequest {
string templateToken = 1;
string templateName = 2;
string token = 3;
bytes csr = 4;
string ipAddress = 5;
string name = 6;
string fingerprint = 7;
}
message RegisterAgentResponse {
bytes certificate = 1;
bytes caCertificate = 2;
}
message GetBootstrapAgentsRequest {
paralus.dev.types.common.v3.QueryOptions opts = 1;
string templateScope = 2;
}
message DeleteBootstrapAgentResponse {}
message DeleteRelayNetworkResponse {}
message GetRelayNetworksRequest {
paralus.dev.types.common.v3.QueryOptions opts = 1;
}
message RelayAgentDownloadRequest {
paralus.dev.types.common.v3.Metadata metadata = 1
[ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
title : "Metadata",
description : "Metadata of the resource"
}];
string clusterScope = 2;
}
service BootstrapService {
rpc PatchBootstrapInfra(paralus.dev.types.sentry.BootstrapInfra)
returns (paralus.dev.types.sentry.BootstrapInfra) {
option (google.api.http) = {
put : "/v2/sentry/bootstrap/infra/{metadata.name}"
body : "*"
};
}
rpc GetBootstrapInfra(paralus.dev.types.sentry.BootstrapInfra)
returns (paralus.dev.types.sentry.BootstrapInfra) {
option (google.api.http) = {
get : "/v2/sentry/bootstrap/infra/{metadata.name}"
};
}
rpc PatchBootstrapAgentTemplate(
paralus.dev.types.sentry.BootstrapAgentTemplate)
returns (paralus.dev.types.sentry.BootstrapAgentTemplate) {
option (google.api.http) = {
put : "/v2/sentry/bootstrap/template/{metadata.name}"
body : "*"
};
}
rpc GetBootstrapAgentTemplate(
paralus.dev.types.sentry.BootstrapAgentTemplate)
returns (paralus.dev.types.sentry.BootstrapAgentTemplate) {
option (google.api.http) = {
get : "/v2/sentry/bootstrap/template/{metadata.name}"
};
}
rpc GetBootstrapAgentTemplates(paralus.dev.types.common.v3.QueryOptions)
returns (paralus.dev.types.sentry.BootstrapAgentTemplateList) {
option (google.api.http) = {
get : "/v2/sentry/bootstrap/template"
};
}
rpc RegisterBootstrapAgent(RegisterAgentRequest)
returns (RegisterAgentResponse) {
option (google.api.http) = {
post : "/v2/sentry/bootstrap/{templateToken=template/*}/register"
body : "*"
};
}
rpc GetBootstrapAgentConfig(paralus.dev.types.sentry.BootstrapAgent)
returns (paralus.dev.types.common.v3.HttpBody) {
option (google.api.http) = {
get : "/v2/sentry/bootstrap/{spec.templateRef=template/*}/agent/"
"{metadata.name}/config"
};
}
rpc CreateBootstrapAgent(paralus.dev.types.sentry.BootstrapAgent)
returns (paralus.dev.types.sentry.BootstrapAgent) {
option (google.api.http) = {
post : "/v2/sentry/bootstrap/{spec.templateRef=template/*}/agent"
body : "*"
};
}
rpc GetBootstrapAgent(paralus.dev.types.sentry.BootstrapAgent)
returns (paralus.dev.types.sentry.BootstrapAgent) {
option (google.api.http) = {
get : "/v2/sentry/bootstrap/{spec.templateRef=template/*}/agent/"
"{metadata.name}"
};
}
rpc GetBootstrapAgents(GetBootstrapAgentsRequest)
returns (paralus.dev.types.sentry.BootstrapAgentList) {
option (google.api.http) = {
get : "/v2/sentry/bootstrap/{templateScope=template/*}/agent"
};
}
rpc DeleteBootstrapAgent(paralus.dev.types.sentry.BootstrapAgent)
returns (DeleteBootstrapAgentResponse) {
option (google.api.http) = {
delete : "/v2/sentry/bootstrap/{spec.templateRef=template/*}/agent/"
"{metadata.name}"
};
}
rpc UpdateBootstrapAgent(paralus.dev.types.sentry.BootstrapAgent)
returns (paralus.dev.types.sentry.BootstrapAgent) {
option (google.api.http) = {
put : "/v2/sentry/bootstrap/{spec.templateRef=template/*}/agent/"
"{metadata.name}"
body : "*"
};
}
}