camera-credentials
camera-credentials — device-scoped cap exposing the camera's network + auth surface in a vendor-neutral shape.
camera-credentials — device-scoped cap exposing the camera's network + auth surface in a vendor-neutral shape.
Why it exists: cross-vendor wrappers (the planned ONVIF generic addon for PTZ / intercom / events; future homekit / mqtt bridges) need the camera's IP + port + creds without each wrapper re-implementing vendor-specific config-blob extraction. With this cap, every camera provider returns a uniform CameraCredentials and consumers stay vendor-agnostic.
Implementations:
- Each camera-providing addon registers this cap natively per device (Reolink, Hikvision, RTSP, ONVIF self).
- Returns a snapshot from the persisted device config blob — no extra round-trip to the camera, no probing.
- The cap is admin-only (
auth: 'admin') — credentials must not leak through user-scoped paths.
Sensitive data handling:
- getCredentials returns the full snapshot to admin callers only.
- Wrappers are expected to use the value to construct a per-call client and NOT to log / event-bus-emit the password field.
- The cap status payload (mirrored to runtime-state) carries non-sensitive metadata only — host + ports + protocol hints. The password / username live on
getCredentialsexclusively.
See docs/onvif-generic-addon-plan.md for the consuming wrapper design.
At a glance
| Capability | camera-credentials |
| Provided by | The device's own driver provides it: each device registers its own provider. |
| Active providers per device | one |
| Device types | camera |
| Source | packages/types/src/capabilities/camera-credentials.cap.ts |
Methods
Every method takes the device id (deviceId) to address the device; the input tables below list the other fields.
| Method | Kind | Required of a provider | Access |
|---|---|---|---|
getCredentials | query | yes | admin |
getCredentials
query
Return the camera's full credential bundle for admin consumers. Each provider implementation returns a snapshot of its persisted config — no I/O to the camera. Returns null when the device is not owned by this addon (deviceId mismatch).
Input
No fields besides deviceId.
Output
| Field | Type | Required | Description |
|---|---|---|---|
host | string | yes | |
port | number | no | |
onvifPort | number | no | |
rtspPort | number | no | |
https | boolean | no | |
username | string | no | |
password | string | no | |
onvifProfile | string | no |
Status
| Field | Type | Required | Description |
|---|---|---|---|
host | string | yes | |
port | number | null | yes | |
onvifPort | number | null | yes | |
rtspPort | number | null | yes | |
https | boolean | null | yes | |
hasUsername | boolean | yes | |
hasPassword | boolean | yes | |
onvifProfile | string | null | yes |