-
Notifications
You must be signed in to change notification settings - Fork 94
Add subscription permission by source and name #1043
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
base: main
Are you sure you want to change the base?
Conversation
|
@@ -353,8 +353,10 @@ message SubscriptionPermission { | |||
|
|||
message SubscriptionPermissionUpdate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, this is the wrong message 🤦
@@ -353,8 +353,10 @@ message SubscriptionPermission { | |||
|
|||
message SubscriptionPermissionUpdate { | |||
string participant_sid = 1; | |||
string track_sid = 2; | |||
string track_sid = 2 [deprecated = true]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a response message, shouldn't this be in request?
Also, checking with a customer about this also. Maybe, keep track_sid
also? I am on the fence too on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha jinx, commented above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keeping track_sid
seems like a footgun now that we always generate new track ids on republish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the SubscriptionPermissionUpdate
sent from the server down still translate to track_sid
in the response?
or should we match the tracks client side also by source and/or name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah true, I am just trying to think if it will be useful in any situation as that gives a very specific thing and that is already in the system.
Tracks can be published without having a source or name. But, track_sid is always there.
I cannot think of a case, but just feels like there is something that would need that specificity. We can remove and bring it back later if needed I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the
SubscriptionPermissionUpdate
sent from the server down still translate totrack_sid
in the response? or should we match the tracks client side also by source and/or name?
jinx again, I was adding a note about it too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the SubscriptionPermissionUpdate sent from the server down still translate to track_sid in the response?
ideally both server/client would only have to think about name/source for permissions but idk if we can do this without breaking the api...? also to Raja's point even though we're deprecating this i don't think we're going to clean up the code immediately and if customers have use cases that the new model doesn't support we'll get push-back.
…l into lukas/source-subscr-perm
@@ -340,10 +340,12 @@ message SubscribedQualityUpdate { | |||
|
|||
message TrackPermission { | |||
// permission could be granted either by participant sid or identity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change comment if participant_sid
is marked deprecated?
@@ -353,8 +355,10 @@ message SubscriptionPermission { | |||
|
|||
message SubscriptionPermissionUpdate { | |||
string participant_sid = 1; | |||
string track_sid = 2; | |||
string track_sid = 2 [deprecated = true]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe not deprecate here. This is just an info message. It can have the current SID server sees. Also not sure if we want to include source/name in this message. I guess we can, but not sure if it is needed. It is optional
, but if unused, might as well not have it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not purely informational, we also use it client side to setAllowed
on publications: https://github.com/livekit/client-sdk-js/blob/0c1c18cce46ec5e78c50912277b378fae04997f1/src/room/Room.ts#L1723-L1734
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah true, so I guess having SID is a good thing then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have an opinion on whether or not track_sid should stay here, it's just an additional step for the server to translate between source + name on the request to the trackSid
string participant_identity = 4; | ||
repeated TrackSource track_sources = 5; | ||
repeated string track_names = 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make this another message to have source, name
pairing explicit. If both are repeated and if we are doing intersection match, we would have to check all combinations of the two and allow it. Is that the intention? Or should we have explicit pairs (and the fields inside the pairing can be optional)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, that's a good point!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it doesn't even have to be repeated 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a repeated pairing makes sense. That will allow something like camera, front
and mic, back
to be allowed, but not permitting camera, back
, mic, front
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it has to be repeated to support multiple sources...?
allowed: [{source: MIC}, {source: CAM}, {etc...}]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
.. and deprecate trackSid based permissions.
allows for permissions that are stable across full reconnects, where usually the trackSid changes due to the tracks being republished.