exchanged api keys for ones with specific restricted permissions

This commit is contained in:
Kim 2023-03-16 16:34:52 +01:00
parent 6366cb5569
commit 4eac790eaa
1 changed files with 21 additions and 7 deletions

View File

@ -34,12 +34,11 @@ public static class InstallationMethods
public static async Task<Boolean> CreateBucket(this Installation installation) public static async Task<Boolean> CreateBucket(this Installation installation)
{ {
//NOTE this key has all the rights, please be sure you know what you're doing const String secret = "-T9TAqy9a3-0-xj7HKsFFJOCcxfRpcnL6OW5oOrOcWU";
const String secret = "z8brNDUAbpktvyWZN1jMIrsQhavDgK2t4cb8GLvsxYg"; const String apiKey = "EXO87ca85e29dd412f1238f1cf0";
const String apiKey = "EXO277645911ee6bde3875e99ae";
const String salt = "3e5b3069-214a-43ee-8d85-57d72000c19d"; const String salt = "3e5b3069-214a-43ee-8d85-57d72000c19d";
var cmd = Cli var cmd = Cli
.Wrap("python3") .Wrap("python3")
.WithArguments(new[] .WithArguments(new[]
@ -48,14 +47,29 @@ public static class InstallationMethods
apiKey, "--secret_key", secret apiKey, "--secret_key", secret
}); });
var x = await cmd.ExecuteBufferedAsync(); var x = await cmd.ExecuteBufferedAsync();
//Updating the url in the db as to not needing to wait until the next
var cmd2 = Cli
.Wrap("python3")
.WithArguments(new[]
{
"Resources/s3cmd.py", "signurl", $"s3://{installation.Id}-{salt}",
TimeSpan.FromDays(1).TotalSeconds.ToString(), "--access_key",
apiKey, "--secret_key", secret
});
var y = await cmd2.ExecuteBufferedAsync();
installation.S3Url = y.StandardOutput.Replace("\n", "").Replace(" ", "");
Db.Update(installation);
return x.ExitCode == 0; return x.ExitCode == 0;
} }
public static async Task<Boolean> DeleteBucket(this Installation installation) public static async Task<Boolean> DeleteBucket(this Installation installation)
{ {
//NOTE this key has all the rights, please be sure you know what you're doing const String secret = "-T9TAqy9a3-0-xj7HKsFFJOCcxfRpcnL6OW5oOrOcWU";
const String secret = "z8brNDUAbpktvyWZN1jMIrsQhavDgK2t4cb8GLvsxYg"; const String apiKey = "EXO87ca85e29dd412f1238f1cf0";
const String apiKey = "EXO277645911ee6bde3875e99ae";
const String salt = "3e5b3069-214a-43ee-8d85-57d72000c19d"; const String salt = "3e5b3069-214a-43ee-8d85-57d72000c19d";
var cmd = Cli var cmd = Cli
.Wrap("python3") .Wrap("python3")