@oino-ts/blob-azure 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,7 +42,7 @@ class OINOBlobAzure extends blob_1.OINOBlob {
42
42
  _containerClient = null;
43
43
  constructor(params) {
44
44
  super(params);
45
- if ((!this.blobParams.credentials?.connectionStr) && !(this.blobParams.credentials?.url)) { // && this.blobParams.credentials?.clientId)) {
45
+ if ((!this.blobParams.credentials?.connectionStr) && !(this.blobParams.credentials?.url)) {
46
46
  throw new Error("OINOBlobAzure: missing or invalid credentials (provide either connectionStr or url and clientId)");
47
47
  }
48
48
  }
@@ -58,7 +58,7 @@ class OINOBlobAzure extends blob_1.OINOBlob {
58
58
  }
59
59
  else if (this.blobParams.credentials?.url) { // && this.blobParams.credentials?.clientId) {
60
60
  // Use ContainerClient directly to avoid double-container path when combining service URL + container
61
- serviceClient = new storage_blob_1.BlobServiceClient(this.blobParams.credentials.url, new identity_1.DefaultAzureCredential());
61
+ serviceClient = new storage_blob_1.BlobServiceClient(this.blobParams.credentials.url, new identity_1.DefaultAzureCredential({ managedIdentityClientId: this.blobParams.credentials.clientId }));
62
62
  this.isConnected = true;
63
63
  }
64
64
  this._containerClient = serviceClient.getContainerClient(this.blobParams.container);
@@ -39,7 +39,7 @@ export class OINOBlobAzure extends OINOBlob {
39
39
  _containerClient = null;
40
40
  constructor(params) {
41
41
  super(params);
42
- if ((!this.blobParams.credentials?.connectionStr) && !(this.blobParams.credentials?.url)) { // && this.blobParams.credentials?.clientId)) {
42
+ if ((!this.blobParams.credentials?.connectionStr) && !(this.blobParams.credentials?.url)) {
43
43
  throw new Error("OINOBlobAzure: missing or invalid credentials (provide either connectionStr or url and clientId)");
44
44
  }
45
45
  }
@@ -55,7 +55,7 @@ export class OINOBlobAzure extends OINOBlob {
55
55
  }
56
56
  else if (this.blobParams.credentials?.url) { // && this.blobParams.credentials?.clientId) {
57
57
  // Use ContainerClient directly to avoid double-container path when combining service URL + container
58
- serviceClient = new BlobServiceClient(this.blobParams.credentials.url, new DefaultAzureCredential());
58
+ serviceClient = new BlobServiceClient(this.blobParams.credentials.url, new DefaultAzureCredential({ managedIdentityClientId: this.blobParams.credentials.clientId }));
59
59
  this.isConnected = true;
60
60
  }
61
61
  this._containerClient = serviceClient.getContainerClient(this.blobParams.container);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oino-ts/blob-azure",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "OINO TS package for using Azure Blob Storage as a REST API.",
5
5
  "author": "Matias Kiviniemi (pragmatta)",
6
6
  "license": "MPL-2.0",
@@ -22,11 +22,11 @@
22
22
  "dependencies": {
23
23
  "@azure/storage-blob": "^12.0.0",
24
24
  "@azure/identity": "^3.0.0",
25
- "@oino-ts/blob": "1.0.4",
26
- "@oino-ts/common": "1.0.4"
25
+ "@oino-ts/blob": "1.0.5",
26
+ "@oino-ts/common": "1.0.5"
27
27
  },
28
28
  "devDependencies": {
29
- "@oino-ts/types": "1.0.4",
29
+ "@oino-ts/types": "1.0.5",
30
30
  "@types/bun": "^1.1.14",
31
31
  "@types/node": "^22.0.00",
32
32
  "typescript": "~5.9.0"
@@ -47,7 +47,7 @@ export class OINOBlobAzure extends OINOBlob {
47
47
 
48
48
  constructor(params: OINOBlobParams) {
49
49
  super(params)
50
- if ((!this.blobParams.credentials?.connectionStr) && !(this.blobParams.credentials?.url)) { // && this.blobParams.credentials?.clientId)) {
50
+ if ((!this.blobParams.credentials?.connectionStr) && !(this.blobParams.credentials?.url)) {
51
51
  throw new Error("OINOBlobAzure: missing or invalid credentials (provide either connectionStr or url and clientId)")
52
52
  }
53
53
  }
@@ -66,7 +66,7 @@ export class OINOBlobAzure extends OINOBlob {
66
66
  // Use ContainerClient directly to avoid double-container path when combining service URL + container
67
67
  serviceClient = new BlobServiceClient(
68
68
  this.blobParams.credentials.url,
69
- new DefaultAzureCredential()
69
+ new DefaultAzureCredential({ managedIdentityClientId: this.blobParams.credentials.clientId })
70
70
  )
71
71
  this.isConnected = true
72
72
  }