-
Notifications
You must be signed in to change notification settings - Fork 3
Refactored RTN22, added missing details #259
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
Open
sacOO7
wants to merge
1
commit into
main
Choose a base branch
from
refactor/RTN22-spec
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
The spec specifies SDK behaviour. The added sentences don't have any requirements, they're background information. What are SDK devs expected to do differently as a result of this information?
Like: currently, the server does not guarantee that it sends an AUTH exactly 30 seconds before expiry, nor does it guarantee that it won't send one if you connect with a <30s token. Both things are at the server's discretion, and might change at any point. By putting this in the spec, we are saying that SDK devs should be able to rely on the current behaviour. Is that necessary? If so, for what purpose are they relying on 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.
laravel-echoclient is restricted to use protocol 2 or ably-js@1.x, can we still change the value from server side?Uh oh!
There was an error while loading. Please reload this page.
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.
If value can change in the future ( with certain max limit, say 1 minute ), I can update PR accordingly
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 never changed. But that's not really the point; the server has behaviours that it guarantees as part of its protocol and behaviours that are at its discretion, and we should only move something from the latter category to the former if there's a good reason to do so.
I'd like to understand why laravel-broadcaster needs to know how long before expiry it'll get an AUTH. I've looked at the linked PR but I don't have the context to understand what it's doing or why without that it's requesting a token without all the required capabilities. Could you explain?
Uh oh!
There was an error while loading. Please reload this page.
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.
Okay current laravel impl. goes as follows
publicchannels access. This means after token expiry, each channel will detach and will re-request token. This will cause presence enter/leave as customer explained -> https://ably-real-time.slack.com/archives/CURL4U2FP/p1733135454672739Uh oh!
There was an error while loading. Please reload this page.
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.
Also, about statement
Ably sends @AUTH@ @ProtocolMessage@ 30 seconds before the token expires. Note: If the token has a ttl less than 30 seconds, e.g. 5 seconds, ably won't be able to send @AUTH@ @ProtocolMessage@., This is useful for testing purposes ( mainly integration tests ).But if you feel, the value can change in the future, we can skip the change or mention that value can change in the future, WDYT
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 seems to me that this claim contradicts the change you've made in the PR.
If the point of having tokens expire is that the customer, via their auth server, must approve (i.e. have the ability to disapprove) every user's right to be in each private channel at least once per hour (or whatever period), then surely having the auth server automatically re-approve all permissions if the user's token is about to expire (without asking the customer) defeats that point.
(And if we don't believe that, if we think it's acceptable for the auth server to automatically re-issue the token with all its previous permissions if it's near expiry, then why not extend the expiry every time a new channel is added? But I don't think we do believe this; as you say that would defeat the point of token expiry).
Should the broadcaster not re-ask the customer to confirm permissions (using
verifyUserCanAccessChannel) for each non-public channel in the token if the token is near expiry (which would be something like, on any auth request with < 10 minutes to go, so including channel access requests made towards the end, not just 30 seconds), and then it can extend the expiry time without breaking the auth model?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.
Okay, I will give a thought about this and will get back 👍
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 seems sensible to verify for each non-public channel if the token is near expiry, before refreshing to new token with upgraded expiry. Will update PR accordingly in the future 👍
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.
Added TODO for the same ably/laravel-broadcaster#56 (comment)