Connection Configuration
Connection-config records define protocol parameters and are assigned to inventory scopes. At session launch, Piping resolves the matching records into an effective parameter set. Manage records and assignments under Connections → Connection Config.
Mental model
Keep three layers separate:
| Layer | Responsibility |
|---|---|
| Inventory | What to connect to: device or VM, site, role, tenant, primary IPv4/IPv6 |
| Connection config | Which launch buttons exist and which parameters they use: protocol, address, port, URL, RDP options, label, colour |
| Credentials | Who to connect as: a shared service account from a config record or a user's personal credential set |
- For per-user accounts, assign connection-config records to define protocol parameters (addresses, ports, URLs, buttons). Users manage personal credentials in Account → Settings → Credentials; Piping overlays them at launch.
- For shared service accounts, store
credentials.usernameand a secret-backedpasswordorprivate_keydirectly on the record. apprecords define launch buttons opening target-specific URLs or local commands without storing protocol credentials.
Records
A record (connconf_record) has:
| Field | Notes |
|---|---|
name | Human-readable identifier (e.g., "Global SSH defaults") |
description | Optional free-text description |
protocol | ssh, rdp, vnc, app, or cctv |
params | Protocol parameter tree (stored as JSONB) |
base_record_id | Optional parent record for parameter inheritance (same protocol; cycle-checked at write time) |
owner_user_id | null = org-shared; non-null = personal record visible only to that user |
enabled | When false, the record is skipped during resolution |
params structure
params is a JSON tree. The keys the product uses:
{
"host": "{{primary_ip4}}",
"port": 22,
"credentials": { "username": "admin" },
"ui": { "label": "Admin", "color": "#22c55e" }
}
hostsupports variables such as{{primary_ip4}}, resolved per target at connect time.credentialscarries the account identity:usernamepluspasswordorprivate_keyfor SSH,usernameandpasswordfor RDP,passwordfor VNC. Secret leaves hold either a literal value or a reference to a stored secret (see Secrets below).ui.label,ui.color, andui.icondrive how the launch button is presented;ui.rendersets the protocol's render hint ("auto","buttons","split").- RDP-specific options live under
options:width,height,dpi,color_depth,security(any,nla,rdp,tls),ignore_cert,disable_auth,disable_gfx. apprecords useurlinstead ofhost/port.cctvrecords usemgmt_port,channel, andfamilyinstead ofport, and the form offers no timeout field — see below.
CCTV records
A cctv record points Piping at a camera or recorder's management plane instead of at a proxied session. Its form carries six fields:
| Field | Notes |
|---|---|
host | Management address; the {{primary_ip4}} / {{primary_ip6}} placeholders apply |
mgmt_port | Management port |
channel | Channel index stored on the profile |
family | dvrip_sofia, dahua, hikvision, or onvif |
credentials.username | Required |
credentials.password | Optional; a literal value or a reference to a stored secret |
Three of those values fall back instead of failing when the record leaves them empty:
| Value | Resolved from |
|---|---|
| Host | params.host — unless it is empty or holds a {{…}} placeholder, in which case the target's own inventory address is used |
| Family | params.family — else the network-automation driver slug on the target's platform (see Inventory) |
| Port | params.mgmt_port — else the family's default management port |
One cctv record at a broad scope can specify credentials while devices resolve their own address, family, and port. See CCTV.
Variables
{{...}} placeholders in params are substituted server-side from the target's inventory at launch. There are two kinds.
Endpoint variables — the only placeholders allowed in the host field (the endpoint must be an IP):
| Variable | Resolves to |
|---|---|
{{primary_ip4}} | Target device/VM primary IPv4 from inventory |
{{primary_ip6}} | Target device/VM primary IPv6 from inventory |
Target namespace — {{target.*}}, drawn from the device/VM and its related inventory entities. Use these in app web-link URLs and other non-host string fields:
| Variable | Resolves to |
|---|---|
{{target.name}} | Device/VM name |
{{target.primary_ip4}} / {{target.primary_ip6}} | Primary IPs |
{{target.site.name}} / {{target.site.slug}} | Site |
{{target.region.name}} / {{target.region.slug}} | Region |
{{target.tenant.name}} / {{target.tenant.slug}} | Tenant |
{{target.role.name}} / {{target.role.slug}} | Role |
{{target.platform.name}} / {{target.platform.slug}} | Platform |
{{target.device_type.model}} / {{target.device_type.slug}} | Device type (devices only) |
{{target.cluster.name}} | Cluster |
{{target.custom_fields.<key>}} | A custom field (flat key, scalar value) |
In the edit form the {} button lists the available variables for the focused field (the Host field offers the two endpoint IPs only). A relation that is unset resolves to an empty string.
Examples:
{ "host": "{{primary_ip4}}", "port": 22 }
{
"url": "https://grafana.example.com/d/host?var-host={{target.name}}&var-site={{target.site.slug}}",
"ui": { "label": "Grafana", "color": "#ff6f00" }
}
Safety: {{target.*}} values are URL-encoded in web links; control characters reject the launch. Local-command app records accept only {{primary_ip4}} and {{primary_ip6}}. If the host address cannot resolve, assign the primary IPv4/IPv6 to the device or VM interface in inventory first.
Practical patterns
Per-user credentials
Create a record without a shared secret, for example "SSH Linux":
{
"host": "{{primary_ip4}}",
"port": 22,
"ui": { "label": "SSH", "color": "#22c55e" }
}
Assign it to role = linux-server, a site, or another suitable scope. SSH is now available for the covered targets. Each user adds their own SSH credential set under Account → Settings → Credentials. When the user selects that set in the launcher, its credentials are applied over the host and port from connection config.
Shared service account
Create a record with identity:
{
"host": "{{primary_ip4}}",
"port": 3389,
"credentials": {
"username": "operator",
"domain": "OFFICE",
"password": "<secret-ref>"
},
"options": { "width": 1920, "height": 1080, "color_depth": 32 },
"ui": { "label": "RDP operator", "color": "#3b82f6" }
}
Because the record has credentials.username, it becomes a distinct shared launch account. Store the password as a secret, not as a literal.
App button per target
An app record (protocol = app) does not open a proxied session — it turns the resolved params.url into a launcher button. The same {{primary_ip4}} / {{primary_ip6}} variables are substituted from inventory, so one shared record gives every target its own button.
url can be either a web address or a local command:
{
"url": "http://{{primary_ip4}}:631",
"ui": { "label": "CUPS", "color": "#ff6f00" }
}
A web URI (http(s)://…, mailto:, ms-settings:display, or any registered scheme) opens straight from the browser. Assign this record to the printer role or device type and the launcher shows a CUPS button pointed at the selected target.
Launch a local application
To run an operator tool on the user's own machine, set url to a command instead of a URI:
{
"url": "\"C:\\Program Files\\Vendor\\Client.exe\" --host {{primary_ip4}}",
"ui": { "label": "Vendor client", "color": "#8b5cf6" }
}
Plain commands like notepad, calc.exe, or /opt/vendor/client --target {{primary_ip4}} work the same way. A web browser cannot start these, so for app records without a URI scheme the portal shows that Piping Desktop is required. In Piping Desktop the user gets a native confirmation dialog, then the command runs locally as an executable plus arguments — with the host variables already filled in from inventory.
This lets admins wire one shared button to a proprietary client while passing only host context ({{primary_ip4}}). App records carry just the launcher target and display metadata — no credentials; keep any login in the local tool itself or in a session-protocol record.
Overrides without duplication
Scope deep-merging allows broad defaults (e.g. global port: 22) with targeted overrides (e.g. site-level port: 2222 or device-level ui.label).
Scope inheritance — 13 layers
Records are usually not created one per host. They are bound to scope layers via connconf_assignment; for exceptions, a record can also be assigned directly to a device or vm. At session launch, the resolver collects all assignments that cover the target device or VM, sorts them by specificity, and deep-merges their params — the most-specific scope wins on any given key.
Scope ladder, least → most specific (specificity index 0 → 12):
global (0)
region (1)
site_group (2)
site (3)
location (4)
rack (5)
tenant (6)
cluster (7)
role (8)
device_type (9)
platform (10)
device (11)
vm (12)
When two assignments share the same scope type (e.g., two records both assigned to site), the weight field is the tiebreaker — higher weight wins within the same scope type.
Assignments
A connconf_assignment binds one record to one scope:
record_id + scope_type + scope_id + weight + enabled
scope_id is null only when scope_type = global. The resolver's effective sort key is (scope_type.specificity ASC, weight ASC, record_id ASC).
To create an assignment:
POST /api/v1/connection-config/assignments
{
"record_id": "<uuid>",
"scope_type": "site",
"scope_id": "<site-uuid>",
"weight": 10,
"enabled": true
}
Template inheritance (record-level)
Setting base_record_id on a record creates a parent → child inheritance chain. The child's params are deep-merged on top of the parent's; child values win. This is independent of scope inheritance — it applies within a single record before that record enters the scope resolution stack.
Use cases:
- Create a base record
"SSH corporate defaults"with hardened settings. - Create child records
"SSH Linux servers"and"SSH network devices"that inherit the base and only override the username.
Any key in a child record can be explicitly removed from the effective result with {"unset": true}:
{
"params": {
"port": { "unset": true }
}
}
Cycles in the base_record_id chain are rejected at write time.
Personal records
Records with owner_user_id != null are personal — only that user sees or can assign them. Personal records participate in the same scope resolution stack as org-shared records. This lets a user override any parameter at any scope granularity without affecting other users.
Example workflow:
- Admin creates org-shared record at
globalscope withusername: "svc-piping". - An engineer creates a personal record at
devicescope for their workstation withusername: "jdoe". - When the engineer launches a session to that device, they get
username: "jdoe"; everyone else gets"svc-piping".
Effective resolution
GET /api/v1/connections/targets/{id}/launch-options runs the full resolver for every protocol that has at least one assignment covering the target. Records whose resolved params carry a credential identity (credentials.username) become distinct shared launch accounts; records without one deep-merge into shared defaults. If there are no shared accounts but at least one covering protocol record exists, the resolver creates a fallback account from the merged parameters — this is what user personal credential sets can be applied to. Each protocol entry carries the render hint and accounts[] — see Connections for the account model.
GET /api/v1/connections/targets/{id}/effective-config returns the fully merged parameter tree plus attribution — a map from dotted leaf path to the winning record and scope — so you can audit exactly which record contributed each parameter value. The same resolver is exposed by device id at GET /api/v1/connection-config/effective/{device_id}.
The attribution map is the first place to look when a session launches with an unexpected value — it shows the full merge provenance.
If a launch button is missing, check four things: there is an enabled record for the protocol, it is assigned to a scope that covers the target, the target has the primary IP required by {{primary_ip4}} or {{primary_ip6}}, and RBAC grants connect on that target.
Tip: free-form per-host JSON overlays (including
piping.connections.*keys) can also come from config contexts — a separate layer beside the record resolver. Apiping.connections.cctv[]entry there is validated strictly: onlyhost,mgmt_port(1–65535),channel(0–65535),family, andcredentialsare accepted;credentialstakes onlyusername(required) andpassword; and thatpasswordmust be a stored-secret UUID — a literal is rejected at write time.
Secrets
Credential fields in params hold either a literal value or a reference to a stored secret. Secret-backed leaves are tracked through usage bindings:
consumer_id (the record UUID) + field_key (e.g., "credentials.password") → stored secret
The raw secret material is resolved server-side at session time, fenced to the exact record and field path that contributed it, and is never returned to the browser or written to the audit log. GET /api/v1/connection-config/records/{id}/credentials reveals which credential fields of a record are secret-backed; values are populated only when the caller has secret visibility. Storage, encryption, and the write-only lifecycle are covered in Secrets.
REST API reference
| Method | Path | Purpose |
|---|---|---|
GET | /api/v1/connection-config/records | List records |
POST | /api/v1/connection-config/records | Create record |
GET | /api/v1/connection-config/records/{id} | Get record |
PUT | /api/v1/connection-config/records/{id} | Update record |
DELETE | /api/v1/connection-config/records/{id} | Delete record |
GET | /api/v1/connection-config/records/{id}/credentials | Reveal a record's credential fields |
GET | /api/v1/connection-config/assignments | List assignments |
POST | /api/v1/connection-config/assignments | Create assignment |
PUT | /api/v1/connection-config/assignments/{id} | Update assignment |
DELETE | /api/v1/connection-config/assignments/{id} | Delete assignment |
GET | /api/v1/connection-config/effective/{device_id} | Resolve effective config by device |
GET | /api/v1/connections/targets/{id}/launch-options | Resolve launch options for a target |
GET | /api/v1/connections/targets/{id}/effective-config | Resolve effective config for a target |
The authoritative route list is in the API reference.