Uh oh!
There was an error while loading. Please reload this page.
[ECO-4845] Fix wildcard clientId - #418
Conversation
1. Renamed rest auth extra_auth_headers to client_id_header with both rest/realtime specific impl 2. Added method client_id_header_sync to realtime auth 3. Annotated implementation with right spec
| def client_id_header(realtime=false) | ||
| if options[:client_id] && using_basic_auth? | ||
| if realtime | ||
| { 'clientId' => options[:client_id] } |
There was a problem hiding this comment.
For realtime connections the clientId is passed in the query params, not as a header - see RSA7e1
There was a problem hiding this comment.
I think by putting the realtime setting in a method that explicitly mentions header (even if its later put in the right place by subsequent code) is going to make things confusing
There was a problem hiding this comment.
Yeah, it's just a naming convention. I will try to make it more meaningful 👍
There was a problem hiding this comment.
As far as spec impl. is concerned, setting clientId for both realtime and rest follows exactly similar checks
spec- RSA7e
There was a problem hiding this comment.
maybe custom_client_id or external_client_id
There was a problem hiding this comment.
Yeah, perhaps we should just have a method which returns the client id to use in the request:
defclient_id_for_requestifoptions[:client_id] && using_basic_auth?returnoptions[:client_id]elsereturnnilendendand we update the existing extra_auth_headers method to call this, and update create_websocket_transport to call it?
There was a problem hiding this comment.
Cool, looks good to me — will leave to @AndyTWF to resolve if happy since it's his thread
lawrence-forooghian
commented
Jul 2, 2024
@sacOO7 is this a bug that only affects the v2 branch? If not, then shouldn't the fix go into |
ttypic
commented
Jul 2, 2024
@lawrence-forooghian there is no rush, this problem have been for a long time. Workaround on realtime side implemented for all version <= 1.2.5 |
Actually, this bug was caused by server side changes, so they have patched a fix that will work for ably-ruby <= 1.2.5 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| def client_id_header(realtime=false) | ||
| if options[:client_id] && using_basic_auth? | ||
| if realtime | ||
| { 'clientId' => options[:client_id] } |
There was a problem hiding this comment.
Yeah, perhaps we should just have a method which returns the client id to use in the request:
defclient_id_for_requestifoptions[:client_id] && using_basic_auth?returnoptions[:client_id]elsereturnnilendendand we update the existing extra_auth_headers method to call this, and update create_websocket_transport to call it?
…ce local members" This reverts commit c10e485.
sacOO7
commented
Jul 4, 2024
Thanks for the review |
Fixed#414