using static System.IO.File; using static System.Text.Json.JsonSerializer; namespace InnovEnergy.App.Backend.S3; public static class S3Access { // TODO: put these into Json files in /Resources and read them from // there so they can be changed without recompiling // they should be read from disk on each use, // so the backend does not need to be restarted on change public static S3Cmd ReadOnly { get; } = new S3Cmd ( key : Deserialize>(OpenRead("./Resources/urlAndKey.json"))?["ReadOnlyS3Key"], secret: Deserialize>(OpenRead("./Resources/urlAndKey.json"))?["ReadOnlyS3Secret"] ); public static S3Cmd ReadWrite { get; } = new S3Cmd ( key : Deserialize>(OpenRead("./Resources/urlAndKey.json"))?["ReadWriteS3Key"], secret: Deserialize>(OpenRead("./Resources/urlAndKey.json"))?["ReadWriteS3Secret"] ); }