Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Subscribe to wildcard #688

Merged

Conversation

rafaeling
Copy link
Contributor

@rafaeling rafaeling commented Oct 19, 2023

Output after setting Vehicle.PowerOptimizeLevel and Vehicle.IsMoving signals:

Test Client> subscribeMultiple Vehicle.*
{
    "subscriptionId": "f5c6544f-f93d-4ef8-9532-5f537eb5a179"
}

[
  {
    "entry": {
      "path": "Vehicle.IsMoving",
      "value": {
        "value": false,
        "timestamp": "2023-10-19T08:38:21.467527+00:00"
      }
    },
    "fields": [
      "VALUE"
    ]
  }
]

[
  {
    "entry": {
      "path": "Vehicle.PowerOptimizeLevel",
      "value": {
        "value": 5,
        "timestamp": "2023-10-19T08:38:53.230746+00:00"
      }
    },
    "fields": [
      "VALUE"
    ]
  }
]


@rafaeling rafaeling force-pushed the feature/subscribe_to_wildcard branch from 6f89dc3 to dcda394 Compare October 23, 2023 09:07
kuksa_databroker/databroker/src/grpc/kuksa_val_v1/val.rs Outdated Show resolved Hide resolved
@rafaeling rafaeling force-pushed the feature/subscribe_to_wildcard branch from 9d53465 to 62d213a Compare October 23, 2023 14:11
@rafaeling rafaeling marked this pull request as ready for review October 23, 2023 14:12
@argerus argerus dismissed their stale review October 23, 2023 14:32

Addressed

Copy link
Contributor

@argerus argerus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
If someone can run another hands on test, that would be good.

Copy link
Contributor

@SebastianSchildt SebastianSchildt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get and subscribe are inconsistent, if get is missing access to any datapoint it fails, while subscribe doesn't

Test Client> getValue Vehicle
{
    "error": {
        "code": 403,
        "reason": "forbidden",
        "message": "Permission denied for some entries"
    },
    "errors": [
        {
            "path": "Vehicle",
            "error": {
                "code": 403,
                "reason": "forbidden",
                "message": "Permission denied for some entries"
            }
        }
    ]
}

Test Client> subscribe Vehicle
{
    "subscriptionId": "7cdc6447-6bbd-4693-8e32-76bce9976d5c"
}

I think wildcard subscribe should only work of all datapoints can be read and compeltely fail otherwise. If there are reasons, why this is not the case, the behaviour still is not ideal. When I did the subscribe with a token that only allows to read Vehicle.Speed , setting this value works, however setting any other value, we are not allwoed to read, still triggers a response on the subscribe channel. That is defintely wrong, see how it looks in Client, when after subscribe setting Vehicle.Speed, and then some values in Vehicle.CurrentLocation

Doing this

"Authenticated"

Test Client> setValue Vehicle.Speed 22
OK

Test Client> setValue Vehicle.CurrentLocation.Latitude 27
OK

Test Client> setValue Vehicle.CurrentLocation.Latitude 24
OK

yields


Test Client> subscribe Vehicle
{
    "subscriptionId": "7cdc6447-6bbd-4693-8e32-76bce9976d5c"
}

[
  {
    "entry": {
      "path": "Vehicle.Speed",
      "value": {
        "value": 22.0,
        "timestamp": "2023-10-24T06:42:16.499781+00:00"
      }
    },
    "fields": [
      "VALUE"
    ]
  }
]

[]

[]

Test Client> 

@rafaeling rafaeling force-pushed the feature/subscribe_to_wildcard branch from 541c32a to dd0ecff Compare October 24, 2023 10:21
Copy link
Contributor

@SebastianSchildt SebastianSchildt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Behaves as expected. Checked wildcards and vanilla subscriptions and handling authorisation.

@SebastianSchildt SebastianSchildt merged commit d205bf2 into eclipse:master Oct 25, 2023
12 checks passed
@erikbosch erikbosch deleted the feature/subscribe_to_wildcard branch October 31, 2024 13:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants