feat(repositories): azure blob storage

This commit is contained in:
Nicolas Meienberger
2025-11-10 21:07:12 +01:00
parent e98c0af8ca
commit ff7f6ffad9
5 changed files with 172 additions and 6 deletions

View File

@@ -25,6 +25,9 @@ const encryptConfig = async (config: RepositoryConfig): Promise<RepositoryConfig
case "gcs":
encryptedConfig.credentialsJson = await cryptoUtils.encrypt(config.credentialsJson);
break;
case "azure":
encryptedConfig.accountKey = await cryptoUtils.encrypt(config.accountKey);
break;
}
return encryptedConfig as RepositoryConfig;

View File

@@ -76,6 +76,8 @@ const buildRepoUrl = (config: RepositoryConfig): string => {
return `s3:${config.endpoint}/${config.bucket}`;
case "gcs":
return `gs:${config.bucket}:/`;
case "azure":
return `azure:${config.container}:/`;
default: {
throw new Error(`Unsupported repository backend: ${JSON.stringify(config)}`);
}
@@ -101,6 +103,14 @@ const buildEnv = async (config: RepositoryConfig) => {
env.GOOGLE_APPLICATION_CREDENTIALS = credentialsPath;
break;
}
case "azure": {
env.AZURE_ACCOUNT_NAME = config.accountName;
env.AZURE_ACCOUNT_KEY = await cryptoUtils.decrypt(config.accountKey);
if (config.endpointSuffix) {
env.AZURE_ENDPOINT_SUFFIX = config.endpointSuffix;
}
break;
}
}
return env;