mirror of
				https://github.com/TeaOSLab/EdgeCommon.git
				synced 2025-11-04 05:00:24 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			169 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
			
		
		
	
	
			169 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
syntax = "proto3";
 | 
						|
option go_package = "./pb";
 | 
						|
 | 
						|
package pb;
 | 
						|
 | 
						|
import "models/rpc_messages.proto";
 | 
						|
import "models/model_ssl_cert.proto";
 | 
						|
 | 
						|
// SSL证书管理服务
 | 
						|
service SSLCertService {
 | 
						|
	// 创建Cert
 | 
						|
	rpc createSSLCert (CreateSSLCertRequest) returns (CreateSSLCertResponse);
 | 
						|
 | 
						|
	// 修改Cert
 | 
						|
	rpc updateSSLCert (UpdateSSLCertRequest) returns (RPCSuccess);
 | 
						|
 | 
						|
	// 删除Cert
 | 
						|
	rpc deleteSSLCert (DeleteSSLCertRequest) returns (RPCSuccess);
 | 
						|
 | 
						|
	// 查找证书配置
 | 
						|
	rpc findEnabledSSLCertConfig (FindEnabledSSLCertConfigRequest) returns (FindEnabledSSLCertConfigResponse);
 | 
						|
 | 
						|
	// 计算匹配的Cert数量
 | 
						|
	rpc countSSLCerts (CountSSLCertRequest) returns (RPCCountResponse);
 | 
						|
 | 
						|
	// 列出单页匹配的Cert
 | 
						|
	rpc listSSLCerts (ListSSLCertsRequest) returns (ListSSLCertsResponse);
 | 
						|
 | 
						|
	// 计算有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);
 | 
						|
 | 
						|
	// 读取证书的OCSP
 | 
						|
	rpc listUpdatedSSLCertOCSP(ListUpdatedSSLCertOCSPRequest) returns (ListUpdatedSSLCertOCSPResponse);
 | 
						|
}
 | 
						|
 | 
						|
// 创建Cert
 | 
						|
message CreateSSLCertRequest {
 | 
						|
	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 CreateSSLCertResponse {
 | 
						|
	int64 sslCertId = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 修改Cert
 | 
						|
message UpdateSSLCertRequest {
 | 
						|
	int64 sslCertId = 1;
 | 
						|
	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 {
 | 
						|
	int64 sslCertId = 1;
 | 
						|
}
 | 
						|
 | 
						|
message FindEnabledSSLCertConfigResponse {
 | 
						|
	bytes sslCertJSON = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 删除证书
 | 
						|
message DeleteSSLCertRequest {
 | 
						|
	int64 sslCertId = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 计算匹配的Cert数量
 | 
						|
message CountSSLCertRequest {
 | 
						|
	bool isCA = 1;
 | 
						|
	bool isAvailable = 2;
 | 
						|
	bool isExpired = 3;
 | 
						|
	int32 expiringDays = 4;
 | 
						|
	string keyword = 5;
 | 
						|
	int64 userId = 6;
 | 
						|
}
 | 
						|
 | 
						|
// 列出单页匹配的Cert
 | 
						|
message ListSSLCertsRequest {
 | 
						|
	bool isCA = 1;
 | 
						|
	bool isAvailable = 2;
 | 
						|
	bool isExpired = 3;
 | 
						|
	int32 expiringDays = 4;
 | 
						|
	string keyword = 5;
 | 
						|
	int64 offset = 6;
 | 
						|
	int64 size = 7;
 | 
						|
	int64 userId = 8;
 | 
						|
}
 | 
						|
 | 
						|
message ListSSLCertsResponse {
 | 
						|
	bytes sslCertsJSON = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 计算有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 {
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
// 读取证书的OCSP
 | 
						|
message ListUpdatedSSLCertOCSPRequest {
 | 
						|
	int64 version = 1;
 | 
						|
	int32 size = 2;
 | 
						|
}
 | 
						|
 | 
						|
message ListUpdatedSSLCertOCSPResponse {
 | 
						|
	repeated SSLCertOCSP sslCertOCSP = 1;
 | 
						|
 | 
						|
	message SSLCertOCSP {
 | 
						|
		int64 sslCertId = 1;
 | 
						|
		bytes data = 2;
 | 
						|
		int64 version = 3;
 | 
						|
		int64 expiresAt = 4;
 | 
						|
	}
 | 
						|
} |