Repository navigation
VOLTTRON 9.1.0
VOLTTRON 9.1.0
This is a minor release. It adds new enforcement on the platform web service, the VUI, the auth service and the PostgreSQL historian, a new platform option, and a set of fixes. Several changes need action from operators, some before the upgrade and some after the first start; read "Upgrade steps" first.
Upgrade steps
Before upgrading:
- Check web agents for namespace conflicts. Every path an agent registers with the platform web service must start with a literal first path segment, its namespace. The first agent to register in a namespace owns it, and another agent's registration there is refused. A pattern without a literal first segment (an empty pattern,
/.*,^/.*$, a leading group or alternation) is refused. These names are reserved and cannot be used as namespaces, in any letter case:admin,authenticate,discovery,gs,vui,csr,index.html,js,logo-tagline.pngandfavicon.ico, along with anything a platform route pattern matches. The namevcis held for VolttronCentral. An agent may own several namespaces. A web agent that registers a reserved name, or a pattern without a literal first segment, fails to register after the upgrade and must be changed first. - Set
web-static-rootsif agents serve files from outside their install. A static path registered by an agent must be an absolute directory inside the agent's own install, below its package directory, or inside a directory listed in the newweb-static-rootsplatform option (comma-separated absolute directories, set in<VOLTTRON_HOME>/config, for exampleweb-static-roots = /opt/site/www). A root equal to the whole install directory, or to the package directory itself, is refused. Agents run from a source tree, and tests that register a temporary directory, must list it there. Every agent allowed to register web routes may serve files from any listed directory, so list only directories meant to be public. - Check PostgreSQL historian configurations. A configuration whose database or table names contain
%or control characters, or whose table names collide with the rebuild's leftover table names, now fails at start with an error naming the setting. Table names of 48 to 63 bytes get a new constraint name on the first table rebuild. - Update agents for PyJWT 2. The web extra now pins PyJWT 2.15.1. Agents that use the PyJWT 1.x API (bytes from
encode,decodewithout an algorithms list) need updating, and code that importedget_user_claimsfromvolttron.platform.webshould call the platform web service'sget_user_claimsRPC. With PyJWT 1.x installed, web support reports itself unavailable. - Update web clients.
- VUI requests other than GET must send the token in the
Authorization: Bearerheader. A VUI front end that writes with only the cookie now gets 401. - The admin API calls that approve, deny or delete requests and credentials must send the token in the
Authorization: Bearerheader; a cookie alone is refused with 401. The bundled admin pages do this. /discovery/allowmust send the token in theAuthorization: Bearerheader and a JSON content type (415 otherwise).- VUI method calls and publishing need a JSON content type, and the user needs the
admingroup in addition tovui. - VUI agent RPC refuses the platform's own service identities (
platform.auth,platform.health,config.store,control,platform_web,keydiscovery,zmq.proxy.routerandcontrol.connection) with 403, and refuses method names that contain a dot. The dedicated VUI endpoints keep serving control and config store operations. - A browser page that opens a pubsub websocket with the cookie must be served from the same host and port as the VUI.
/gsaccepts POST only, at/gsor/gs/. The token must be an admin token sent in the JSON-RPCparams.authenticationfield, and the method must be one ofcontrol.list_agents,control.status_agentsorcontrol.peerlist.
- VUI requests other than GET must send the token in the
At the first start after upgrading:
- The auth file (
auth.json) moves from version 1.4 to 1.5, and a.bakfile is written by the upgrade. Entries that cannot be read are dropped with a warning, and the rest of the file loads. An existing VolttronCentral entry receives theregister_web_routescapability during this upgrade.
After the first start:
- Grant
register_web_routesto web agents. Every agent that registers web routes (other than VolttronCentral) needs the capability, and its registration fails with a capability error until it has it. Add it withvctl auth update <index>(capabilities field). In-repository agents that register routes: SimpleWebAgent and WebSocketAgent (examples), PrometheusScrapeAgent (contrib) and OpenADRVenAgent (unsupported). Treat this capability like admin access: an agent holding it answers every request under its namespaces. - Grant the auth capabilities that callers need. Reading or changing the auth file over RPC needs
allow_auth_modifications; changing another agent's RPC method authorizations needsmodify_rpc_method_allowance.vctland the platform web service already hold them. A third-party agent that reads the credential lists or another user's capabilities, groups or roles, or edits the auth file, needs a grant withvctl auth update. VolttronCentral setup mode now needsallow_auth_modifications, and VolttronCentral is not granted it at install; grant it on thevolttron.centralentry. - Create the first web administrator with the setup token. When the web service starts with no users, it writes a one-time setup token to
<VOLTTRON_HOME>/web-setup-tokenand logs its path. Enter that token in the setup form to create the first administrator. Platforms that already have web users are unaffected.
What changed
- feat: new
web-static-rootsplatform option, and confinement of static path routes to the owning agent's install or a listed root. - feat: web route registration needs the
register_web_routescapability, and each agent owns a first-path-segment namespace. - feat: first-administrator setup uses a one-time token.
- feat:
/gs, VUI agent RPC, VUI pubsub, the admin write API and/discovery/allowenforce group, header and content-type requirements (see Upgrade steps, item 5). - feat: auth file reads and changes over RPC are gated by capability, and an agent records method authorizations only for its own entry.
- feat: capability-gated control RPCs are split into separate capabilities; with authentication disabled, capability enforcement is skipped and a startup warning is logged.
- fix: PyJWT 2 support; token renewal and JSON-RPC authentication reject tokens that fail to decode.
- fix: PostgreSQL historian table-name handling, table rebuild, and index naming.
- fix: auth file kept in sync after writes, and a file lock prevents lost updates to the auth file.
- fix: logging and input-handling hardening in the web service; request paths and names are shortened in web log lines.
- fix: JSON-RPC error replies handle non-object data, keep detail, and build
RemoteErrorfrom a message alone; thevip_mainerror names the right key variables. - docs: RELEASING.md and a security policy added; capability and web framework documentation updated.
- chore: unused VolttronCentral npm packages dropped; dependency updates and test and CI hardening.
Migration notes
- Database: no migration. The auth file upgrade from version 1.4 to 1.5 is applied automatically on the next platform start and writes a
.bakfile. - Rollback: returning to 9.0.x after the auth file has been upgraded to version 1.5 is not tested. The upgrade keeps the previous file as a .bak copy beside it; restore that copy before starting 9.0.x.
- Breaking changes: no platform API is removed, but these callers must change. Web agents that register reserved names or patterns without a literal first segment, and web agents without the
register_web_routesgrant. Agents that use the PyJWT 1.x API or importget_user_claimsfromvolttron.platform.web. Clients of the VUI, the admin approve, deny and delete API,/discovery/allowand/gsthat rely on a cookie, omit a JSON content type, or lack theadmingroup. Third-party agents that read or edit the auth file or other agents' method authorizations without the capabilities named in Upgrade steps. Static path registrations outside the agent's install and theweb-static-rootsdirectories.
Resolved issues
#3237, #3238, #3239, #3248, #3254, #3304, #3305, #3306, #3320, #3341, #3343, #3344