|
@@ -140,6 +140,7 @@ public class ITestAssumeRole extends AbstractS3ATestBase {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
public void testCreateCredentialProvider() throws IOException {
|
|
public void testCreateCredentialProvider() throws IOException {
|
|
describe("Create the credential provider");
|
|
describe("Create the credential provider");
|
|
|
|
|
|
@@ -153,6 +154,7 @@ public class ITestAssumeRole extends AbstractS3ATestBase {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
public void testCreateCredentialProviderNoURI() throws IOException {
|
|
public void testCreateCredentialProviderNoURI() throws IOException {
|
|
describe("Create the credential provider");
|
|
describe("Create the credential provider");
|
|
|
|
|
|
@@ -170,6 +172,7 @@ public class ITestAssumeRole extends AbstractS3ATestBase {
|
|
* @return a configuration set to use to the role ARN.
|
|
* @return a configuration set to use to the role ARN.
|
|
* @throws JsonProcessingException problems working with JSON policies.
|
|
* @throws JsonProcessingException problems working with JSON policies.
|
|
*/
|
|
*/
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
protected Configuration createValidRoleConf() throws JsonProcessingException {
|
|
protected Configuration createValidRoleConf() throws JsonProcessingException {
|
|
String roleARN = getAssumedRoleARN();
|
|
String roleARN = getAssumedRoleARN();
|
|
|
|
|
|
@@ -183,6 +186,7 @@ public class ITestAssumeRole extends AbstractS3ATestBase {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
public void testAssumedInvalidRole() throws Throwable {
|
|
public void testAssumedInvalidRole() throws Throwable {
|
|
Configuration conf = new Configuration();
|
|
Configuration conf = new Configuration();
|
|
conf.set(ASSUMED_ROLE_ARN, ROLE_ARN_EXAMPLE);
|
|
conf.set(ASSUMED_ROLE_ARN, ROLE_ARN_EXAMPLE);
|
|
@@ -200,6 +204,7 @@ public class ITestAssumeRole extends AbstractS3ATestBase {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
public void testAssumeRoleNoARN() throws Exception {
|
|
public void testAssumeRoleNoARN() throws Exception {
|
|
describe("Attemnpt to create the FS with no ARN");
|
|
describe("Attemnpt to create the FS with no ARN");
|
|
Configuration conf = createAssumedRoleConfig();
|
|
Configuration conf = createAssumedRoleConfig();
|
|
@@ -232,6 +237,7 @@ public class ITestAssumeRole extends AbstractS3ATestBase {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
public void testAssumeRoleCannotAuthAssumedRole() throws Exception {
|
|
public void testAssumeRoleCannotAuthAssumedRole() throws Exception {
|
|
describe("Assert that you can't use assumed roles to auth assumed roles");
|
|
describe("Assert that you can't use assumed roles to auth assumed roles");
|
|
|
|
|
|
@@ -245,13 +251,13 @@ public class ITestAssumeRole extends AbstractS3ATestBase {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
public void testAssumeRoleBadInnerAuth() throws Exception {
|
|
public void testAssumeRoleBadInnerAuth() throws Exception {
|
|
describe("Try to authenticate with a keypair with spaces");
|
|
describe("Try to authenticate with a keypair with spaces");
|
|
|
|
|
|
Configuration conf = createAssumedRoleConfig();
|
|
Configuration conf = createAssumedRoleConfig();
|
|
unsetHadoopCredentialProviders(conf);
|
|
unsetHadoopCredentialProviders(conf);
|
|
- conf.set(ASSUMED_ROLE_CREDENTIALS_PROVIDER,
|
|
|
|
- SimpleAWSCredentialsProvider.NAME);
|
|
|
|
|
|
+ conf.set(ASSUMED_ROLE_CREDENTIALS_PROVIDER, SimpleAWSCredentialsProvider.NAME);
|
|
conf.set(ACCESS_KEY, "not valid");
|
|
conf.set(ACCESS_KEY, "not valid");
|
|
conf.set(SECRET_KEY, "not secret");
|
|
conf.set(SECRET_KEY, "not secret");
|
|
expectFileSystemCreateFailure(conf,
|
|
expectFileSystemCreateFailure(conf,
|
|
@@ -261,13 +267,13 @@ public class ITestAssumeRole extends AbstractS3ATestBase {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
public void testAssumeRoleBadInnerAuth2() throws Exception {
|
|
public void testAssumeRoleBadInnerAuth2() throws Exception {
|
|
describe("Try to authenticate with an invalid keypair");
|
|
describe("Try to authenticate with an invalid keypair");
|
|
|
|
|
|
Configuration conf = createAssumedRoleConfig();
|
|
Configuration conf = createAssumedRoleConfig();
|
|
unsetHadoopCredentialProviders(conf);
|
|
unsetHadoopCredentialProviders(conf);
|
|
- conf.set(ASSUMED_ROLE_CREDENTIALS_PROVIDER,
|
|
|
|
- SimpleAWSCredentialsProvider.NAME);
|
|
|
|
|
|
+ conf.set(ASSUMED_ROLE_CREDENTIALS_PROVIDER, SimpleAWSCredentialsProvider.NAME);
|
|
conf.set(ACCESS_KEY, "notvalid");
|
|
conf.set(ACCESS_KEY, "notvalid");
|
|
conf.set(SECRET_KEY, "notsecret");
|
|
conf.set(SECRET_KEY, "notsecret");
|
|
expectFileSystemCreateFailure(conf,
|
|
expectFileSystemCreateFailure(conf,
|
|
@@ -345,6 +351,7 @@ public class ITestAssumeRole extends AbstractS3ATestBase {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
public void testAssumeRoleUndefined() throws Throwable {
|
|
public void testAssumeRoleUndefined() throws Throwable {
|
|
describe("Verify that you cannot instantiate the"
|
|
describe("Verify that you cannot instantiate the"
|
|
+ " AssumedRoleCredentialProvider without a role ARN");
|
|
+ " AssumedRoleCredentialProvider without a role ARN");
|
|
@@ -356,6 +363,7 @@ public class ITestAssumeRole extends AbstractS3ATestBase {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
public void testAssumedIllegalDuration() throws Throwable {
|
|
public void testAssumedIllegalDuration() throws Throwable {
|
|
describe("Expect the constructor to fail if the session is to short");
|
|
describe("Expect the constructor to fail if the session is to short");
|
|
Configuration conf = new Configuration();
|
|
Configuration conf = new Configuration();
|
|
@@ -529,6 +537,7 @@ public class ITestAssumeRole extends AbstractS3ATestBase {
|
|
* don't break.
|
|
* don't break.
|
|
*/
|
|
*/
|
|
@Test
|
|
@Test
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
public void testAssumedRoleRetryHandler() throws Throwable {
|
|
public void testAssumedRoleRetryHandler() throws Throwable {
|
|
try(AssumedRoleCredentialProvider provider
|
|
try(AssumedRoleCredentialProvider provider
|
|
= new AssumedRoleCredentialProvider(getFileSystem().getUri(),
|
|
= new AssumedRoleCredentialProvider(getFileSystem().getUri(),
|