Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

Expand All @@ -15,13 +15,13 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
node-version: [20.x, 22.x, 24.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
Expand Down
14 changes: 11 additions & 3 deletions packages/oc-azure-storage-adapter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import {
BlobServiceClient,
type ContainerClient,
StorageSharedKeyCredential,
type BlockBlobUploadOptions
type BlockBlobUploadOptions,
type AnonymousCredential
} from '@azure/storage-blob';
import Cache from 'nice-cache';
import fs from 'fs-extra';
import { DefaultAzureCredential } from '@azure/identity';
import { DefaultAzureCredential, TokenCredential } from '@azure/identity';
import nodeDir, { type PathsResult } from 'node-dir';
import { promisify } from 'util';
import {
Expand Down Expand Up @@ -58,6 +59,11 @@ export interface AzureConfig extends StorageAdapterBaseConfig {
* to Azure's default credential chain (`DefaultAzureCredential`). Optional.
*/
accountKey?: string;

credential?:
| StorageSharedKeyCredential
| AnonymousCredential
| TokenCredential;
}

export default function azureAdapter(conf: AzureConfig): StorageAdapter {
Expand Down Expand Up @@ -86,7 +92,9 @@ export default function azureAdapter(conf: AzureConfig): StorageAdapter {
`https://${conf.accountName}.blob.core.windows.net`,
conf.accountName && conf.accountKey
? new StorageSharedKeyCredential(conf.accountName, conf.accountKey)
: new DefaultAzureCredential()
: conf.credential
? conf.credential
: new DefaultAzureCredential()
);
publicClient = client.getContainerClient(conf.publicContainerName);
privateClient = client.getContainerClient(conf.privateContainerName);
Expand Down
Loading