Skip to content

Commit 3f6e64a

Browse files
committed
Fix missing host reader
1 parent 269f206 commit 3f6e64a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/azure_blob/entra_id_signer.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module AzureBlob
1212
class EntraIdSigner # :nodoc:
1313
attr_reader :token
1414
attr_reader :account_name
15+
attr_reader :host
1516

1617
def initialize(account_name:, host:, principal_id: nil)
1718
@token = AzureBlob::IdentityToken.new(principal_id:)

test/client/test_user_delegation_key.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
require_relative "test_helper"
44

55
class TestUserDelegationKey < TestCase
6-
attr_reader :delegation_key
6+
attr_reader :delegation_key, :account_name, :principal_id, :signer, :host
77
def setup
88
skip if using_shared_key
99
@account_name = ENV["AZURE_ACCOUNT_NAME"]
1010
@principal_id = ENV["AZURE_PRINCIPAL_ID"]
11-
@signer = AzureBlob::EntraIdSigner.new(account_name: @account_name, principal_id: @principal_id)
12-
@delegation_key = AzureBlob::UserDelegationKey.new(account_name: @account_name, signer: @signer)
11+
@host = "https://#{account_name}.blob.core.windows.net"
12+
@signer = AzureBlob::EntraIdSigner.new(account_name:, principal_id:, host:)
13+
@delegation_key = AzureBlob::UserDelegationKey.new(account_name:, signer:)
1314
end
1415

1516
def test_do_not_refresh_under_expiration_buffer
1617
now = Time.now
1718
five_hours = 18000
1819
Time.stub :now, now do
19-
@delegation_key = AzureBlob::UserDelegationKey.new(account_name: @account_name, signer: @signer)
20+
@delegation_key = AzureBlob::UserDelegationKey.new(account_name:, signer:)
2021
end
2122
initial_expiry = @delegation_key.signed_expiry
2223

@@ -31,7 +32,7 @@ def test_refresh_when_over_expiration_buffer
3132
now = Time.now
3233
after_expiration_buffer = now + 21601
3334
Time.stub :now, now do
34-
@delegation_key = AzureBlob::UserDelegationKey.new(account_name: @account_name, signer: @signer)
35+
@delegation_key = AzureBlob::UserDelegationKey.new(account_name:, signer:)
3536
end
3637

3738
initial_expiry = delegation_key.signed_expiry

0 commit comments

Comments
 (0)