Files
ziti/tunnel/entities/host.v1.json
T
2022-03-16 12:04:17 -04:00

284 lines
8.1 KiB
JSON

{
"schema": {
"$defs": {
"dialAddress": {
"oneOf": [
{
"$ref": "#/$defs/ipAddress"
},
{
"$ref": "#/$defs/hostname"
}
]
},
"hostname": {
"format": "hostname",
"not": {
"$ref": "#/$defs/ipAddressFormat"
},
"type": "string"
},
"ipAddress": {
"$ref": "#/$defs/ipAddressFormat",
"type": "string"
},
"ipAddressFormat": {
"oneOf": [
{
"format": "ipv4"
},
{
"format": "ipv6"
}
]
},
"listenAddress": {
"oneOf": [
{
"$ref": "#/$defs/ipAddress"
},
{
"$ref": "#/$defs/hostname"
},
{
"$ref": "#/$defs/cidr"
}
]
},
"cidr": {
"type": "string",
"oneOf": [
{
"pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(3[0-2]|[1-2][0-9]|[0-9]))$"
},
{
"pattern": "^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*(\\/(12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9]))$"
}
]
},
"portNumber": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"portRange": {
"type": "object",
"additionalProperties": false,
"properties": {
"low": {
"$ref": "#/$defs/portNumber"
},
"high": {
"$ref": "#/$defs/portNumber"
}
},
"required": [
"low",
"high"
]
},
"protocolName": {
"type": "string",
"enum": [
"tcp",
"udp"
]
},
"inhabitedSet": {
"type": "array",
"minItems": 1,
"uniqueItems": true
}
},
"$id": "http://ziti-edge.netfoundry.io/schemas/host.v1.schema.json",
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"forwardProtocol": {
"const": true
}
},
"required": [
"forwardProtocol"
]
},
"then": {
"required": [
"allowedProtocols"
]
},
"else": {
"required": [
"protocol"
]
}
},
{
"if": {
"properties": {
"forwardAddress": {
"const": true
}
},
"required": [
"forwardAddress"
]
},
"then": {
"required": [
"allowedAddresses"
]
},
"else": {
"required": [
"address"
]
}
},
{
"if": {
"properties": {
"forwardPort": {
"const": true
}
},
"required": [
"forwardPort"
]
},
"then": {
"required": [
"allowedPortRanges"
]
},
"else": {
"required": [
"port"
]
}
}
],
"properties": {
"address": {
"$ref": "#/$defs/dialAddress",
"description": "Dial the specified ip address or hostname when a ziti client connects to the service."
},
"forwardAddress": {
"description": "Dial the ip address that the client specified as the destination in the connection metadata. 'address' and 'forwardAddress' are mutually exclusive.",
"type": "boolean"
},
"allowedAddresses": {
"description": "Only allow addresses from this set to be dialed",
"allOf": [
{
"$ref": "#/$defs/inhabitedSet"
},
{
"items": {
"$ref": "#/$defs/listenAddress"
}
}
]
},
"forwardPort": {
"description": "Dial the port that the client specified as the destination in the connection metadata. 'port' and 'forwardPort' are mutually exclusive.",
"type": "boolean"
},
"allowedPortRanges": {
"description": "Only allow ports from this set to be dialed",
"allOf": [
{
"$ref": "#/$defs/inhabitedSet"
},
{
"items": {
"$ref": "#/$defs/portRange"
}
}
]
},
"forwardProtocol": {
"description": "Dial the protocol that the client specified as the destination in the connection metadata. 'protocol' and 'forwardProtocol' are mutually exclusive.",
"type": "boolean"
},
"allowedProtocols": {
"description": "Only allow protocols from this set to be dialed",
"allOf": [
{
"$ref": "#/$defs/inhabitedSet"
},
{
"items": {
"$ref": "#/$defs/protocolName"
}
}
]
},
"allowedSourceAddresses": {
"allOf": [
{
"$ref": "#/$defs/inhabitedSet"
},
{
"items": {
"$ref": "#/$defs/listenAddress"
}
}
],
"description": "hosting tunnelers establish local routes for the specified source addresses so binding will succeed"
},
"listenOptions": {
"additionalProperties": false,
"properties": {
"bindUsingEdgeIdentity": {
"description": "Associate the hosting terminator with the name of the hosting tunneler's identity. Setting this to 'true' is equivalent to setting 'identiy=$tunneler_id.name'",
"type": "boolean"
},
"connectTimeoutSeconds": {
"description": "defaults to 5",
"maximum": 2147483647,
"minimum": 0,
"type": "integer"
},
"cost": {
"description": "defaults to 0",
"maximum": 65535,
"minimum": 0,
"type": "integer"
},
"identity": {
"description": "Associate the hosting terminator with the specified identity. '$tunneler_id.name' resolves to the name of the hosting tunneler's identity. '$tunneler_id.tag[tagName]' resolves to the value of the 'tagName' tag on the hosting tunneler's identity.",
"type": "string"
},
"maxConnections": {
"description": "defaults to 3",
"minimum": 1,
"type": "integer"
},
"precedence": {
"description": "defaults to 'default'",
"enum": [
"default",
"required",
"failed"
],
"type": "string"
}
},
"type": "object"
},
"port": {
"description": "Dial the specified port when a ziti client connects to the service.",
"$ref": "#/$defs/portNumber"
},
"protocol": {
"description": "Dial the specified protocol when a ziti client connects to the service.",
"$ref": "#/$defs/protocolName"
}
},
"type": "object"
}
}