Commit bf780acc authored by Petar Hristov's avatar Petar Hristov 💬
Browse files

Fix: WORM bucket keys

parent d4bd190d
......@@ -4,8 +4,9 @@
<OutputType>Exe</OutputType>
<RootNamespace>Coscine.Database.Actions</RootNamespace>
<AssemblyName>Coscine.Database.Actions</AssemblyName>
<TargetFramework>net6.0</TargetFramework>
<Version>2.11.0</Version></PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>2.11.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Coscine.Database.Helpers" Version="2.*-*" />
<PackageReference Include="Coscine.Migrations" Version="2.*-*" />
......
......@@ -5,7 +5,8 @@
<AssemblyName>Coscine.Database.Tests</AssemblyName>
<TargetFrameworks>net6.0;net461</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Version>2.11.0</Version></PropertyGroup>
<Version>2.11.0</Version>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Database\Database.csproj" />
</ItemGroup>
......
......@@ -4,7 +4,7 @@
<RootNamespace>Coscine.Database</RootNamespace>
<AssemblyName>Coscine.Database</AssemblyName>
<TargetFrameworks>net6.0;net461</TargetFrameworks>
<Version>2.11.0</Version>
<Version>2.11.0-issue-2072-wormr0005</Version>
</PropertyGroup>
<PropertyGroup>
<Authors>RWTH Aachen University</Authors>
......
......@@ -130,6 +130,10 @@ namespace Coscine.Database.Models
{
return new RdsS3ResourceTypeModel().GetResourceTypeOptions(resourceTypeOptionId);
}
else if (resourceType.Type == "rdss3worm")
{
return new RdsS3WormResourceTypeModel().GetResourceTypeOptions(resourceTypeOptionId);
}
else
{
return new Dictionary<string, string>();
......@@ -244,6 +248,11 @@ namespace Coscine.Database.Models
var rdsS3ResourceTypeModel = new RdsS3ResourceTypeModel();
rdsS3ResourceTypeModel.Delete(rdsS3ResourceTypeModel.GetById(resource.ResourceTypeOptionId.Value));
}
else if (resource.Type.Type == "rdss3worm" && resource.ResourceTypeOptionId != null)
{
var rdsS3WormResourceTypeModel = new RdsS3WormResourceTypeModel();
rdsS3WormResourceTypeModel.Delete(rdsS3WormResourceTypeModel.GetById(resource.ResourceTypeOptionId.Value));
}
}
public ResourceObject CreateReturnObjectFromDatabaseObject(Resource resource)
......@@ -310,6 +319,22 @@ namespace Coscine.Database.Models
WriteSecretKey = rdsS3ResourceType.SecretKeyWrite,
};
}
else if (resource.Type.Type == "rdss3worm" && resource.ResourceTypeOptionId != null)
{
var rdsS3WormResourceTypeModel = new RdsS3WormResourceTypeModel();
var rdsS3WormResourceType = rdsS3WormResourceTypeModel.GetById(resource.ResourceTypeOptionId.Value);
resourceTypeOptionObject = new RdsS3ResourceTypeObject
{
Id = rdsS3WormResourceType.Id,
BucketName = rdsS3WormResourceType.BucketName,
Endpoint = rdsS3WormResourceType.Endpoint,
ReadAccessKey = rdsS3WormResourceType.AccessKeyRead,
ReadSecretKey = rdsS3WormResourceType.SecretKeyRead,
Size = rdsS3WormResourceType.Size,
WriteAccessKey = rdsS3WormResourceType.AccessKeyWrite,
WriteSecretKey = rdsS3WormResourceType.SecretKeyWrite,
};
}
return new ResourceObject(
resource.Id,
......
......@@ -2,7 +2,8 @@
<PropertyGroup>
<RootNamespace>Coscine.Database</RootNamespace>
<TargetFrameworks>net6.0;net461</TargetFrameworks>
<Version>2.11.0</Version></PropertyGroup>
<Version>2.11.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Inflector.NetStandard" Version="1.2.2" />
<!-- Note: use Microsoft.EntityFrameworkCore Version 3.x.x for compatibility with net461 -->
......
Supports Markdown
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