This document, the VISS version 2 CORE specification, describes the VISSv2 messaging layer. The companion specifications for the VISSv2 transport protocols detail the mapping of the messaging layer to selected transports. The ontologies based on the VISSv2 core specification are defined in documents for each specific domain (e.g. navigation, media, vehicle data).
This document describes the messaging API for VISSv2 protocol. This includes the messaging layer and set of rules for structuring data. The separation between payload encoding (transport) and messaging API (core) improves adaptability. Extending and describing multiple transport protocols becomes possible.
The messages are exchanged between a server implementation holding the representation of data and a client using the data.
The VISSv2 messaging layer uses a RESTful design for all methods exchanged via the interface ().
The VISSv2 data structuring rules (VSS Rule set) are the same through all transport protocols. The basis for structuring data hold by a server is a tree.
The acronym 'VISSv2' is used to refer to this document, the VISS version 2 specification. The acronym 'VSS' is used to refer to the 'Vehicle Signal Specification' which is defined by the GENIVI Alliance. The term 'WebSocket' when used in this document, is as defined in the W3C WebSocket API and the WebSocket Protocol.
The service is intended for use with a tree-like logical taxonomy to represent the vehicle data. An illustrative example of such a tree structure is shown in Figure 1. While it is meant to support conforming taxonomies it was created principally with the Vehicle Signal Specification (VSS) in mind. For more details, see the VSS documentation.
Addressing of elements is done using URIs as defined in [[RFC3986]].
scheme:authority/path?query
The scheme describes the protocol to use to reach the addressed element.
The authority describes where to reach the server holding and managing the data representation. Scheme and authority are defined within the protocol adaptation.
The path consists of the slash delimited node names of the nodes traversed from the tree root to the tree leaf representing the data point. E. g. the path expression from traversing the nodes Vehicle, Car, Engine, RPM would be "Vehicle/Car/Engine/RPM". The VSS data model uses a dot as delimiter, the implementaion of this specification is expected to handle the necessary translation.
The query contains further information related to the request, see .
The purpose of the data model is to provide a client with a description of the data that enables the client to make a request for desired vehicle data,
and interpret the response. In order to obtain that description, the client MAY request that the server returns the VSS tree content,
i. e. the metadata describing the accessible vehicle data. The client is able to request metadata from any point in the signal tree,
such that only the metadata for the nodes within the given branch of the tree is returned. For example,
only metadata for the chassis branch of the VSS tree is returned when the chassis path is specified.
If the path is set to the VSS root, the response contains the metadata for the entire tree. If the server is able to satisfy the request it SHALL return a Response message.
If an error occurs the server SHALL return an ErrorResponse message.
Some parts of the VSS tree may not be accessible to the Client due to restrictions defined in the .
A service discovery request has the format of a read, where the path is appended with a query component,
see for the details.
The key data components of these messagess are defined below:
This chapter describes the different methods and its arguments that govern the communication between a client and the server.
The transport protocols used to implement these methods MUST implement the Read and Update methods, and MAY implement the Subscribe, Unsubscribe, and Subscription methods.
Purpose: Get one or more values addressed by the given path.
The client MAY have to obtain an authorization token before being able to access the values. If the server is able to satisfy the request it MUST return a success response. If the server is unable to fulfil the request, then the server MUST return an error response.
Arguments, of which path is mandatory:
Success response:
Purpose: Provide altered value to the vehicle signal(s) addressed by the path
The client MAY have to obtain an authorization token before being able to update the vehicle signal(s). If the server is able to satisfy the request it MUST return a success response. If the server is unable to fulfil the request, then the server MUST return an error response.
Arguments, of which path and value are mandatory:
Success response:
Purpose: Get asynchronous messages containing the value(s) addressed by the path. The triggering rules for issuing the notification messages are set by the filter data.
The client MAY have to obtain an authorization token before being able to subscribe to the vehicle signal(s). The server MUST issue a notification if a trigger rule is fulfilled. If the server is able to satisfy the request it MUST return a success response. If the server is unable to fulfil the request, then the server MUST return an error response. If an error occurs during the subscription period, the server SHOULD return an error notification.
Arguments, of which path and filter are mandatory:
Success response:
Purpose: Termination of the subscription period started by a previous subscribe request.
If the server is able to satisfy the request it MUST return a success response, and it MUST stop issuing notifications associated to the subscription handle. If the server is unable to fulfil the request, then the server MUST return an error response.
Arguments, of which subscriptionId is mandatory:
Success response:
Purpose: Asynchronous client notification according to the subscribe request trigger rules.
The server MUST issue a notification message when a triggering rule associated with the subscription is met. If the server cannot fulfill the triggering rules it MUST issue an error notification and terminate the subscription.
Arguments:
The server MUST inform a client about errors ocurring in interactions between the two, whether it is in a synchronous error response to a request message, or an asynchronous error notification message.
The error information has three components - a number, a reason, and a message. The number MUST always be part of the error information, while the reason and message components MAY be a part of it.
Timestamps in transport payloads MUST conform to the ISO8601 standard, using the UTC format with a trailing Z.
Time resolution SHALL at least be seconds, with subsecond resolution as an optional degree of precision when desired.
The time and date format shall be as shown below, where the sub-second data and delimiter is optional.
YYYY-MM-DDTHH:MM:SS.ssssssZ
The exception to this is timestamps within tokens, which MUST conform to Unix time.
Filtering is a mechanism to refine a client request, in order to more precisely control what is returned in a response. Filtering can be applied in read requests and in subscribe requests. A request where filtering is applied has the following structure
The paths filter operation is used when a single request is used to retrieve signal data from multiple data points in the VSS tree.
The vsspath shall point to the last node in the tree that is common for the relative paths in the filter op-value, that start off from this node.
If the end point of a path in the filter op-value is a branch, then all leaf nodes in the sub-tree below this branch are addressed.
A path in the filter op-value may contain the wildcard character (*) as a representative for a path segment.
Every path element in an op-value array must address at least one node in the tree, or else an error response is returned.
If the path in the filter op-value ends with one or more wildcards, then only the leaf nodes with path segments matching the number of wildcards are addressed.
Different elements of the op-value array may address the same node, in which case it is the responsibility of the server to resolve this to a singleton in the notifications.
If the op-value contains a single path then it shall not be enclosed with JSON array brackets.
The op-extra key-value pair is not used in paths filter operations.
Examples can be found in the TRANSPORT specification.
The server typically have access only to the latest, most fresh data point representing a signal.
However, it may for various reasons at least temporarily have access to also older data points.
A scenario where this could occur is when a vehicle temporarily loses its connectivity,
maybe because it enters into a tunnel. Assuming that the vehicle detects the loss of connectivity, it may then start to record data.
If recorded, this data may then be accessed using the history op-type.
The vehicle system makes its own decision whether to record any data, and for how long this data will be kept in storage.
The period goes from current time, excluding the current value, and backwards in time.
The number of data points in the response depends on the period size, and the sample frequency.
The latter can not be set by the client, so the client should have some understanding of its value to estimate the amount of data it may receive.
A request for historic data will return a Not found error if historic data is unavailable.
The period must conform to the [[ISO8601]] duration format, expressed with days, hour, minute, and second data, i. e. "op-value": "PdddDThhHmmMssS".
The number of days shall be less than 999. Only a single period can be expressed.
The op-extra key-value pair is not used in history filter operations.
Examples can be found in the TRANSPORT specification.
The capture filter operation is used when the client want to restrict the amount of data that will be returned. The op-extra key-value pair is used in capture filter operations, as described for the following capture types below.
The filtering operations may be used to address multiple tree nodes in one request. This may lead to specific issues in certain situations, as described below.
A request addressing multiple nodes may address both valid nodes, and invalid nodes. The latter case shall lead to a Not found error response message part that contains information about which node, or nodes, that are invalid. The error response shall not contain data from any of the validly addressed nodes.
A response may contain multiple values, due to either that multiple nodes are addressed, or to that multiple values for one signal is returned. These two reasons can be combined, leading to four different cases.
“data”:{“path”:”X”, “dp”:{“value”:”Y”, “ts”:”Z”}}
“data”:{“path”:”X”, “dp”: [{“value”:”Y1”, “ts”:”Z1”}, …, {“value”:”Yn”, “ts”:”Zn”}]}
“data”:[{“path”:”X1”, “dp”:{“value”:”Y1”, “ts”:”Z1”}}, …, {“path”:”Xm”, “dp”:{“value”:”Ym”, “ts”:”Zm”}}]
“data”:[{“path”:”X1”, “dp”:[{“value”:”Y11”, “ts”:”Z11”}, …, {“value”:”Y1n”, “ts”:”Z1n”}]}, …, {“path”:”Xm”, “dp”:[{“value”:”Ym1”, “ts”:”Zm1”}, …, {“value”:”Ymn”, “ts”:”Zmn”}]}]
In the case of a request for multiple values from multiple nodes, the datapoint for different paths may contain single or multiple objects,
as the vehicle system may not have multiple values recorded for all requested signals.
A subscription request must always contain a capture filter operation that describes the trigger event that leads to that the server dispatches an asynchronous notification message. For the capture types "range" or "change", the triggering is dependent on the signal value. When the request addresses multiple signals, the triggering condition shall only be evaluated on one of the signals, which is the first signal in the op-value array of paths. The first path in the array must therefore not contain wildcards to address multiple signals. In this case one of the path addresses in the wildcard expression must be selected as the first array element, which can then be followed by the wildcard expression. The duplicate reference to one signal that this leads to shall be resolved by the server to a singleton in the notifications.
Metadata requests are used when the client instead of the data associated to a VSS node wants to retrieve meta data associated to the VSS node.
A request for metadata has the following structure
Access control MUST be supported. However, in this chapter only the sections that describe the interactions between the Client and the VISSv2 server are normative.
This section is non-normative.
The VISSv2 access control model is inspired by the concepts of OAuth2.0 [[RFC6749]], but some deviations exist as is described in the following chapters.
Four actors are defined:
Client
An application making protected and authorized resource requests on behalf of its user.
Access Grant server
The server issuing the Access Grant credential after successfully authenticating the Client.
Access Token server
The server issuing the Access Token to the Client after successfully validating the request and obtaining authorization.
VISSv2 server
The server hosting the protected resources, capable of accepting and responding to protected resource requests using Access Tokens.
The abstract protocol flow illustrated in the figure below describes the interaction between the four actors.
Besides the four actors directly involved in the abstract flow, there are two more actors.
Resource owner
This is typically the driver of the vehicle, who may be asked for consent before access is granted.
Ecosystem manager
The entity managing the access control ecosystem. It controls the Policy documents, and manages the PKI ecosystem that the other actors may utilize.
The abstract protocol flow is implemented by two different flows, as will be described in the following chapters.
The process to obtain the credentials needed for Client authentication is out-of-scope, as well as the installation procedures for the applications.
This section is non-normative.
Two different flows are described. Which flow to use depends on the capabilities of the Client.
If a Client is able to run public key cryptographic primitives,
i.e. key pair generation and signatures, and has access to some kind of trusted execution environment where private keys are protected from the regular execution environment,
then it can use the Long term flow. Clients that do not have access to these capabilities, or do not want to use them, must select the Short term flow.
The advantage of using the Long term flow is that the Client can be trusted with longer expiry times of Access Grant tokens.
In the Short term flow the Client must due to a shorter expiry time contact the Access Grant Server (AGS) more often to obtain a new Access Grant token.
A Client selects the type of flow by either submitting a public key in the AG message, or not. The latter leading to an Short term flow.
The request shall contain at least these two parameters below:
The Access Token server acts as a Policy Enforcement Point, making decisions on whether to grant access to the protected resource based on the provided AG Token and Purpose.
A successful response shall contain the parameter:
This is the VISSv2 request including an Access token that is described in general in the chapter, and for different transport protocols in the VISSv2 CORE document.
This is the VISSv2 response that is described in general in the chapter, and for different transport protocols in the VISSv2 CORE document.
This section is non-normative.
The Client is an abstract representation of three sub-actors:
This section is non-normative.
The Access Grant server (AGS) is in charge of producing Access Grants to Clients.
Depending on the capabilities of the Client, the specification supports two types of Access Grant Tokens: Short term and Long term AG Tokens.
Long term Access Grant Tokens, are supported for those Clients able to run public key cryptographic primitives, i.e. key pair generation and signatures,
and is the recommended choice for Clients with access to a trusted execution environment where private keys are protected from the regular execution environment.
The specification also supports Short term Access Grant Tokens that require no extra capabilities in the client,
but due to its shorter expiry time it forces the client to contact the AGS more often before Access Token Server (ATS) requests for an Access Token.
The Client request shall contain the following:
This section is non-normative.
The Client shall after a successful interaction with the AG server request an Access token from the Access Token server.
The Client request shall contain at least these two parameters below.
The VISSv2 server MUST support validation of Access tokens. This includes validation of at least the following:
Validation | Read-only | Read-write |
---|---|---|
get set subscribe |
||
Ok | Ok | |
Nok | Ok | |
Ok | Ok |
The Access Token need to be refreshed periodically, which is controlled by the expiry time. If the AG token that the Client used to obtain the now expired Access token is not expired,
then the Client can revisit the AT server with this AG token to obtain a new Access token.
If the AG token is expired, then the Client must obtain a new AG token first, before revisiting the AT server.
For Client requests that are not granted due to access control, the VISSv2 server MUST return one of the error codes shown in the table below.
Error Number (Code) | Error Reason | Error Message |
---|---|---|
401 (Unauthorized) | missing_token | One or more of the requested signals are access controlled, an access token must be included in the request. |
406 (Not Acceptable) | invalid_token | A fresh access token must be obtained. |
406 (Not Acceptable) | insufficient_priviledges | The priviledges represented by the access token are not sufficient. |
This section is non-normative.
The Resource owner is typically the owner and/or driver of the vehicle. If Consent is required for granting access to the protected resource,
then it should be directed to the Resource owner. The process for this is out of scope for this specification.
This section is non-normative.
The Ecosystem manager is the entity responsible for the functionality of the access control system. This typically includes the management of the Access Grant server,
and the Access Token server, the Policy documents, and that there is a PKI domain for the other actors to utilize.
This section is non-normative.
The three Client sub-actors must provide authentication credentials to the AG server.
This may be certificates that the sub-actors have obtained from a Certificate Authority that is known by the AG server.
The interactions related to this are out of scope.
The Access token SHALL have the following claims in header and payload.
{ "alg": "HS256", "typ": "JWT" }, { "iat": 1609452095, "exp": 1609459199, "scp": "PurposeX", "clx": "user+app+dev", "aud": "w3.org/VISSv2", "jti": "5967e93f-40f9-5f39-893e-cc0da890db2e" }Algorithm (alg) shall be set to any valid algorithms according to [[RFC7518]].
Long term Access Grant tokens need to be accompanied by a Proof of Possession (PoP) for the private key corresponding to the public key included in the Access Grant token. This requirement enables a longer validity for this kind of tokens, ranging from a few days to a even a year. By adding the PoP, we prevent an eavesdropper to reuse an Access Token request, impersonating the client. Without a PoP, the longer the validity of an Access Grant token, the higher the risk an attacker could intercept and reuse it. PoP for JWT are defined in [[RFC7800]], but in essence, a PoP enables the requester to proof to the server that it has access to a private key, without disclosing it. Traditionally that would require the server to create a random challenge, or nonce, and ask the client to sign it with its private key. Along with the public key, the server would be able to verify the PoP. This scheme would require an extra step in the protocols, where the client ask for the nonce.
In order to avoid this extra step, the client can generate the nonce itself. The server would need to check that nonces are not reused. Although logging previous nonces at the server side would work for small environments, we propose the use of an incremental nonce in the form of a timestamp. One of the drawbacks of this proposal is that the server has no means to check whether the PoP has been precomputed or not. However, this is irrelevant from the eavesdropper point of view.
In case freshness of the PoP was a critical requirement, we could use a public source of randomness to obtain the nonce, e.g. Leage of Entropy or Interoperable Randomness Beacons. That would provide the server a mean to check freshness of the PoP but on the other hand, it would require the client to access the public source of randomness every time it needs to create a PoP which is against the main designs goal of the Long term Access Token grant.
This section is non-normative.
The Client actor described in the chapter is characterized by three subactors:
VISSv2 specifies the following minimum set of roles for users:
VISSv2 specifies the following minimum set of roles for applications:
VISSv2 specifies the following minimum set of roles for devices:
This section is non-normative.
The Policy documents are typically owned and created by the Ecosystem manager. They need to be handled securely to protect their integrity.
The Ecosystem manager shall securely provision them to the Access Token servers in the access control ecosystem.
A Client shall provide a Purpose as input to a request for an Access token. A list of supported purposes needs to exist for a client to select from.
The Ecosystem manager shall therefore provide means for Clients to survey the list to find a Purpose that fits its use case.
Each entry in the list contains a short description of the purpose, which is what the Client shall provide as input to its request for an Access token.
There is also a long description, which may be used in the dialogue for consent, if needed. Then there is a list of the Client contexts, i. e. the sub-actor role triplet,
that can be granted this access, and last there is a list of the signals that the client is given access to for this purpose,
with the allowed access mode. The list shall use a JSON format as shown in the example below.
{"purposes":
[{"short": "fuel-status",
"long": "Fuel level and remaining range.",
"contexts":[{"user":"Independent","app":["OEM", "Third party"], "device":"Cloud"}, {"user":"Owner", "app":"Third party", "device":"Nomadic"}, {"user":"Driver", "app":"OEM", "device":"Vehicle"}],
"signal_access":
[{"path": "Vehicle.Powertrain.EnergyStorage.FuelSystem.Level", "access_mode": "read-only"},
{"path": "Vehicle.Powertrain.EnergyStorage.FuelSystem.Range", "access_mode": "read-only"}]
},
{}]
}
The Purpose list shall be securely provisioned to the AT server. The protocol for this is out-of-scope.
The AT server must reject all requests for Access tokens if it is not in possession of a Purpose list.
The Scope list contains a list of the VSS tree nodes for which access shall be prohibited, per Client context.
This prohibition is regardless of whether the Client has a valid Access token or not.
The Scope list can also be used to limit the node metadata that is returned on a Client service discovery request.
Each entry in the list contains a list of paths to nodes that should be excluded, and a list of the Client contexts, i. e. the sub-actor role triplet,
for which this exclusion should be made.
The Scope list may contain an entry for a context with all three Roles set to "Undefined".
The no-access scope of this entry shall then be used for signal discovery requests where no token is included.
The list shall use a JSON format as shown in the example below.
{"scope":
[{"contexts":[ { "user":["Driver", "Passenger"], "app":"Third party", "device":"Vehicle"}, { } ],
"no_access":
["Vehicle.Drivetrain.Transmission.Speed",
"Vehicle.Cabin.Infotainment.Navigation.CurrentLocation.Latitude",
"Vehicle.Cabin.Infotainment.Navigation.CurrentLocation.Longitude"]
},
{}]
}
The Scope list shall be securely provisioned to the AT server. The protocol for this is out-of-scope.
The AT server shall not restrict the scope for any Client context if it is not in possession of a Scope list.
This section is non-normative.
This chapter describes a complementary functionality to the access control model, the ability to apply it selectively to parts of the tree.
It can be used in cases where not all nodes of the tree are believed to require access control,
or read-only is sufficient instead of read-write access control for certain nodes.
This functionality requires that the Access token specifies whether the access granted to the Client to a signal is read-only, or read-write.
It also requires that the metadata for the node in the VSS tree contains data specifying whether the access control verification should be carried out only for write request,
or for both read and write requests.
The former requirement is realized as described in earlier chapters by that the Access token scope claim links to a Purpose entry in the
where the signals and their respective access mode are found.
The latter requirement is realized by adding to nodes in the VSS tree the key-value pair "validate":'access-control-mode',
where 'access-control-mode' is either the string "write-only", or "read-write".
The figure above shows an example where both read and write requests to the three leftmost leaf nodes will be access controlled,
while the two rightmost leaf nodes only will be access controlled for write requests.
An inheritance rule leads to that any nodes below a tagged node are assigned the same access control, if they are untagged.
This metadata is not likely to be applied to the standardised VSS tree, as different implementers of this standard may have different views on which nodes to apply it to.
Instead it is anticipated that it is applied at a "deployment" stage, possibly using the VSS layering concept.
The inheritance model, which says that if access-control-mode data is added to a node, then all nodes in the subtree for which this node is the root inherits the setting,
unless there is access-control-mode data added to any node in this subtree, makes possible a reduction of the number of nodes this metadata have to be added to.
This allows for example an entire VSS tree to be assigned an access-control-mode by merely applying it in the root of the tree.
The figure below shows an overview of the access control selection model,
and a table showing the required access control tagging of a node for the VISSv2 server to grant the requested access.
If the VSS tree used by a VISSv2 server contains access control selection tags, then the server MUST support their usage as described in this chapter.
If it is not used, then a server may implement access control for the entire tree.