-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose connection creation form as JSONSchema from sidecar API #98
Comments
Here's a rough draft of the JSON Schema document for Direct Connection: {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Direct Kafka Connection Configuration",
"description": "Configuration for directly connecting to a Kafka cluster with an optional Schema Registry.",
"type": "object",
"properties": {
"kafka": {
"type": "object",
"properties": {
"bootstrap_servers": {
"type": "string",
"title": "Bootstrap Servers",
"description": "Comma-separated list of hostname:port pairs for Kafka."
},
"credentials": {
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/noAuth"
},
{
"$ref": "#/definitions/basicAuth"
},
{
"$ref": "#/definitions/oauthBearer"
},
{
"$ref": "#/definitions/apiKeySecret"
}
// Additional authentication methods can be inserted here.
]
}
},
"required": ["bootstrap_servers", "credentials"],
"additionalProperties": false
},
"schema_registry": {
"type": "object",
"properties": {
"uri": {
"type": "string",
"title": "Schema Registry URI",
"format": "uri",
"description": "The URI of the Schema Registry."
},
"credentials": {
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/noAuth"
},
{
"$ref": "#/definitions/basicAuth"
},
{
"$ref": "#/definitions/oauthBearer"
},
{
"$ref": "#/definitions/apiKeySecret"
}
// Additional authentication methods can be inserted here for the Schema Registry as well.
]
}
},
"required": ["uri", "credentials"],
"additionalProperties": false
}
},
"required": ["kafka"],
"additionalProperties": false,
"definitions": {
"noAuth": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "none"
}
},
"required": ["type"],
"additionalProperties": false
},
"basicAuth": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "basic"
},
"username": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": ["type", "username", "password"],
"additionalProperties": false
},
"oauthBearer": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "oauthBearer"
},
"token": {
"type": "string"
}
},
"required": ["type", "token"],
"additionalProperties": false
},
"apiKeySecret": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "apiKey"
},
"key": {
"type": "string"
},
"secret": {
"type": "string"
}
},
"required": ["type", "key", "secret"],
"additionalProperties": false
}
}
} And here's a few sample JSONs adhering to the spec above:
{
"kafka": {
"bootstrap_servers": "kafka1.example.com:9092,kafka2.example.com:9092",
"credentials": {
"type": "basic",
"username": "kafkaUser",
"password": "kafkaPassword"
}
},
"schema_registry": {
"uri": "http://schema-registry.example.com",
"credentials": {
"type": "basic",
"username": "registryUser",
"password": "registryPassword"
}
}
}
{
"kafka": {
"bootstrap_servers": "kafka1.example.com:9092,kafka2.example.com:9092",
"credentials": {
"type": "none"
}
} |
Nice! WDYT about a way for SR to say "Same credentials as Kafka Cluster"? Do we bother? |
Yeah, that'd be nice. Although, not sure if we can do much in that regard with the JSON Schema itself, feels like it'd be something we codify in the dynamic form generation. Worth mentioning here confluentinc/vscode#415. |
Background
The sidecar should return a map of JSON Schemas for the following connection types:
Direct Connections
MDS Connections
TODO: describe configs required for each auth type
The text was updated successfully, but these errors were encountered: