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

Add support for variable account data type names #686

Closed
Frinksy opened this issue Aug 6, 2021 · 2 comments
Closed

Add support for variable account data type names #686

Frinksy opened this issue Aug 6, 2021 · 2 comments
Assignees
Milestone

Comments

@Frinksy
Copy link
Contributor

Frinksy commented Aug 6, 2021

MSC1946 introduced new events types. It is also now part of the unstable spec, here.
One of the new events is of type m.secret_storage.[key_ID] where [key_ID] is to be substituted by the ID of the key to store.
This means that there could be an arbitrary number of event type names to store keys, e.g. m.secret_storage.key_1, m.secret_storage.key_2, etc.

Also, it seems that secrets will be stored with entirely variable event type names (from here):

Encrypted data is stored in the user’s account_data using the event type defined by the feature that uses the data.

Currently, Ruma's macros only support event types with a fixed name. To support these new events with variable type names, ruma-events-macros needs to be refactored to allow this.

Although secret sharing is already being implemented in (#677), the secret storage part of the implementation is blocked, meaning #478 depends on this issue being resolved.

@jplatte
Copy link
Member

jplatte commented Feb 13, 2022

Actually, this is only needed for account data "events" that aren't really events in the first place. I will tackle this in conjunction with #732.

@jplatte jplatte changed the title Add support for variable event type names. Add support for variable account data type names# Mar 3, 2022
@jplatte jplatte changed the title Add support for variable account data type names# Add support for variable account data type names Mar 3, 2022
@jplatte
Copy link
Member

jplatte commented Mar 11, 2022

Note to self: EventType::Foo for a variable type will have to be EventType::Foo(String), which also means we'll need more derive code...

And this actually kind-of clashes with some earlier thoughts by myself to have the type be a DST wrapping str with associated constants. That could still work, but the nice matching wouldn't work that way, instead there would have to be some as_foo(&self) -> Option<&str> helpers.

@jplatte jplatte added this to the 0.6.0 milestone Mar 16, 2022
@jplatte jplatte closed this as completed Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants