DNS支持TSIG

This commit is contained in:
刘祥超
2021-07-25 15:08:38 +08:00
parent f1da942189
commit 32d542aa6c
13 changed files with 907 additions and 149 deletions

View File

@@ -20,4 +20,5 @@ message NSAccessLog {
int64 timestamp = 13;
string requestId = 14;
string timeLocal = 15;
string error = 16;
}

View File

@@ -14,6 +14,7 @@ message NSDomain {
int64 createdAt = 4;
bool isDeleted = 5;
int64 version = 6;
bytes tsigJSON = 7;
NSCluster nsCluster = 30;
User user = 31;

View File

@@ -3,12 +3,20 @@ option go_package = "./pb";
package pb;
import "models/model_ns_domain.proto";
import "models/model_ns_zone.proto";
// NS密钥
message NSKey {
int64 id =1;
int64 id = 1;
bool isOn = 2;
string name = 3;
string algo = 4;
string secret = 5;
string secretType = 6;
bool isDeleted = 7;
int64 version = 8;
NSDomain nsDomain = 30;
NSZone nsZone = 31;
}

View File

@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// DNS子域
message NSZone {
int64 id = 1;
}

View File

@@ -28,6 +28,12 @@ service NSDomainService {
// 根据版本列出一组域名
rpc listNSDomainsAfterVersion (ListNSDomainsAfterVersionRequest) returns (ListNSDomainsAfterVersionResponse);
// 查找TSIG配置
rpc findEnabledNSDomainTSIG (FindEnabledNSDomainTSIGRequest) returns (FindEnabledNSDomainTSIGResponse);
// 修改TSIG配置
rpc updateNSDomainTSIG (UpdateNSDomainTSIGRequest) returns (RPCSuccess);
}
// 创建域名
@@ -92,4 +98,19 @@ message ListNSDomainsAfterVersionRequest {
message ListNSDomainsAfterVersionResponse {
repeated NSDomain nsDomains = 1;
}
// 查找TSIG配置
message FindEnabledNSDomainTSIGRequest {
int64 nsDomainId = 1;
}
message FindEnabledNSDomainTSIGResponse {
bytes tsigJSON = 1;
}
// 修改TSIG配置
message UpdateNSDomainTSIGRequest {
int64 nsDomainId = 1;
bytes tsigJSON = 2;
}

View File

@@ -25,6 +25,9 @@ service NSKeyService {
// 列出单页密钥
rpc listEnabledNSKeys (ListEnabledNSKeysRequest) returns (ListEnabledNSKeysResponse);
// 根据版本列出一组密钥
rpc listNSKeysAfterVersion (ListNSKeysAfterVersionRequest) returns (ListNSKeysAfterVersionResponse);
}
// 创建密钥
@@ -81,4 +84,14 @@ message ListEnabledNSKeysRequest {
message ListEnabledNSKeysResponse {
repeated NSKey nsKeys = 1;
}
// 根据版本列出一组密钥
message ListNSKeysAfterVersionRequest {
int64 version = 1;
int64 size = 2;
}
message ListNSKeysAfterVersionResponse {
repeated NSKey nsKeys = 1;
}