Skip to content

Commit a399639

Browse files
committed
Fix conditional public URL check
The containerClient was not exposed by the adapter.
1 parent b9d8135 commit a399639

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/AzureStorageBlobAdapter.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@
1616
*/
1717
final class AzureStorageBlobAdapter extends FilesystemAdapter
1818
{
19+
20+
/**
21+
* Whether the configuration of this adapter allows temporary URLs.
22+
*/
23+
public bool $canProvideTemporaryUrls;
24+
1925
/**
2026
* @param array{connection_string: string, container: string, prefix?: string, root?: string} $config
2127
*/
2228
public function __construct(array $config)
2329
{
2430
$serviceClient = BlobServiceClient::fromConnectionString($config['connection_string']);
2531
$containerClient = $serviceClient->getContainerClient($config['container']);
32+
$this->canProvideTemporaryUrls = $containerClient->sharedKeyCredentials instanceof StorageSharedKeyCredential;
2633
$adapter = new AzureBlobStorageAdapter($containerClient, $config['prefix'] ?? $config['root'] ?? '');
2734

2835
parent::__construct(
@@ -44,7 +51,7 @@ public function url($path)
4451
*/
4552
public function providesTemporaryUrls()
4653
{
47-
return $this->adapter->containerClient->sharedKeyCredentials instanceof StorageSharedKeyCredential;
54+
return $this->canProvideTemporaryUrls;
4855
}
4956

5057
/**

0 commit comments

Comments
 (0)