Stop naming remote-access schemes as if they were constants
A link is built by formatting that protocol's own linktemplate, and the
templates are rows in accessprotocols that a site can edit. So no scheme
is a fixed fact about the product, and writing one down as though it were
misleads whoever reads it next.
Two places did. The guest-grant docstring said the detail route resolves
"working rdp:// and vnc:// links", which is wrong for the row we actually
ship: VNC is com.realvnc.vncviewer.connect://{host}:{port}, the RealVNC
handler, not vnc://. And the protocol admin form offered vnc://{host}:{port}
as its placeholder, in the one screen where somebody authors a new template,
so the example contradicted the seeded data it sits next to.
Neither changes behaviour. _computer_access_links already reads the
template from the database and the frontend only ever renders the resolved
link, so nothing in the code assumed a scheme - only the prose did.
Scope: product
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Link template</span>
|
||||
<input v-model="form.linktemplate" type="text" maxlength="255" placeholder="vnc://{host}:{port}" />
|
||||
<input v-model="form.linktemplate" type="text" maxlength="255" placeholder="scheme://{host}:{port}" />
|
||||
<small class="muted">Placeholders: <code>{host}</code>, <code>{port}</code>, <code>{scheme}</code></small>
|
||||
</label>
|
||||
<label class="field checkbox">
|
||||
|
||||
@@ -2020,9 +2020,15 @@ class ComputersPlugin(BasePlugin):
|
||||
KNOWN GAP, tracked separately. The computer serializer is
|
||||
BaseModel.to_dict(), so it publishes every column - serialnumber, the
|
||||
Azure device and object ids - and the detail route resolves
|
||||
accessmethods into working rdp:// and vnc:// links plus the full
|
||||
Communication row. A guest granted this gets all of it, on the LIST
|
||||
route as well, so it is one request rather than one per asset.
|
||||
accessmethods into launch links, each built from that protocol's own
|
||||
linktemplate, plus the full Communication row. A guest granted this
|
||||
gets all of it, on the LIST route as well, so it is one request rather
|
||||
than one per asset.
|
||||
|
||||
Do not name schemes here. The templates are site-editable rows in
|
||||
accessprotocols, so what a link looks like is data, not a constant -
|
||||
the shipped VNC row is com.realvnc.vncviewer.connect://, not vnc://,
|
||||
and an earlier version of this docstring said otherwise for months.
|
||||
|
||||
The fix is a field allowlist on Computer.to_dict() plus suppressing the
|
||||
resolved links unless the caller holds a remote-access permission. Do
|
||||
|
||||
Reference in New Issue
Block a user