Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces 'http' with 'https' in Minio.Tests for 'play.min.io' #749

Merged
merged 2 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Minio.Tests/NegativeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public async Task TestInvalidBucketNameError()
var badName = new string('A', 260);
var minio = new MinioClient()
.WithEndpoint("play.min.io")
.WithCredentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.WithCredentials("Q3AM3UQ867SPQQA43P2F",
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.WithSSL()
.Build();
var args = new BucketExistsArgs()
.WithBucket(badName);
Expand All @@ -61,7 +63,9 @@ public async Task TestInvalidObjectNameError()
var bucketName = Guid.NewGuid().ToString("N");
var minio = new MinioClient()
.WithEndpoint("play.min.io")
.WithCredentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.WithCredentials("Q3AM3UQ867SPQQA43P2F",
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.WithSSL()
.Build();

try
Expand Down
24 changes: 13 additions & 11 deletions Minio.Tests/OperationsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private async Task<bool> ObjectExistsAsync(IMinioClient client, string bucket, s
.WithBucket(bucket)
.WithObject(objectName)
.WithCallbackStream(stream => { });
await client.GetObjectAsync(getObjectArgs);
await client.GetObjectAsync(getObjectArgs).ConfigureAwait(false);

return true;
}
Expand All @@ -48,19 +48,20 @@ public async Task PresignedGetObject()
.WithEndpoint("play.min.io")
.WithCredentials("Q3AM3UQ867SPQQA43P2F",
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.WithSSL()
.Build();

var bucket = "bucket";
var objectName = "object-name";

var bktExistArgs = new BucketExistsArgs()
.WithBucket(bucket);
var found = await client.BucketExistsAsync(bktExistArgs);
var found = await client.BucketExistsAsync(bktExistArgs).ConfigureAwait(false);
if (!found)
{
var mkBktArgs = new MakeBucketArgs()
.WithBucket(bucket);
await client.MakeBucketAsync(mkBktArgs);
await client.MakeBucketAsync(mkBktArgs).ConfigureAwait(false);
}

if (!await ObjectExistsAsync(client, bucket, objectName))
Expand All @@ -74,7 +75,7 @@ public async Task PresignedGetObject()
.WithObject(objectName)
.WithStreamData(helloStream)
.WithObjectSize(helloData.Length);
await client.PutObjectAsync(PutObjectArgs);
await client.PutObjectAsync(PutObjectArgs).ConfigureAwait(false);
}

var presignedGetObjectArgs = new PresignedGetObjectArgs()
Expand All @@ -83,9 +84,9 @@ public async Task PresignedGetObject()
.WithExpiry(3600)
.WithRequestDate(_requestDate);

var signedUrl = await client.PresignedGetObjectAsync(presignedGetObjectArgs);
var signedUrl = await client.PresignedGetObjectAsync(presignedGetObjectArgs).ConfigureAwait(false);
Assert.AreEqual(
"http://play.min.io/bucket/object-name?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=Q3AM3UQ867SPQQA43P2F%2F20200501%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200501T154533Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=d4202da690618f77142d6f0557c97839f0773b2c718082e745cd9b199aa6b28f",
"https://play.min.io/bucket/object-name?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=Q3AM3UQ867SPQQA43P2F%2F20200501%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200501T154533Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=d4202da690618f77142d6f0557c97839f0773b2c718082e745cd9b199aa6b28f",
signedUrl);
}

Expand All @@ -97,6 +98,7 @@ public async Task PresignedGetObjectWithHeaders()
.WithEndpoint("play.min.io")
.WithCredentials("Q3AM3UQ867SPQQA43P2F",
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.WithSSL()
.Build();

var bucket = "bucket";
Expand All @@ -109,12 +111,12 @@ public async Task PresignedGetObjectWithHeaders()

var bktExistArgs = new BucketExistsArgs()
.WithBucket(bucket);
var found = await client.BucketExistsAsync(bktExistArgs);
var found = await client.BucketExistsAsync(bktExistArgs).ConfigureAwait(false);
if (!found)
{
var mkBktArgs = new MakeBucketArgs()
.WithBucket(bucket);
await client.MakeBucketAsync(mkBktArgs);
await client.MakeBucketAsync(mkBktArgs).ConfigureAwait(false);
}

if (!await ObjectExistsAsync(client, bucket, objectName))
Expand All @@ -127,7 +129,7 @@ public async Task PresignedGetObjectWithHeaders()
.WithObject(objectName)
.WithStreamData(helloStream)
.WithObjectSize(helloData.Length);
await client.PutObjectAsync(PutObjectArgs);
await client.PutObjectAsync(PutObjectArgs).ConfigureAwait(false);
}

var presignedGetObjectArgs = new PresignedGetObjectArgs()
Expand All @@ -137,10 +139,10 @@ public async Task PresignedGetObjectWithHeaders()
.WithHeaders(reqParams)
.WithRequestDate(_requestDate);

var signedUrl = await client.PresignedGetObjectAsync(presignedGetObjectArgs);
var signedUrl = await client.PresignedGetObjectAsync(presignedGetObjectArgs).ConfigureAwait(false);

Assert.AreEqual(
"http://play.min.io/bucket/object-name?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=Q3AM3UQ867SPQQA43P2F%2F20200501%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200501T154533Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3D%22filename.jpg%22&X-Amz-Signature=de66f04dd4ac35838b9e83d669f7b5a70b452c6468e2b4a9e9c29f42e7fa102d",
"https://play.min.io/bucket/object-name?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=Q3AM3UQ867SPQQA43P2F%2F20200501%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200501T154533Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3D%22filename.jpg%22&X-Amz-Signature=de66f04dd4ac35838b9e83d669f7b5a70b452c6468e2b4a9e9c29f42e7fa102d",
signedUrl);
}
}
4 changes: 2 additions & 2 deletions Minio.Tests/RetryHandlerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async Task TestRetryPolicyOnSuccess()

