Files
EdgeCommon/pkg/rpc/protos/service_ssl_cert.proto

199 lines
4.9 KiB
Protocol Buffer
Raw Normal View History

2020-09-30 17:46:33 +08:00
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/rpc_messages.proto";
2022-03-11 20:27:57 +08:00
import "models/model_ssl_cert.proto";
2020-09-30 17:46:33 +08:00
// SSL证书管理服务
2020-09-30 17:46:33 +08:00
service SSLCertService {
2023-03-24 19:07:04 +08:00
// 创建证书
2020-09-30 17:46:33 +08:00
rpc createSSLCert (CreateSSLCertRequest) returns (CreateSSLCertResponse);
2023-03-24 19:07:04 +08:00
// 创建一组证书
rpc createSSLCerts(CreateSSLCertsRequest) returns (CreateSSLCertsResponse);
// 修改证书
rpc updateSSLCert (UpdateSSLCertRequest) returns (RPCSuccess);
2020-09-30 17:46:33 +08:00
2023-03-24 19:07:04 +08:00
// 删除证书
rpc deleteSSLCert (DeleteSSLCertRequest) returns (RPCSuccess);
2020-09-30 17:46:33 +08:00
// 查找证书配置
rpc findEnabledSSLCertConfig (FindEnabledSSLCertConfigRequest) returns (FindEnabledSSLCertConfigResponse);
2023-03-24 19:07:04 +08:00
// 计算匹配的证书数量
2020-11-12 14:41:23 +08:00
rpc countSSLCerts (CountSSLCertRequest) returns (RPCCountResponse);
2020-09-30 17:46:33 +08:00
2023-03-24 19:07:04 +08:00
// 列出单页匹配的证书
2020-09-30 17:46:33 +08:00
rpc listSSLCerts (ListSSLCertsRequest) returns (ListSSLCertsResponse);
2022-03-11 20:27:57 +08:00
// 计算有OCSP错误的证书数量
rpc countAllSSLCertsWithOCSPError (CountAllSSLCertsWithOCSPErrorRequest) returns (RPCCountResponse);
// 列出有OCSP错误的证书
rpc listSSLCertsWithOCSPError (ListSSLCertsWithOCSPErrorRequest) returns (ListSSLCertsWithOCSPErrorResponse);
// 忽略一组OCSP证书错误
rpc ignoreSSLCertsWithOCSPError (IgnoreSSLCertsWithOCSPErrorRequest) returns (RPCSuccess);
// 重置一组证书OCSP错误状态
rpc resetSSLCertsWithOCSPError (ResetSSLCertsWithOCSPErrorRequest) returns (RPCSuccess);
// 重置所有证书OCSP错误状态
rpc resetAllSSLCertsWithOCSPError (ResetAllSSLCertsWithOCSPErrorRequest) returns (RPCSuccess);
2022-03-18 17:04:53 +08:00
// 读取证书的OCSP
rpc listUpdatedSSLCertOCSP(ListUpdatedSSLCertOCSPRequest) returns (ListUpdatedSSLCertOCSPResponse);
2020-09-30 17:46:33 +08:00
}
2023-03-24 19:07:04 +08:00
// 创建证书
2020-09-30 17:46:33 +08:00
message CreateSSLCertRequest {
bool isOn = 1;
int64 userId = 12; // 所属用户,仅管理员才能指定
2020-09-30 17:46:33 +08:00
string name = 2;
string description = 3;
string serverName = 4;
bool isCA = 5;
bytes certData = 6;
bytes keyData = 7;
int64 timeBeginAt = 8;
int64 timeEndAt = 9;
repeated string dnsNames = 10;
repeated string commonNames = 11;
}
message CreateSSLCertResponse {
2020-12-18 21:19:25 +08:00
int64 sslCertId = 1;
2020-09-30 17:46:33 +08:00
}
2023-03-24 19:07:04 +08:00
// 创建一组证书
message CreateSSLCertsRequest {
repeated cert SSLCerts = 1; // 证书信息
int64 userId = 2; // 用户ID
message cert {
bool isOn = 1;
string name = 2;
string description = 3;
string serverName = 4;
bool isCA = 5;
bytes certData = 6;
bytes keyData = 7;
int64 timeBeginAt = 8;
int64 timeEndAt = 9;
repeated string dnsNames = 10;
repeated string commonNames = 11;
}
}
message CreateSSLCertsResponse {
repeated int64 sslCertIds = 1;
}
// 修改证书
2020-09-30 17:46:33 +08:00
message UpdateSSLCertRequest {
2020-12-18 21:19:25 +08:00
int64 sslCertId = 1;
2020-09-30 17:46:33 +08:00
bool isOn = 2;
string name = 3;
string description = 4;
string serverName = 5;
bool isCA = 6;
bytes certData = 7;
bytes keyData = 8;
int64 timeBeginAt = 9;
int64 timeEndAt = 10;
repeated string dnsNames = 11;
repeated string commonNames = 12;
}
// 查找证书配置
message FindEnabledSSLCertConfigRequest {
2020-12-18 21:19:25 +08:00
int64 sslCertId = 1;
2020-09-30 17:46:33 +08:00
}
message FindEnabledSSLCertConfigResponse {
2020-12-18 21:19:25 +08:00
bytes sslCertJSON = 1;
2020-09-30 17:46:33 +08:00
}
// 删除证书
message DeleteSSLCertRequest {
2020-12-18 21:19:25 +08:00
int64 sslCertId = 1;
2020-09-30 17:46:33 +08:00
}
2023-03-24 19:07:04 +08:00
// 计算匹配的证书数量
2020-09-30 17:46:33 +08:00
message CountSSLCertRequest {
2023-03-24 19:07:04 +08:00
bool isCA = 1; // 是否为CA证书
bool isAvailable = 2; // 是否可用(在有效期内)
bool isExpired = 3; // 是否已过期
int32 expiringDays = 4; // 离过期日的天数
string keyword = 5; // 关键词
int64 userId = 6; // 用户ID
repeated string domains = 7; // 搜索使用的域名列表
2020-09-30 17:46:33 +08:00
}
2023-03-24 19:07:04 +08:00
// 列出单页匹配的证书
2020-09-30 17:46:33 +08:00
message ListSSLCertsRequest {
2023-03-24 19:07:04 +08:00
bool isCA = 1; // 是否为CA证书
bool isAvailable = 2; // 是否可用(在有效期内)
bool isExpired = 3; // 是否已过期
int32 expiringDays = 4; // 离过期日的天数
string keyword = 5; // 关键词
int64 userId = 8; // 用户ID
repeated string domains = 9; // 搜索使用的域名列表
int64 offset = 6; // 读取位置
int64 size = 7; // 读取长度
2020-09-30 17:46:33 +08:00
}
message ListSSLCertsResponse {
2020-12-18 21:19:25 +08:00
bytes sslCertsJSON = 1;
2020-11-24 17:36:51 +08:00
}
2022-03-11 20:27:57 +08:00
// 计算有OCSP错误的证书数量
message CountAllSSLCertsWithOCSPErrorRequest {
string keyword = 1;
}
// 列出有OCSP错误的证书
message ListSSLCertsWithOCSPErrorRequest {
string keyword = 1;
int64 offset = 2;
int64 size = 3;
}
message ListSSLCertsWithOCSPErrorResponse {
repeated SSLCert sslCerts = 1;
}
// 忽略一组OCSP证书错误
message IgnoreSSLCertsWithOCSPErrorRequest {
repeated int64 sslCertIds = 1;
}
// 重置一组证书OCSP错误状态
message ResetSSLCertsWithOCSPErrorRequest {
repeated int64 sslCertIds = 1;
}
// 重置所有证书OCSP错误状态
message ResetAllSSLCertsWithOCSPErrorRequest {
2022-03-18 17:04:53 +08:00
}
// 读取证书的OCSP
message ListUpdatedSSLCertOCSPRequest {
int64 version = 1;
int32 size = 2;
}
message ListUpdatedSSLCertOCSPResponse {
repeated SSLCertOCSP sslCertOCSP = 1;
message SSLCertOCSP {
int64 sslCertId = 1;
2022-03-18 20:20:28 +08:00
bytes data = 2;
2022-03-18 17:04:53 +08:00
int64 version = 3;
2022-03-18 20:20:28 +08:00
int64 expiresAt = 4;
2022-03-18 17:04:53 +08:00
}
2022-03-11 20:27:57 +08:00
}