mirror of
https://github.com/hanzozt/zt.git
synced 2026-10-30 15:04:55 +00:00
- Repo names: ziti-* → zt-* - Go modules: github.com/hanzozt/ziti → github.com/hanzozt/zt - Docker images: hanzozt/ziti-* → hanzozt/zt-* - C/Java/JS symbols: ziti_* → zt_* - File and directory names updated
616 lines
13 KiB
Protocol Buffer
616 lines
13 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package zt.edge_ctrl.pb;
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
option go_package = "github.com/hanzozt/zt/common/pb/edge_ctrl_pb";
|
|
|
|
enum ContentType {
|
|
Zero = 0;
|
|
ServerHelloType = 20000;
|
|
ClientHelloType = 20001;
|
|
ErrorType = 20002;
|
|
// SessionAddedType = 20100;
|
|
// SessionUpdatedType = 20101;
|
|
SessionRemovedType = 20102;
|
|
ApiSessionAddedType = 20200;
|
|
ApiSessionUpdatedType = 20201;
|
|
ApiSessionRemovedType = 20202;
|
|
ApiSessionHeartbeatType = 20203;
|
|
RequestClientReSyncType = 20204;
|
|
CreateCircuitRequestType = 20205;
|
|
CreateCircuitResponseType = 20206;
|
|
|
|
// deprecated, left for historical/debugging purposes
|
|
// CreateTerminatorRequestType = 20207;
|
|
// CreateTerminatorResponseType = 20208;
|
|
|
|
UpdateTerminatorRequestType = 20209;
|
|
UpdateTerminatorResponseType = 20210;
|
|
RemoveTerminatorRequestType = 20211;
|
|
RemoveTerminatorResponseType = 20212;
|
|
ValidateSessionsRequestType = 20213;
|
|
HealthEventType = 20214;
|
|
CreateTerminatorV2RequestType = 20216;
|
|
CreateTerminatorV2ResponseType = 20217;
|
|
CreateCircuitV2RequestType = 20218;
|
|
CreateCircuitV2ResponseType = 20219;
|
|
CreateTunnelCircuitV2RequestType = 20220;
|
|
CreateTunnelCircuitV2ResponseType = 20221;
|
|
|
|
EnrollType = 20300;
|
|
EnrollmentCertsResponseType = 20301;
|
|
EnrollmentExtendRouterRequestType = 20302;
|
|
EnrollmentExtendRouterVerifyRequestType = 20303;
|
|
|
|
CreateApiSessionRequestType = 20400;
|
|
CreateApiSessionResponseType = 20401;
|
|
CreateCircuitForServiceRequestType = 20402;
|
|
CreateCircuitForServiceResponseType = 20403;
|
|
ListServicesRequestType = 20404;
|
|
ServiceListType = 20405;
|
|
CreateTunnelTerminatorRequestType = 20406;
|
|
CreateTunnelTerminatorResponseType = 20407;
|
|
|
|
UpdateTunnelTerminatorRequestType = 20408;
|
|
UpdateTunnelTerminatorResponseType = 20409;
|
|
|
|
RemoveTunnelTerminatorRequestType = 20410;
|
|
RemoveTunnelTerminatorResponseType = 20411;
|
|
|
|
TunnelHealthEventType = 20412;
|
|
|
|
CreateTunnelTerminatorRequestV2Type = 20413;
|
|
CreateTunnelTerminatorResponseV2Type = 20414;
|
|
ConnectEventsTypes = 20415;
|
|
|
|
DataStateType = 20500;
|
|
DataStateChangeSetType = 20501;
|
|
UpdateTokenType = 20502;
|
|
ValidateDataStateRequestType = 20503;
|
|
ValidateDataStateResponseType = 20504;
|
|
|
|
SubscribeToDataModelRequestType = 20505;
|
|
CurrentIndexMessageType = 20506;
|
|
}
|
|
|
|
enum SessionType {
|
|
Dial = 0;
|
|
Bind = 1;
|
|
}
|
|
|
|
enum Header {
|
|
HeaderZero = 0;
|
|
TerminatorId = 1022;
|
|
CheckPassed = 1023;
|
|
RouterDataModel = 1024;
|
|
RouterDataModelIndex = 1025;
|
|
RouterDataModelSubscriptionId = 1026;
|
|
}
|
|
|
|
enum CacheType {
|
|
TerminatorIds = 0;
|
|
}
|
|
|
|
message ServerHello {
|
|
string version = 1;
|
|
map<string, string> data = 2;
|
|
map<string, bytes> byteData = 3;
|
|
}
|
|
|
|
message Address {
|
|
string value = 10;
|
|
string protocol = 20;
|
|
string hostname = 30;
|
|
int32 port = 40;
|
|
}
|
|
|
|
message Listener {
|
|
Address address = 10;
|
|
Address advertise = 20;
|
|
}
|
|
|
|
message ClientHello {
|
|
string version = 1;
|
|
string hostname = 2;
|
|
|
|
// deprecated used listeners instead
|
|
repeated string protocols = 3;
|
|
|
|
|
|
// arbitrary data
|
|
map<string, string> data = 4;
|
|
|
|
// deprecated use listeners instead
|
|
repeated string protocolPorts = 5;
|
|
|
|
// an array of configured edge listeners
|
|
repeated Listener listeners = 10;
|
|
}
|
|
|
|
message Error {
|
|
string code = 1;
|
|
string message = 2;
|
|
string cause = 3;
|
|
}
|
|
|
|
enum PolicyType {
|
|
InvalidPolicy = 0;
|
|
DialPolicy = 1;
|
|
BindPolicy = 2;
|
|
}
|
|
|
|
enum ServicePolicyRelatedEntityType {
|
|
InvalidRelatedType = 0;
|
|
RelatedService = 1;
|
|
RelatedIdentity = 2;
|
|
RelatedPostureCheck = 3;
|
|
}
|
|
|
|
message Cache {
|
|
map<string, bytes> data = 1;
|
|
}
|
|
|
|
message DataState {
|
|
repeated Event events = 1;
|
|
uint64 endIndex = 2;
|
|
string timelineId = 3;
|
|
map<string, Cache> caches = 4;
|
|
|
|
enum Action {
|
|
Create = 0;
|
|
Update = 1;
|
|
Delete = 2;
|
|
}
|
|
|
|
message ConfigType {
|
|
string id = 1;
|
|
string name = 2;
|
|
}
|
|
|
|
message Config {
|
|
string id = 1;
|
|
string typeId = 2;
|
|
string name = 3;
|
|
string dataJson = 4;
|
|
}
|
|
|
|
message ServiceConfigs {
|
|
map<string, string> configs = 1;
|
|
}
|
|
|
|
message Identity {
|
|
string id = 1;
|
|
string name = 2;
|
|
TerminatorPrecedence defaultHostingPrecedence = 3;
|
|
uint32 defaultHostingCost = 4;
|
|
map<string, TerminatorPrecedence> serviceHostingPrecedences = 5;
|
|
map<string, uint32> serviceHostingCosts = 6;
|
|
bytes appDataJson = 7;
|
|
map<string, ServiceConfigs> serviceConfigs = 8;
|
|
bool disabled = 9;
|
|
}
|
|
|
|
message Service {
|
|
string id = 1;
|
|
string name = 2;
|
|
bool encryptionRequired = 3;
|
|
repeated string configs = 4;
|
|
}
|
|
|
|
message ServicePolicy {
|
|
string id = 1;
|
|
string name = 2;
|
|
PolicyType policyType = 3;
|
|
}
|
|
|
|
message Revocation {
|
|
string id = 1;
|
|
google.protobuf.Timestamp ExpiresAt = 2;
|
|
}
|
|
|
|
message ServicePolicyChange {
|
|
string policyId = 1;
|
|
repeated string relatedEntityIds = 2;
|
|
ServicePolicyRelatedEntityType relatedEntityType = 3;
|
|
bool add = 4;
|
|
}
|
|
|
|
message ChangeSet {
|
|
uint64 index = 1;
|
|
bool isSynthetic = 2;
|
|
repeated Event changes = 3;
|
|
string timestampId = 4;
|
|
}
|
|
|
|
message Event {
|
|
Action action = 1;
|
|
//uint64 index = 2;
|
|
bool isSynthetic = 3;
|
|
|
|
oneof Model{
|
|
Identity identity = 10;
|
|
Service service = 11;
|
|
ServicePolicy servicePolicy = 12;
|
|
PostureCheck postureCheck = 13;
|
|
PublicKey publicKey = 14;
|
|
Revocation revocation = 15;
|
|
ServicePolicyChange servicePolicyChange = 16;
|
|
ConfigType configType = 17;
|
|
Config config = 18;
|
|
}
|
|
}
|
|
|
|
message PublicKey {
|
|
bytes data = 1; //public key
|
|
string kid = 2; //key id/fingerprint
|
|
repeated Usage usages = 3; // what the public key in data is used for
|
|
Format format = 4; //the format of the public key in data and chain
|
|
|
|
enum Usage {
|
|
JWTValidation = 0;
|
|
ClientX509CertValidation = 1;
|
|
}
|
|
|
|
enum Format {
|
|
X509CertDer = 0; //x509 cert
|
|
PKIXPublicKey = 1; //asn.1 public key
|
|
//JWK = 3; //JSON Web Key
|
|
}
|
|
}
|
|
|
|
message PostureCheck {
|
|
message Mac {
|
|
repeated string macAddresses = 1;
|
|
}
|
|
|
|
message Mfa {
|
|
int64 TimeoutSeconds = 1;
|
|
bool PromptOnWake = 2;
|
|
bool PromptOnUnlock = 3;
|
|
bool IgnoreLegacyEndpoints = 4;
|
|
}
|
|
|
|
message Os {
|
|
string OsType = 1;
|
|
repeated string OsVersions = 2;
|
|
}
|
|
|
|
message OsList {
|
|
repeated Os osList = 1;
|
|
}
|
|
|
|
message Process {
|
|
string OsType = 1;
|
|
string Path = 2;
|
|
repeated string Hashes = 3;
|
|
repeated string Fingerprints = 4;
|
|
}
|
|
|
|
message ProcessMulti {
|
|
string semantic = 1;
|
|
repeated Process processes = 2;
|
|
}
|
|
|
|
message Domains {
|
|
repeated string domains = 1;
|
|
}
|
|
|
|
string id = 1;
|
|
string name = 2;
|
|
string typeId = 4;
|
|
|
|
oneof subtype {
|
|
Mac mac = 7;
|
|
Mfa mfa = 8;
|
|
OsList osList = 9;
|
|
Process process = 10;
|
|
ProcessMulti processMulti = 11;
|
|
Domains domains = 12;
|
|
};
|
|
}
|
|
}
|
|
|
|
message ApiSession {
|
|
string token = 1;
|
|
repeated string certFingerprints = 2;
|
|
string id = 3;
|
|
string identityId = 4;
|
|
}
|
|
|
|
message ApiSessionAdded {
|
|
bool isFullState = 1;
|
|
repeated ApiSession apiSessions = 2;
|
|
}
|
|
|
|
message ApiSessionUpdated {
|
|
repeated ApiSession apiSessions = 1;
|
|
}
|
|
|
|
message ApiSessionRemoved {
|
|
repeated string tokens = 1;
|
|
repeated string ids = 2;
|
|
}
|
|
|
|
message ApiSessionHeartbeat {
|
|
repeated string tokens = 1;
|
|
}
|
|
|
|
message SessionRemoved {
|
|
repeated string tokens = 1;
|
|
repeated string ids = 2;
|
|
}
|
|
|
|
message RequestClientReSync {
|
|
string reason = 1;
|
|
}
|
|
|
|
message CreateCircuitRequest {
|
|
string sessionToken = 1;
|
|
repeated string fingerprints = 2;
|
|
string terminatorInstanceId = 3;
|
|
map<uint32, bytes> peerData = 4;
|
|
string apiSessionToken = 5;
|
|
}
|
|
|
|
message CreateCircuitResponse {
|
|
string circuitId = 1;
|
|
string address = 2;
|
|
map<uint32, bytes> peerData = 3;
|
|
map<string, string> tags = 4;
|
|
}
|
|
|
|
enum TerminatorPrecedence {
|
|
Default = 0;
|
|
Required = 1;
|
|
Failed = 2;
|
|
}
|
|
|
|
message CreateTerminatorV2Request {
|
|
string address = 1;
|
|
string sessionToken = 2;
|
|
repeated string fingerprints = 3;
|
|
map<uint32, bytes> peerData = 4;
|
|
uint32 cost = 5;
|
|
TerminatorPrecedence precedence = 6;
|
|
string instanceId = 7;
|
|
bytes instanceSecret = 8;
|
|
string apiSessionToken = 9;
|
|
}
|
|
|
|
enum CreateTerminatorResult {
|
|
Success = 0;
|
|
FailedIdConflict = 1;
|
|
FailedOther = 2;
|
|
FailedBusy = 3;
|
|
FailedInvalidSession = 4;
|
|
}
|
|
|
|
message CreateTerminatorV2Response {
|
|
string terminatorId = 1;
|
|
CreateTerminatorResult result = 2;
|
|
string msg = 3;
|
|
uint32 errorCode = 4;
|
|
uint32 retryHint = 5;
|
|
}
|
|
|
|
message RemoveTerminatorRequest {
|
|
string sessionToken = 1;
|
|
repeated string fingerprints = 2;
|
|
string terminatorId = 3;
|
|
string apiSessionToken = 4;
|
|
}
|
|
|
|
message UpdateTerminatorRequest {
|
|
string sessionToken = 1;
|
|
repeated string fingerprints = 2;
|
|
string terminatorId = 3;
|
|
uint32 cost = 4;
|
|
TerminatorPrecedence precedence = 5;
|
|
bool updatePrecedence = 6;
|
|
bool updateCost = 7;
|
|
string apiSessionToken = 8;
|
|
}
|
|
|
|
message HealthEventRequest {
|
|
string sessionToken = 1;
|
|
repeated string fingerprints = 2;
|
|
string terminatorId = 3;
|
|
bool checkPassed = 4;
|
|
string apiSessionToken = 5;
|
|
}
|
|
|
|
message ValidateSessionsRequest {
|
|
repeated string sessionTokens = 1;
|
|
}
|
|
|
|
message EnvInfo {
|
|
string arch = 1;
|
|
string Os = 2;
|
|
string OsRelease = 3;
|
|
string OsVersion = 4;
|
|
string Hostname = 5;
|
|
string Domain = 6;
|
|
}
|
|
|
|
message SdkInfo {
|
|
string AppId = 1;
|
|
string AppVersion = 2;
|
|
string Branch = 3;
|
|
string Revision = 4;
|
|
string Type = 5;
|
|
string Version = 6;
|
|
}
|
|
|
|
message CreateApiSessionRequest {
|
|
EnvInfo envInfo = 1;
|
|
SdkInfo sdkInfo = 2;
|
|
repeated string configTypes = 3;
|
|
}
|
|
|
|
message CreateApiSessionResponse {
|
|
string sessionId = 1;
|
|
string token = 2;
|
|
uint32 refreshIntervalSeconds = 3;
|
|
string identityId = 4;
|
|
string identityName = 5;
|
|
TerminatorPrecedence defaultHostingPrecedence = 6;
|
|
uint32 defaultHostingCost = 7;
|
|
string appDataJson = 8;
|
|
map<string, TerminatorPrecedence> servicePrecedences = 9;
|
|
map<string, uint32> serviceCosts = 10;
|
|
}
|
|
|
|
message CreateCircuitForServiceRequest {
|
|
string sessionId = 1;
|
|
string serviceName = 2;
|
|
string terminatorInstanceId = 3;
|
|
map<uint32, bytes> peerData = 4;
|
|
}
|
|
|
|
message CreateSessionResponse {
|
|
string sessionId = 1;
|
|
string token = 2;
|
|
}
|
|
|
|
message CreateCircuitForServiceResponse {
|
|
CreateApiSessionResponse apiSession = 1;
|
|
CreateSessionResponse session = 2;
|
|
string circuitId = 3;
|
|
string address = 4;
|
|
map<uint32, bytes> peerData = 5;
|
|
map<string, string> tags = 6;
|
|
}
|
|
|
|
message CreateTunnelCircuitV2Request {
|
|
string serviceName = 1;
|
|
string terminatorInstanceId = 2;
|
|
map<uint32, bytes> peerData = 3;
|
|
}
|
|
|
|
message CreateTunnelCircuitV2Response {
|
|
string circuitId = 1;
|
|
string address = 2;
|
|
map<uint32, bytes> peerData = 3;
|
|
map<string, string> tags = 4;
|
|
}
|
|
|
|
message ServicesList {
|
|
bytes lastUpdate = 1;
|
|
repeated TunnelService services = 2;
|
|
}
|
|
|
|
message TunnelService {
|
|
string id = 1;
|
|
string name = 2;
|
|
repeated string permissions = 3;
|
|
bool encryption = 4;
|
|
bytes config = 5;
|
|
bytes tags = 6;
|
|
}
|
|
|
|
message CreateTunnelTerminatorRequest {
|
|
string serviceName = 1;
|
|
string sessionId = 2;
|
|
string address = 3;
|
|
map<uint32, bytes> peerData = 4;
|
|
uint32 cost = 5;
|
|
TerminatorPrecedence precedence = 6;
|
|
string instanceId = 7;
|
|
bytes instanceSecret = 8;
|
|
int64 startTime = 9;
|
|
}
|
|
|
|
message CreateTunnelTerminatorResponse {
|
|
CreateApiSessionResponse apiSession = 1;
|
|
CreateSessionResponse session = 2;
|
|
string terminatorId = 3;
|
|
int64 startTime = 4;
|
|
}
|
|
|
|
message CreateTunnelTerminatorRequestV2 {
|
|
string serviceId = 1;
|
|
string address = 2;
|
|
map<uint32, bytes> peerData = 3;
|
|
uint32 cost = 4;
|
|
TerminatorPrecedence precedence = 5;
|
|
string instanceId = 6;
|
|
bytes instanceSecret = 7;
|
|
int64 startTime = 8;
|
|
}
|
|
|
|
message CreateTunnelTerminatorResponseV2 {
|
|
string terminatorId = 1;
|
|
int64 startTime = 2;
|
|
CreateTerminatorResult result = 3;
|
|
string msg = 4;
|
|
uint32 errorCode = 5;
|
|
uint32 retryHint = 6;
|
|
}
|
|
|
|
message UpdateTunnelTerminatorRequest {
|
|
string terminatorId = 1;
|
|
uint32 cost = 2;
|
|
TerminatorPrecedence precedence = 3;
|
|
bool updatePrecedence = 4;
|
|
bool updateCost = 5;
|
|
}
|
|
|
|
message EnrollmentExtendRouterRequest {
|
|
string clientCertCsr = 1;
|
|
string serverCertCsr = 2;
|
|
bool requireVerification = 3;
|
|
}
|
|
|
|
message EnrollmentCertsResponse {
|
|
string clientCertPem = 1;
|
|
string serverCertPem = 2;
|
|
string caCertsPem = 3;
|
|
}
|
|
|
|
message EnrollmentExtendRouterVerifyRequest {
|
|
string clientCertPem = 1;
|
|
}
|
|
|
|
message ConnectEvents {
|
|
message ConnectDetails {
|
|
int64 connectTime = 1;
|
|
string srcAddr = 2;
|
|
string dstAddr = 3;
|
|
}
|
|
message IdentityConnectEvents {
|
|
string identityId = 1;
|
|
bool isConnected = 2;
|
|
repeated ConnectDetails connectTimes = 3;
|
|
}
|
|
|
|
repeated IdentityConnectEvents events = 1;
|
|
bool fullState = 2;
|
|
}
|
|
|
|
message RouterDataModelValidateRequest {
|
|
DataState state = 1;
|
|
bool fix = 2;
|
|
}
|
|
|
|
message RouterDataModelDiff {
|
|
string entityType = 1;
|
|
string entityId = 2;
|
|
string diffType = 3;
|
|
string detail = 4;
|
|
}
|
|
|
|
message RouterDataModelValidateResponse {
|
|
map<string, uint32> origEntityCounts = 1;
|
|
map<string, uint32> copyEntityCounts = 2;
|
|
repeated RouterDataModelDiff diffs = 3;
|
|
}
|
|
|
|
message SubscribeToDataModelRequest {
|
|
uint64 currentIndex = 1;
|
|
uint32 subscriptionDurationSeconds = 2;
|
|
bool renew = 3;
|
|
string timelineId = 4;
|
|
string subscriptionId = 5;
|
|
} |