VISS version 2 - Core

W3C First Public Working Draft

This version:
https://www.w3.org/TR/2021/WD-viss2-core-20210729/
Latest published version:
https://www.w3.org/TR/viss2-core/
Latest editor's draft:
https://github.com/w3c/automotive/blob/gh-pages/spec/VISSv2_Core.html
Editors:
Ulf Bjorkengren (Geotab)
Isaac Agudo (NICS Lab / University of Malaga)
Former editors:
Ulf Bjorkengren (Volvo Cars)
Patrick Lünnemann (Volkswagen Group)
Participate:
GitHub w3c/automotive
File an issue
Commit history
Pull requests

Abstract

The Vehicle Information Service Specification (VISS) is a service for accessing vehicle information, signals from sensors on control units within a vehicle's network. It exposes this information using a hierarchical tree like taxonomy defined in GENIVI Vehicle Signal Specification (VSS). The service provides this information in JSON format. The service may reside in the vehicle for applications needing to analyse a high volume of realtime data or on servers in the internet with information already brought off the vehicle.

This specification describes a second version of VISS which has been implemented and deployed on production vehicles. It adds major new capabilities and improvements to the earlier version. The first version of VISS only supported WebSocket as a transport protocol, the second version is generalized to work across different protocols as some are better suited for different use cases. HTTP is now supported with additional protocols used within the automotive industry being evaluated for inclusion. Subscription capabilities have been improved and access control has been added.

There are two parts to this specification, Core and Transport. 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).

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.

This document was published by the Automotive Working Group as a First Public Working Draft. This document is intended to become a W3C Recommendation.

GitHub Issues are preferred for discussion of this specification.

Publication as a First Public Working Draft does not imply endorsement by the W3C Membership.

This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

This document is governed by the 15 September 2020 W3C Process Document.

1. Introduction

This document describes the messaging API for VISS 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 (§ 5. 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.

2. Conformance

As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.

The key words MAY, MUST, SHALL, and SHOULD in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

3. Terminology

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 hosted by the GENIVI Alliance. The term 'WebSocket' when used in this document, is as defined in the W3C WebSocket API and [RFC6455], the WebSocket Protocol.

3.1 Definitions

client
An entity that works with data managed by a server.
server
An entity that manages and offers access to data.
success response
The message being returned by the server to the client when no error is encountered. These are specific per request type
error response
The message being returned by the server to the client when an error is encountered. These have a common format for all request types
error notification
The asynchronous message being returned by the server to the client when an error is encountered.
value
The data that is associated with one or more VSS nodes. Regardless of its data type, a single data item is always represented as a string in message payloads.
timestamp
A date and time representation. See chapter § 5.3 Timestamps.
filter
Additional to help the server in the selection of data for the client.
authorization
A token providing a verifiable proof that the client may be authorized access to the requested value(s).
subscriptionId
A handle identifying a subscription session.
purpose
A purpose is one of the short text entries from the § 8.7.1 Purpose List.

4. Data Model

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.

example-vss-tree
Figure 1 Diagram showing an example VSS 2.0 tree.

4.1 Addressing

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 a sequence of VSS node names separated by a delimiter. VSS specifies the dot (.) as delimiter, so that is the recommended choice also in this specification. However, in HTTP URLs the conventional delimiter is slash (/), therefore this delimiter is also supported. To exemplify this, the path expression from traversing the nodes Vehicle, Car, Engine, RPM can be "Vehicle.Car.Engine.RPM", or "Vehicle/Car/Engine/RPM". A mix of delimiters in the same path expression SHOULD be avoided.
The path may contain the wildcard character (*) as a representative for one path segment. It MUST not be combined with other characters to express the path segment, such as "Vehicle.C*". Multiple wildcards may be used in the same path, such as "Vehicle.Cabin.Door.*.*.IsOpen".

The query contains further information related to the request, see § 7. Filter Request.

5. Interface

This chapter describes the different methods and its arguments that govern the communication between a client and the server.

5.1 Methods

The transport protocols used to implement these methods MUST implement the Read and Update methods, and MAY implement the Subscribe, Unsubscribe, and Subscription methods.

5.1.1 Read

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:

  • path The path as defined in VSS to one or more nodes in the VSS tree.
  • filter Additional information defining the requested data.
  • authorization The authorization token.

Success response:

  • value The value(s) associated with the addressed VSS nodes.
  • timestamp The sample time of the value.

5.1.2 Update

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:

  • path The path as defined in VSS to a single node in the VSS tree.
  • value The value by which the vehicle signal addressed by the path will be updated to.
  • authorization The authorization token.

Success response:

  • timestamp The time for updating of the vehicle signals.

5.1.3 Subscribe

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:

  • path The path as defined in VSS to one or more nodes in the VSS tree.
  • filter The rule set describing triggering criterias for issuance of asynchronous notification messages.
  • authorization The authorization token.

Success response:

  • subscriptionId A handle identifying notification messages associated with the subscription.
  • timestamp The start time for the subscription period.

5.1.4 Unsubscribe

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:

5.1.5 Subscription

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:

  • subscriptionId Handle identifying the subscription.
  • value The value(s) associated with the node(s) being addressed in the subscribe request.
  • timestamp The time for the trigger activation.

5.2 Error Information

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.

5.2.1 Error Format

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.

  • number See VISSv2:TRANSPORT, "Status code" chapter.
  • reason See VISSv2:TRANSPORT, "Status code" chapter.
  • message See VISSv2:TRANSPORT, "Status code" chapter.

5.3 Timestamps

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.

6. Security

6.1 Transport security

Transport protocols supported by this specification MUST make use of TLS as defined in [RFC5246].

6.2 Data security

The § 8. Access Control Model makes it possible to apply restrictions on the data access for clients that are granted access on the transport protocol level.

6.3 Privacy

In addition to some privacy provisions within the specification itself, the W3C Automotive Working Group is creating an accompanying In-Vehicle Application Best Practices document to provide further considerations for handling of information. These Best Practices go beyond the narrow scope of this specification and addresses several of the concerns for the broader telematics ecosystems it is a part of. These practices include reducing ability to fingerprint an individual or vehicle from its data, providing data use consent, revokation, integrity and use audit accountability.

For some uses, such as when information is only referenced within the vehicle not sent off nor persisting between restarts, there should be little to no privacy concerns.

This specification, unlike its predecessor, has granular access control capabilities to limit what information an application may access. All information sent from a VISS service to client application must be transported over an encrypted protocol to help protect privacy.

For an application to be installed and permitted to run on a vehicle it should have consent from whoever is deemed authoritative for a given jurisdiction and ownership situation. That consent should be revocable. Consent and revoking it are outside the scope of this specification, we expect that to be handled out of band and in some cases by regulations and contractual commitments. Future version of this specification however may provide mechanism for enabling and suspending application authorization to access information.

7. Filter Request

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

where
The JSON expression has the object format as shown below. For the case of an optional second object of this type, these are enclosed in an array expression.
where
In the JSON object, the key-value pairs "op-type" and "op-value" must always be present, while the "op-extra" presence depends on the "op-type" value. The JSON expression may consist of maximum one object with op-type "paths", plus maximum one object with op-type "capture", which are then logically combined as with an AND operator.
The server SHALL support all combinations up to this maximum.
The capture types (time-based, range, change, curve-logging) are only applicable for subscription requests. Subscription requests are only supported by the websocket transport protocol.
The restriction on how many objects that can be combined is also set by the URL size restriction on 1k characters (*).
(*) 1k is the "conservative limit, which should always be supported, a more liberal limit is 2k, which is supported in most cases.

7.1 Paths Filter Operation

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.

7.2 History Filter Operation

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.

7.3 Capture Filter Operation

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 supported logical operators are ["eq", "ne", "gt", "gte", "lt", "lte"], where "eq" is "equal", "ne" is "not equal", "gt" is "greater than", "gte" is "greater than or equal", "lt" is "less than", "lte" is "less than or equal".
Examples can be found in the TRANSPORT specification.

7.4 Metadata Filter Operation

Metadata requests are used when the client instead of the data associated to VSS node(s) wants to retrieve meta data associated to the VSS node(s).
Two categories of metadata are defined, "static-metadata" and "dynamic-metadata". The former contains the metadata found in the VSS tree as specified on the VSS repo, while the latter contains metadata that is additional to the referred VSS specification.
The client selects which of the categories that is requested by setting the "op-value" to either "static" or "dynamic". These requests are sometimes referred to as a signal discovery request. The "dynamic-metadata" may change over time, which is not the case for the "static-metadata". If the "op-extra" key value pair is not used, then all metadata that the server can retrieve for the respective category is returned, while if it used then only the selected metadata as expressed in the "op-extra" is returned. If the expression contains multiple metadata types, then they are concatenated with a plus sign (+) as delimiter.

For the set of static metadata key names, see the Vehicle Signal Specification.

The set of dynamic metadata keynames are found in the list below. If a corresponding value to a key name is not present, the key-value pair is omitted in the response.

A metadata request can be combined with a paths filter operation to address multiple nodes, but not with a capture filter operation.
The response is a JSON formatted object with corresponding key-value pairs per addressed node.
Examples can be found in the TRANSPORT specification.

7.5 Multiple Signals Request

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.

7.5.1 Error Handling

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.

7.5.2 Response syntax

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.

  • Request for a single value from a single node.
  • Request for multiple values from a single node.
  • Request for a single value from multiple nodes.
  • Request for multiple values from multiple nodes.
The syntax to accomodate these four cases have a common structure where a data point ("dp") consists of one or more objects containing a "value" and a timestamp ("ts"), and the complete aggregation ("data"), consists of one or more objects containing a "path" and a data point (dp"). The syntax of the four cases are shown below.

		“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.

7.5.3 Subscription Notification Triggering

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.

8. Access Control Model

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.

8.1 Architecture

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.

VISSv2 abstract protocol flow.
Figure 2 The abstract protocol flow.
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.

8.2 Protocol Flows

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 more often to obtain a new access grant token.
A client selects the type of flow by either submitting a public key in the access grant request, or not. The latter leading to an short term flow.

8.3 Protocol Messages

This section is non-normative.
This chapter describes the payloads of the messages used in the protocol flow.

8.3.1 Access Grant Request

The request shall contain the first three parameters below, the last is optional:

  • VIN: The vehicle identification number. This may be a pseudo-VIN, or any other identity that uniquely links to the vehicle in the access control ecosystem.
  • Context: The context associated to the client. The context consists of a triplet of roles for user, app permissions, and device characteristics.
  • Proof: A proof mechanism that is used by the client to attest its context to the access grant server. This is indeed a composed proof for the User role, app permissions, and device characteristics.
  • Public key: If this parameter is present, the client will receive a long term access grant token in return.

Depending on the kind of proofs included in the request, the client and the server may need to run an interactive protocol to verify them. The protocol may involve also third parties, such as the ecosystem manager or the resource owner. The protocol is out of scope for this specification.

8.3.2 Access Grant Response

The response shall contain the parameter below:

The response for a successful access grant request is a short or long term access grant token, depending on the input in the request message. The only difference between both kind of tokens is that long term access grant token would include the public key used in the request.
The access grant token is a digitally signed document issued by the access grant server including all relevant information needed to issue access tokens.

An error response shall contain the parameter:

  • Error code: The error code shall be informative in order for the client to understand what it needs to correct to become successful.

8.3.3 Access Token Request

The request shall contain at least these two parameters below:

  • Access grant token: A signed token with claims needed for the validation of the client request.
  • Purpose: The intended client usage of the requested data.
Short term access grant tokens can be used as direct input to the access token server, but long term access grant tokens should be accompanied by a proof of possession (PoP) for the private key corresponding to the public key included in the token.

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 access grant token and purpose.

8.3.4 Access Token Response

A successful response shall contain the parameter:

  • Access token: The token to be used in client requests to the VISSv2 server for Protected Resources.
An error response shall contain the parameter:
  • Error code: The error code shall be informative in order for the client to understand what it needs to correct to become successful.

8.3.5 Protected Resource Request

This is a VISSv2 request including an access token as described in general in the § 5.1 Methods chapter, and for different transport protocols in the VISSv2 TRANSPORT document.

8.3.6 Protected Resource Response

This is a VISSv2 response as described in general in the § 5.1 Methods chapter, and for different transport protocols in the VISSv2 TRANSPORT document. It does not differ from the response to an unprotected resource request.

8.4 Actors

8.4.1 Client

This section is non-normative.
The client is an abstract representation of three sub-actors:

  • The device. It is in charge of running the Apps that make requests to the VISSv2 server
  • The app. It runs requests on behalf of the user.
  • The user. It delegates access rights to the app.
All the information regarding the client is encoded in the context of the request.

8.4.2 Access Grant Server

This section is non-normative.
The access arant server is in charge of producing access grant tokens to clients.
Depending on the capabilities of the client, the specification supports two types of access grant tokens: Short term and long term access grant 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 access grant server more often before access token server requests for an access token.
The client request shall contain the following:

If the client needs a long term access grant token, then the request shall also contain:
  • A public key.
The Vehicle identification number shall be for the vehicle that the client wants to access.
The client context contains all relevant information from the client, i.e. for each of the three sub-actors that the client represents.
The proofs are to be used for verifying the client context.
The public key shall be generated by the client, and the associated private key must be under control of the client.

The main responsibilities of the access grant server are:
  • To verify the client context, and assess that their respective role request can be granted.
  • To check that the vehicle represented by the VIN belong to this Ecosystem, and is accessible.
  • To create an access grant token.
The proofs may include certificates from a Certificate Authority known by the access grant server. For example, users might authenticate themselves using X.509 identity certificates and roles might be issued using attribute certificates. In those cases, as part of the authentication protocol, the access grant server shall also validate the certificates signatures.
The access grant server may contact the ecosystem manager for checking the VIN.
The access grant token generation is defined in the corresponding chapter.

8.4.3 Access Token Server

This section is non-normative.
The client shall after a successful interaction with the access grant server request an access token from the access token server. The client request shall contain at least these two parameters below.

For long term access grant tokens, i.e. those including a public key, the client must also include a proof of possession, for the corresponding private key, in the request.
The purpose must be supported by the ecosystem manager, and thus be on the purpose list. The purpose list associates a set of accessible signals to the purpose, thus realizing the principle of least privilege.
The main responsibilities of the access token server are: The validation of the access grant token consists of at least the following:
  • Signature validation.
  • Expiry time check.
Additionally, for long term access grant tokens, the access token server needs to verify the proof of possession using the public key contained in the token.
The access grant token signature validation is done with the access grant server public key.
To allow for some time synchronization inaccuracy and minor network latency, expiry times should be set to include potential modest margin of error, possibly as long as tens of seconds.
If the client context as declared in the access grant token does not match in the set of allowed roles for the requested purpose in the purpose list, then the client request for an access token must be denied.

8.4.4 Access Control Server

The VISSv2 server MUST support validation of access tokens. The functionality needed for this is decribed in this chapter. This includes validation of at least the following:

  • Token signature.
  • Token expiry time.
  • Token scope.
  • Token access mode.
If any of the mentioned validations above fail, the server MUST reject the access request.
Token signature validation may be delegated to the access token server, if a secure communication link can be established. If not delegated, then a preprovisioned common secret may be shared with the access token server, or other PKI based solutions may be used.
The VISSv2 server SHALL have access to a secure system time, that cannot be modified by actors without system acknowledged credentials. Time validation may allow for a time synchronization inaccuracy in the range of tens of seconds.
A successful scope validation requires that all the nodes addressed by the path in the request MUST be matched by the paths associated with the purpose in the scope claim of the access token.
Validation of the device and app roles may involve MAC address checks, or message round-trip measurements.
The access mode validation MUST have the outcome shown in the table below, when comparing the type of the client request with the access control mode in the purpose list that is associated to the scope claim in the access token. If the client request contains several signals, and one fails the validation, then the entire request MUST be rejected.

ValidationRead-onlyRead-write
get
set
subscribe
OkOk
NokOk
OkOk

The access token need to be refreshed periodically, which is controlled by the expiry time. If the access grant token that the client used to obtain the now expired access token is not expired, then the client can revisit the access token server with this access grant token to obtain a new access token.
If the access grant token is expired, then the client must obtain a new access grant token first, before revisiting the access token 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.

8.4.5 Resource Owner

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.

8.4.6 Ecosystem Manager

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.

8.5 Credentials

8.5.1 Client Authentication

This section is non-normative.
The three client sub-actors must provide authentication credentials to the access grant server. This may be certificates that the sub-actors have obtained from a Certificate Authority that is known by the access grant server. The interactions related to this are out of scope.

8.5.2 Access Grant Token

This section is non-normative.

8.5.2.1 Short Term Access Grant Token

The short term access grant token shall have the following claims in header and payload.

          
	  {
            "alg": "ES256",
            "typ": "JWT"
          },
          {
            "vin": "vehicle-id",
            "iat": 1609452095,
            "exp": 1609459199,
            "clx": "user+app+dev",
            "aud": "w3.org/VISSv2",
            "jti": "5967e92e-40e8-5f39-892d-cc0da890db1d"
          }
Algorithm (alg) shall be set to a valid RSA or ECDSA algorithms according to [RFC7518].
Type (typ) shall be set to "JWT".
VIN (vin) shall be set to the vehicle identity provided by the client.
Issued at (iat) shall be set to the time of token issuance, in Unix time.
Expiry (exp) shall be set to the time when the token expires, in Unix time.
Client context (clx) shall be set to the role triplet the client has been assigned. The delimiter separating the roles is a plus sign (+).
Audience (aud) shall be set to the URL "w3.org/VISSv2".
JWT ID (jti) shall be set to a UUID that is unique within the domain controlled by the ecosystem manager.

8.5.2.2 Long Term Access Grant Token

The long term access grant token shall have the following claims in header and payload.

          
	  {
            "alg": "ES256",
            "typ": "JWT"
          },
          {
            "vin": "vehicle-id",
            "iat": 1609452095,
            "exp": 1609459199,
            "clx": "user+app+dev",
            "pub": client_pub_key,
            "aud": "w3.org/VISSv2",
            "jti": "5967e92e-40e8-5f39-892d-cc0da890db1d"
          }
Algorithm (alg) shall be set to a valid RSA or ECDSA algorithms according to [RFC7518].
Type (typ) shall be set to "JWT".
VIN (vin) shall be set to the vehicle identity provided by the client.
Issued at (iat) shall be set to the time of token issuance, in Unix time.
Expiry (exp) shall be set to the time when the token expires, in Unix time.
Client context (clx) shall be set to the role triplet the client has been assigned. The delimiter separating the roles is a plus sign (+).
Public key (pub) shall be set to the public key that the client provided in the access grant request, using the JSON Web Key (JWK) data structure [RFC7517].
Audience (aud) shall be set to the URL "w3.org/VISSv2".
JWT ID (jti) shall be set to a UUID that is unique within the domain controlled by the ecosystem manager.

8.5.3 Access Token

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].
Type (typ) shall be set to "JWT".
Issued at (iat) shall be set to the time of token issuance, in Unix time.
Expiry (exp) shall be set to the time when the token expires, in Unix time.
Scope (scp) shall be set to the purpose list short name, which logically links to the signal scope as defined in the purpose list.
Client context (clx) shall be set to the role triplet the client has been assigned. The delimiter separating the roles is a plus sign (+).
Audience (aud) shall be set to the URL "w3.org/VISSv2".
JWT ID (jti) shall be set to a UUID that is unique within the domain controlled by the ecosystem manager.

8.5.4 Proof of Possession

This section is non-normative.

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 design goals for the long term access grant token.

8.6 Client Context

This section is non-normative.
The client actor is characterized by three subactors:

Each of these subactors is in turn characterized by a role, building on the concept of a Role Based Access Control (RBAC) model. The set of these three roles is called the Client context.
VISSv2 specifies a rudimentary list of roles for each subactor, it is expected that these lists are augmented by the ecosystem manager, hopefully in a cooperative effort.
Using an RBAC model provides the following main purposes in the VISSv2 access control model: The access grant server must in the authentication process of the client possibly separately authenticate each of the three subactors. For the access grant server to decide on which authentication method to use per subactor can be quite complex, but may be somewhat eased by the client request for roles for each subactor.
Following the principle of least priviledge, a client should not have access to more vehicle signals than necessary. This is achieved by the purpose list, that assigns only the for the purpose relevant signals to the client.

8.6.1 User Roles

VISSv2 specifies the following minimum set of roles for users:

  • OEM
  • Dealer
  • Independent
  • Owner
  • Driver
  • Passenger
An OEM user is anyone representing the vehicle brand.
A Dealer user is anyone representing a normally OEM affiliated organisation that provide sale and workshop services for the vehicle.
An Independent user is anyone representing a normally OEM independent organisation that provide after-market services for the vehicle.
An Owner user is anyone representing the organisation owning the vehicle.
A Driver user is anyone driving the vehicle.
A Passenger user is anyone travelling in the vehicle, but not being the Driver.

8.6.2 Application Roles

VISSv2 specifies the following minimum set of roles for applications:

  • OEM
  • Third party
An OEM application role is used for applications that are pre-installed in the vehicle by the OEM, or later OEM-provisioned to the vehicle.
A Third party application role is used for applications that are "certified" for vehicle deployment, but developed by a third party.

8.6.3 Device Roles

VISSv2 specifies the following minimum set of roles for devices:

  • Vehicle
  • Nomadic
  • Cloud
A Vehicle role is used for applications that are deployed in-vehicle, in e. g. the center stack ECU.
A Nomadic role is used for applications that are deployed in a user's mobile phone, laptop, etc, that uses short range radio communication like Bluetooth, or WiFi.
A Cloud role is used for applications that are deployed in off-vehicle devices, and uses a long range radio communication like cellular in the connection to the vehicle.

8.7 Policy Documents

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.

8.7.1 Purpose List

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 purpose description, which may be used in the dialogue for consent, if needed. Then there is a list of the client context, 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 access token server. The protocol for this is out-of-scope. The access token server must reject all requests for access tokens if it is not in possession of a purpose list.

8.7.2 Scope 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 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 access token server. The protocol for this is out-of-scope. The access token server shall not restrict the scope for any client context if it is not in possession of a scope list.

8.8 Access Control Selection

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 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".

Access control selection tagging.
Figure 3 Access control selection tagging.
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.
Access control selection model.
Figure 4 Access control selection model.
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.

A. List of Figures

B. References

B.1 Normative references

[ISO8601]
Representation of dates and times. ISO 8601:2004.. International Organization for Standardization (ISO). 2004. ISO 8601:2004. URL: http://www.iso.org/iso/catalogue_detail?csnumber=40874
[RFC2119]
Key words for use in RFCs to Indicate Requirement Levels. S. Bradner. IETF. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119
[RFC3986]
Uniform Resource Identifier (URI): Generic Syntax. T. Berners-Lee; R. Fielding; L. Masinter. IETF. January 2005. Internet Standard. URL: https://www.rfc-editor.org/rfc/rfc3986
[RFC5246]
The Transport Layer Security (TLS) Protocol Version 1.2. T. Dierks; E. Rescorla. IETF. August 2008. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc5246
[RFC6455]
The WebSocket Protocol. I. Fette; A. Melnikov. IETF. December 2011. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc6455
[RFC6749]
The OAuth 2.0 Authorization Framework. D. Hardt, Ed.. IETF. October 2012. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc6749
[RFC7517]
JSON Web Key (JWK). M. Jones. IETF. May 2015. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc7517
[RFC7518]
JSON Web Algorithms (JWA). M. Jones. IETF. May 2015. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc7518
[RFC7800]
Proof-of-Possession Key Semantics for JSON Web Tokens (JWTs). M. Jones; J. Bradley; H. Tschofenig. IETF. April 2016. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc7800
[RFC8174]
Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words. B. Leiba. IETF. May 2017. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc8174