Set Device Object To Optional - According to API Design Guidelines#298
Set Device Object To Optional - According to API Design Guidelines#298jlurien merged 6 commits intocamaraproject:mainfrom
Conversation
There was a problem hiding this comment.
Thanks @dfischer-tech for raising up this PR!
Could you please also update the info.description by adding the information about how to identify the device from the access-token:
# Identifying the device from the access token
This API requires the API consumer to identify a device as the subject of the API as follows:
- When the API is invoked using a two-legged access token, the subject will be identified from the optional `device` object, which therefore MUST be provided.
- When a three-legged access token is used however, this optional identifier MUST NOT be provided, as the subject will be uniquely identified from the access token.
This approach simplifies API usage for API consumers using a three-legged access token to invoke the API by relying on the information that is associated with the access token and was identified during the authentication process.
(see:
DeviceLocation/code/API_definitions/location-retrieval.yaml
Lines 73 to 77 in 5e81e4e
There was a problem hiding this comment.
If we opted to remove device as required in the request, we would need to remove it as well in the event contents. schemas AreaLeft, AreaEntered, SubscriptionEnds, and probably add some guideline that device must not be included in the event if not explicitly provided in the request
Hi @jlurien, "An identifier is not included in the request and the device or phone number identification cannot be derived from the 3-legged access token." Therefore, we do not need to explicitly remove it from the event contents (schemas: AreaLeft, AreaEntered, SubscriptionEnds), |
|
For a better understanding I would like to reference here as well to QualityOnDemand:
Means that we only would like to provide information about the device, if this was explicitly provided by the user.
If we are dealing with a 3-legged-token I aggree with @jlurien that we also have to remove the mandatory DeviceStatus is doing it the same to just provide the BasicDeviceEventData:
description: Event detail structure for basic device events
type: object
required:
- subscriptionId
properties:
device:
$ref: "#/components/schemas/Device"
subscriptionId:
$ref: "#/components/schemas/SubscriptionId" |
There was a problem hiding this comment.
@dfischer-tech , @maxl2287 The changes are OK, but we have to revert versions to wip and /vwip in the URL before merging (as in #303). At the same time, issue #302 could be fixed in this PR
@dfischer-tech @maxl2287 already merged |
What type of PR is this?
Add one of the following kinds:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #297
Changelog input
Additional documentation
None