var bktArgs = new BucketExistsArgs()
.WithBucket(Guid.NewGuid().ToString());
var result = await client.BucketExistsAsync(bktArgs);
var result = await client.BucketExistsAsync(bktArgs).ConfigureAwait(false);
Assert.IsFalse(result);
Assert.AreEqual(invokeCount, 1);
}
Expand Down Expand Up @@ -86,7 +86,7 @@ public async Task TestRetryPolicyOnFailure()
.WithObject("aa")
.WithCallbackStream(s => { });
await Assert.ThrowsExceptionAsync<BucketNotFoundException>(
() => client.GetObjectAsync(getObjectArgs));
() => client.GetObjectAsync(getObjectArgs)).ConfigureAwait(false);
Assert.AreEqual(invokeCount, retryCount);
}
}
3 changes: 2 additions & 1 deletion Minio.Tests/ReuseTcpConnectionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public ReuseTcpConnectionTest()
.WithEndpoint("play.min.io")
.WithCredentials("Q3AM3UQ867SPQQA43P2F",
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.WithSSL()
.Build();
}

Expand All @@ -29,7 +30,7 @@ private async Task<bool> ObjectExistsAsync(MinioClient client, string bucket, st
.WithBucket("bucket")
.WithObject(objectName)
.WithFile("testfile");
await client.GetObjectAsync(getObjectArgs);
await client.GetObjectAsync(getObjectArgs).ConfigureAwait(false);

return true;
}
Expand Down
5 changes: 4 additions & 1 deletion Minio.Tests/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public UnitTest1()
.WithEndpoint("play.min.io")
.WithCredentials("Q3AM3UQ867SPQQA43P2F",
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.WithSSL()
.Build();
}

Expand Down Expand Up @@ -181,7 +182,9 @@ public UnitTest2()
| SecurityProtocolType.Tls12;
var minio = new MinioClient()
.WithEndpoint("play.min.io")
.WithCredentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.WithCredentials("Q3AM3UQ867SPQQA43P2F",
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.WithSSL()
.Build();
}

Expand Down
4 changes: 3 additions & 1 deletion Minio.Tests/UrlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public UrlTests()
| SecurityProtocolType.Tls12;
var minio = new MinioClient()
.WithEndpoint("play.min.io")
.WithCredentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.WithCredentials("Q3AM3UQ867SPQQA43P2F",
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.WithSSL()
.Build();
}

Expand Down