Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend url template variables with device_id #78

Merged
merged 3 commits into from
Mar 23, 2023

Conversation

Fox32
Copy link
Contributor

@Fox32 Fox32 commented Feb 21, 2023

I mentioned the need for this parameter in the related MSC 3891 which implements to device messages. They are relying on the device id to be available, but there is currently no way to access a device id from within a widget (Element Call does this but is cheating :P). Therefore I propose to include the device id in the available parameters.

I mentioned the need for this parameter in the related [MSC 3891 ](matrix-org/matrix-spec-proposals#3819) which implements to device messages. They are relying on the device id to be available, but there is currently no way to access a device id from within a widget (Element Call does this but is cheating :P). Therefore [I propose to include the device id in the available parameters](matrix-org/matrix-spec-proposals#3819 (comment)).

Signed-off-by: Oliver Sand <oliver.sand@nordeck.net>
@Fox32
Copy link
Contributor Author

Fox32 commented Feb 21, 2023

In case this gets merged: It would be helpful to have a new release of the widget-api, so that I can continue the implementation in the matrix-react-sdk.

@Fox32
Copy link
Contributor Author

Fox32 commented Feb 21, 2023

I would be open to switch from device_id to matrix_device_id to align with the other names, opinions? There are also parameters without a matrix_ prefix, but I think it would be a better match here.

Fox32 added a commit to nordeck/matrix-react-sdk that referenced this pull request Feb 21, 2023
Implement the [comment in MSC 3819](matrix-org/matrix-spec-proposals#3819 (comment)) which requests passing a device id to a widget.

This is based on the previous work in the matrix-widget-api: matrix-org/matrix-widget-api#78

Signed-off-by: Oliver Sand <oliver.sand@nordeck.net>
Fox32 added a commit to nordeck/matrix-react-sdk that referenced this pull request Feb 21, 2023
Implement the [comment in MSC 3819](matrix-org/matrix-spec-proposals#3819 (comment)) which requests passing a device id to a widget.

This is based on the previous work in the matrix-widget-api: matrix-org/matrix-widget-api#78

Signed-off-by: Oliver Sand <oliver.sand@nordeck.net>
@alunturner
Copy link

alunturner commented Feb 27, 2023

Hello, firstly sorry for the delay in getting to this.

I am really not familiar with this area of the codebase yet so I'll bow to @dbkr 's judgment on this, but commenting to try and get this moving for you.

On the device_id vs matrix_device_id I think I'd lean towards the former (ie without the matrix_ prefix) but aware I may be missing some context here. What do you think @dbkr ?

From my point of view I think this can be approved, I just haven't given it the tick due to my lack of knowledge here at the moment.

@Fox32
Copy link
Contributor Author

Fox32 commented Mar 7, 2023

I think a problem could be more the privacy perspective than the security. In general device ids are public information required to establish communication between users. Therefore they can be used to identify a user from the widget.

From the privacy perspective I think it is fine to pass the device id to the widget, especially as the user is asked first before loading an untrusted widget for the first time. The user sees the list of potential data that is shared with the widget and can decide whether he trusts the widget.

@benparsons benparsons added the A-Timesheet-1 Log any time spent on this into the A-Timesheet-1 project label Mar 20, 2023
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

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

I think this seems fine. I also agree that matrix_device_id is probably better to match the other matrix related things rather than client specific settings, so it would probably be good to change that. We should obviously note this on the MSC too.

In terms of security, I think the only concern is widgets now being able to track what device they're used on for each user, although in practical terms they'd likely be able to do this in most cases anyway just with a user agent string or similar. I don't think it's worth having a separate permission for it.

@dhenneke
Copy link
Contributor

@dbkr I renamed the parameter to matrix_device_id and also added a comment to the MSC that we changed the naming. After an approval and merge, I can create a PR in the react-sdk to pass the parameter into the templating function.

Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

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

Thanks!

@dbkr dbkr merged commit bd744d9 into matrix-org:master Mar 23, 2023
@dhenneke dhenneke deleted the nic/feat/device-id branch March 23, 2023 16:23
@dhenneke
Copy link
Contributor

dhenneke commented May 2, 2023

@dbkr, @t3chguy would it be possible to get a new release created? Then I could work on matrix-org/matrix-react-sdk#10209 so we get this finished.

@t3chguy
Copy link
Member

t3chguy commented May 5, 2023

@dhenneke
Copy link
Contributor

dhenneke commented May 5, 2023

Thanks

dhenneke pushed a commit to nordeck/matrix-react-sdk that referenced this pull request May 8, 2023
Implement the [comment in MSC 3819](matrix-org/matrix-spec-proposals#3819 (comment)) which requests passing a device id to a widget.

This is based on the previous work in the matrix-widget-api: matrix-org/matrix-widget-api#78

Signed-off-by: Oliver Sand <oliver.sand@nordeck.net>
github-merge-queue bot pushed a commit to matrix-org/matrix-react-sdk that referenced this pull request May 23, 2023
* Pass device id to widget

Implement the [comment in MSC 3819](matrix-org/matrix-spec-proposals#3819 (comment)) which requests passing a device id to a widget.

This is based on the previous work in the matrix-widget-api: matrix-org/matrix-widget-api#78

Signed-off-by: Oliver Sand <oliver.sand@nordeck.net>

* Include all data that is shared in the permissions screen

* Update matrix-widget-api to version 1.4.0

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

* Fix type and test

Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>

---------

Signed-off-by: Oliver Sand <oliver.sand@nordeck.net>
Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
Co-authored-by: Dominik Henneke <dominik.henneke@nordeck.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Timesheet-1 Log any time spent on this into the A-Timesheet-1 project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants