Skip to content

Commit

Permalink
renamed auth client_id_header to external_client_id
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Jun 25, 2024
1 parent c10e485 commit 0f49ede
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/ably/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ def auth_header
# Extra headers that may be used during authentication
# spec - RSA7e
# @return [Hash] headers
def client_id_header(realtime_params=false)
def external_client_id(realtime=false)
if options[:client_id] && using_basic_auth?
if realtime_params
if realtime
{ 'clientId' => options[:client_id] }
else
{ 'X-Ably-ClientId' => Base64.urlsafe_encode64(options[:client_id]) }
Expand Down
4 changes: 2 additions & 2 deletions lib/ably/realtime/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ def auth_header_sync
auth_sync.auth_header
end

def client_id_params_sync
auth_sync.client_id_header(true)
def external_client_id_sync
auth_sync.external_client_id(true)
end

# Auth params used in URI endpoint for Realtime connections
Expand Down
2 changes: 1 addition & 1 deletion lib/ably/realtime/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def create_websocket_transport
'false'
end

url_params.merge!(client.auth.client_id_params_sync) # RSA7e1
url_params.merge!(client.auth.external_client_id_sync) # RSA7e1
url_params.merge!(client.transport_params)

if !key.nil_or_empty? and connection_state_available?
Expand Down
2 changes: 1 addition & 1 deletion lib/ably/rest/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def send_request(method, path, params, options)
unless options[:send_auth_header] == false
request.headers[:authorization] = auth.auth_header
# RSA7e2
options[:headers].to_h.merge(auth.client_id_header).map do |key, val|
options[:headers].to_h.merge(auth.external_client_id).map do |key, val|
request.headers[key] = val
end
end
Expand Down

0 comments on commit 0f49ede

Please sign in to comment.