Commit 908cd91c authored by Erik Leckner's avatar Erik Leckner
Browse files

file-azure

parent 34ae8143
......@@ -60,6 +60,7 @@ public class FileLocationEntityRepository {
if (entity == null) {
throw new IllegalArgumentException("The given file location entity is null");
}
// Internal set of id
entity.setId(entity.getFileID());
cosmosStore.upsertItem(headers.getPartitionId(), cosmosDBName, fileLocationContainer, entity);
return entity;
......
......@@ -46,10 +46,6 @@ public class StorageRepository implements IStorageRepository {
private String storageAccount = getStorageAccount();
public StorageRepository(Storage storage) {
this.storage = storage;
}
@Override
public SignedObject createSignedObject(String containerName, String filepath) {
log.debug("Creating the signed blob in container {} for path {}", containerName, filepath);
......
......@@ -40,6 +40,7 @@ import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.opengroup.osdu.file.provider.azure.common.base.MoreObjects;
import org.opengroup.osdu.file.provider.azure.service.AzureTokenServiceImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.inject.Inject;
......@@ -55,20 +56,21 @@ public class StorageImpl implements Storage {
private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
private static String clientSecret = System.getProperty("AZURE_CLIENT_SECRET", System.getenv("CLIENT_SECRET"));
private static String clientId = System.getProperty("AZURE_CLIENT_ID", System.getenv("CLIENT_ID"));
private static String tenantId = System.getProperty("AZURE_TENANT_ID", System.getenv("AZURE_AD_TENANT_ID"));
private static String azureStorageAccount = System.getProperty("AZURE_STORAGE_ACCOUNT", System.getenv("AZURE_STORAGE_ACCOUNT"));
@Value("${azure.client.secret}")
private String clientSecret;
private static String storageAccount;
@Value("${azure.client.id}")
private String clientId;
@Value("${azure.tenant.id}")
private String tenantId;
@Value("${azure_storage.account}")
private String storageAccount;
@Inject
AzureTokenServiceImpl token;
public StorageImpl() {
this.storageAccount = azureStorageAccount;
}
@Override
public Blob create(BlobInfo blobInfo, byte[] content) {
content = (byte[]) MoreObjects.firstNonNull(content, EMPTY_BYTE_ARRAY);
......@@ -97,7 +99,6 @@ public class StorageImpl implements Storage {
return null;
}
@SneakyThrows
@Override
public URL signUrl(BlobInfo blobInfo, long duration, TimeUnit timeUnit) {
......
......@@ -25,9 +25,13 @@ azure.keyvault.url=${keyvault_url}
# Azure Blob Storage configuration
file.location.containerName=osdu-container
file.location.userId=osdu-user
azure.storage.account=${AZURE_STORAGE_ACCOUNT}
# Azure Credentials
azure.client.secret=${CLIENT_SECRET}
azure.client.id=${CLIENT_ID}
azure.tenant.id=${AZURE_AD_TENANT_ID}
# Azure Application Insights configuration
azure.application-insights.instrumentation-key=${appinsights_key}
tenantInfo.container.name=TenantInfo
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment