Back-end-only login details for a password or api-key connection (config-schema §3.2; designed).
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://streamliner.work/schema/v1/private-connection.schema.json",
"title": "private/connections/<id>.json",
"description": "Back-end-only login details for a `password` or `api-key` connection (config-schema §3.2; designed). The back end logs in once with the user's card input, never stores or logs the password, and returns only the session to the device.",
"type": "object",
"required": ["id", "type"],
"additionalProperties": false,
"properties": {
"$schema": { "$ref": "defs.schema.json#/$defs/schemaRef" },
"id": { "$ref": "defs.schema.json#/$defs/connectionId", "description": "Equals the file name and a `tenant.json` `connections[]` id." },
"type": { "enum": ["password", "api-key"], "description": "Must equal the public connection's `type`." },
"login": {
"type": "object",
"description": "`password`: the system's login request. `{{username}}` / `{{password}}` are filled from the card and never logged or stored.",
"required": ["url"],
"additionalProperties": false,
"properties": {
"url": { "$ref": "defs.schema.json#/$defs/httpsUrl", "description": "The login endpoint." },
"method": { "enum": ["POST", "PUT"], "description": "Default POST." },
"body": { "type": "object", "description": "The JSON body, with `{{username}}` and `{{password}}` holes." }
}
},
"session": {
"type": "object",
"description": "Where the session comes from and how the device sends it to the MCP servers.",
"required": ["from", "send"],
"additionalProperties": false,
"properties": {
"from": { "type": "string", "pattern": "^(cookie|json:[A-Za-z0-9_.\\[\\]-]+)$", "patternErrorMessage": "cookie, or json:<path> in the login response", "description": "`cookie`, or `json:<path>` in the login response." },
"send": {
"type": "object",
"required": ["header"],
"additionalProperties": false,
"description": "How the device sends the session.",
"properties": {
"header": { "type": "string", "pattern": "^[A-Za-z0-9-]{1,64}$", "description": "The request header (`Cookie`, `Authorization`)." },
"prefix": { "type": "string", "description": "Text before the value (`Bearer `)." }
}
}
}
},
"ttlSeconds": { "type": "integer", "minimum": 60, "description": "Drop the session after this long even if the system hasn't." }
},
"if": { "properties": { "type": { "const": "password" } } },
"then": { "required": ["login", "session"] }
}