ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [03/50] [abbrv] ignite git commit: IGNITE-7053 S3 IP finder: support server side encryption. This close #3189.
Date Fri, 15 Dec 2017 14:09:33 GMT
IGNITE-7053 S3 IP finder: support server side encryption. This close #3189.

Signed-off-by: nikolay_tikhonov <ntikhonov@gridgain.com>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fe36e629
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fe36e629
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fe36e629

Branch: refs/heads/ignite-zk-ce
Commit: fe36e629e26a95163543d71aeb7d45dad96b961b
Parents: 7ee6722
Author: Alexey Popov <tank2.alex@gmail.com>
Authored: Mon Dec 11 16:30:24 2017 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Mon Dec 11 16:35:22 2017 +0300

----------------------------------------------------------------------
 .../spi/checkpoint/s3/S3CheckpointSpi.java      | 45 ++++++++++++++++--
 .../spi/checkpoint/s3/S3CheckpointSpiMBean.java |  6 +++
 .../tcp/ipfinder/s3/TcpDiscoveryS3IpFinder.java | 39 ++++++++++++----
 ...ckpointSpiStartStopSSEAlgorithmSelfTest.java | 49 ++++++++++++++++++++
 .../TcpDiscoveryS3IpFinderAbstractSelfTest.java | 22 ++++++++-
 ...scoveryS3IpFinderBucketEndpointSelfTest.java | 16 ++-----
 ...DiscoveryS3IpFinderSSEAlgorithmSelfTest.java | 48 +++++++++++++++++++
 .../ignite/testsuites/IgniteS3TestSuite.java    |  4 ++
 8 files changed, 203 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/fe36e629/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpi.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpi.java
b/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpi.java
index 195e69e..270d518 100644
--- a/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpi.java
+++ b/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpi.java
@@ -67,13 +67,15 @@ import org.jetbrains.annotations.Nullable;
  * <h2 class="header">Mandatory</h2>
  * This SPI has one mandatory configuration parameter:
  * <ul>
- * <li>{@link #setAwsCredentials(AWSCredentials)}</li>
+ *      <li>AWS credentials (see {@link #setAwsCredentials(AWSCredentials)}
  * </ul>
  * <h2 class="header">Optional</h2>
  * This SPI has following optional configuration parameters:
  * <ul>
- * <li>{@link #setBucketNameSuffix(String)}</li>
- * <li>{@link #setClientConfiguration(ClientConfiguration)}</li>
+ *      <li>Bucket name suffix (see {@link #setBucketNameSuffix(String)})</li>
+ *      <li>Client configuration (see {@link #setClientConfiguration(ClientConfiguration)})</li>
+ *      <li>Bucket endpoint (see {@link #setBucketEndpoint(String)})</li>
+ *      <li>Server side encryption algorithm (see {@link #setSSEAlgorithm(String)})</li>
  * <li>{@link #setBucketEndpoint(String)}</li>
  * </ul>
  * <h2 class="header">Java Example</h2>
@@ -159,6 +161,9 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi
{
     /** Bucket endpoint (set by user). */
     private @Nullable String bucketEndpoint;
 
+    /** Server side encryption algorithm */
+    private @Nullable String sseAlg;
+
     /** Amazon client configuration. */
     private ClientConfiguration cfg;
 
@@ -188,6 +193,15 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi
{
     }
 
     /**
+     * Gets S3 server-side encryption algorithm.
+     *
+     * @return S3 server-side encryption algorithm to use.
+     */
+    public @Nullable String getSSEAlgorithm() {
+        return sseAlg;
+    }
+
+    /**
      * Gets S3 access key.
      *
      * @return S3 access key.
@@ -271,6 +285,21 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi
{
     }
 
     /**
+     * Sets server-side encryption algorithm for Amazon S3-managed encryption keys.
+     * For information about possible S3-managed encryption keys visit
+     * <a href="http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html">docs.aws.amazon.com</a>.
+     *
+     * @param sseAlg Server-side encryption algorithm, for example, AES256 or SSES3.
+     * @return {@code this} for chaining.
+     */
+    @IgniteSpiConfiguration(optional = true)
+    public S3CheckpointSpi setSSEAlgorithm(String sseAlg) {
+        this.sseAlg = sseAlg;
+
+        return this;
+    }
+
+    /**
      * Sets Amazon client configuration.
      * <p>
      * For details refer to Amazon S3 API reference.
@@ -312,6 +341,8 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi
{
             log.debug(configInfo("awsCredentials", cred));
             log.debug(configInfo("clientConfiguration", cfg));
             log.debug(configInfo("bucketNameSuffix", bucketNameSuffix));
+            log.debug(configInfo("bucketEndpoint", bucketEndpoint));
+            log.debug(configInfo("SSEAlgorithm", sseAlg));
         }
 
         if (cfg == null)
@@ -560,6 +591,9 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi
{
 
         meta.setContentLength(buf.length);
 
+        if (!F.isEmpty(sseAlg))
+            meta.setSSEAlgorithm(sseAlg);
+
         s3.putObject(bucketName, data.getKey(), new ByteArrayInputStream(buf), meta);
     }
 
@@ -772,6 +806,11 @@ public class S3CheckpointSpi extends IgniteSpiAdapter implements CheckpointSpi
{
         }
 
         /** {@inheritDoc} */
+        @Override public String getSSEAlgorithm() {
+            return S3CheckpointSpi.this.getSSEAlgorithm();
+        }
+
+        /** {@inheritDoc} */
         @Override public String getAccessKey() {
             return S3CheckpointSpi.this.getAccessKey();
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/fe36e629/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiMBean.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiMBean.java
b/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiMBean.java
index 032e066..4f80649 100644
--- a/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiMBean.java
+++ b/modules/aws/src/main/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiMBean.java
@@ -40,6 +40,12 @@ public interface S3CheckpointSpiMBean extends IgniteSpiManagementMBean
{
     public String getBucketEndpoint();
 
     /**
+     * @return S3 server-side encryption algorithm.
+     */
+    @MXBeanDescription("S3 server-side encryption algorithm.")
+    public String getSSEAlgorithm();
+
+    /**
      * @return S3 access key.
      */
     @MXBeanDescription("S3 access key.")

http://git-wip-us.apache.org/repos/asf/ignite/blob/fe36e629/modules/aws/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinder.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinder.java
b/modules/aws/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinder.java
index dd8c1a8..79559e8 100644
--- a/modules/aws/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinder.java
+++ b/modules/aws/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinder.java
@@ -62,6 +62,7 @@ import org.jetbrains.annotations.Nullable;
  *      <li>Client configuration (see {@link #setClientConfiguration(ClientConfiguration)})</li>
  *      <li>Shared flag (see {@link #setShared(boolean)})</li>
  *      <li>Bucket endpoint (see {@link #setBucketEndpoint(String)})</li>
+ *      <li>Server side encryption algorithm (see {@link #setSSEAlgorithm(String)})</li>
  * </ul>
  * <p>
  * The finder will create S3 bucket with configured name. The bucket will contain entries
named
@@ -80,14 +81,9 @@ public class TcpDiscoveryS3IpFinder extends TcpDiscoveryIpFinderAdapter
{
     /** Entry content. */
     private static final byte[] ENTRY_CONTENT = new byte[] {1};
 
-    /** Entry metadata with content length set. */
-    private static final ObjectMetadata ENTRY_METADATA;
-
-    static {
-        ENTRY_METADATA = new ObjectMetadata();
-
-        ENTRY_METADATA.setContentLength(ENTRY_CONTENT.length);
-    }
+    /** Entry metadata. */
+    @GridToStringExclude
+    private final ObjectMetadata objMetadata = new ObjectMetadata();
 
     /** Grid logger. */
     @LoggerResource
@@ -103,6 +99,9 @@ public class TcpDiscoveryS3IpFinder extends TcpDiscoveryIpFinderAdapter
{
     /** Bucket endpoint */
     private @Nullable String bucketEndpoint;
 
+    /** Server side encryption algorithm */
+    private @Nullable String sseAlg;
+
     /** Init guard. */
     @GridToStringExclude
     private final AtomicBoolean initGuard = new AtomicBoolean();
@@ -192,7 +191,7 @@ public class TcpDiscoveryS3IpFinder extends TcpDiscoveryIpFinderAdapter
{
             String key = key(addr);
 
             try {
-                s3.putObject(bucketName, key, new ByteArrayInputStream(ENTRY_CONTENT), ENTRY_METADATA);
+                s3.putObject(bucketName, key, new ByteArrayInputStream(ENTRY_CONTENT), objMetadata);
             }
             catch (AmazonClientException e) {
                 throw new IgniteSpiException("Failed to put entry [bucketName=" + bucketName
+
@@ -256,6 +255,11 @@ public class TcpDiscoveryS3IpFinder extends TcpDiscoveryIpFinderAdapter
{
                 if (F.isEmpty(bucketName))
                     throw new IgniteSpiException("Bucket name is null or empty (provide bucket
name and restart).");
 
+                objMetadata.setContentLength(ENTRY_CONTENT.length);
+
+                if (!F.isEmpty(sseAlg))
+                    objMetadata.setSSEAlgorithm(sseAlg);
+
                 s3 = createAmazonS3Client();
 
                 if (!s3.doesBucketExist(bucketName)) {
@@ -331,7 +335,7 @@ public class TcpDiscoveryS3IpFinder extends TcpDiscoveryIpFinderAdapter
{
      * Sets bucket endpoint for IP finder.
      * If the endpoint is not set then IP finder will go to each region to find a corresponding
bucket.
      * For information about possible endpoint names visit
-     * <a href="http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">docs.aws.amazon.com</a>
+     * <a href="http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">docs.aws.amazon.com</a>.
      *
      * @param bucketEndpoint Bucket endpoint, for example, s3.us-east-2.amazonaws.com.
      * @return {@code this} for chaining.
@@ -344,6 +348,21 @@ public class TcpDiscoveryS3IpFinder extends TcpDiscoveryIpFinderAdapter
{
     }
 
     /**
+     * Sets server-side encryption algorithm for Amazon S3-managed encryption keys.
+     * For information about possible S3-managed encryption keys visit
+     * <a href="http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html">docs.aws.amazon.com</a>.
+     *
+     * @param sseAlg Server-side encryption algorithm, for example, AES256 or SSES3.
+     * @return {@code this} for chaining.
+     */
+    @IgniteSpiConfiguration(optional = true)
+    public TcpDiscoveryS3IpFinder setSSEAlgorithm(String sseAlg) {
+        this.sseAlg = sseAlg;
+
+        return this;
+    }
+
+    /**
      * Sets Amazon client configuration.
      * <p>
      * For details refer to Amazon S3 API reference.

http://git-wip-us.apache.org/repos/asf/ignite/blob/fe36e629/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSSEAlgorithmSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSSEAlgorithmSelfTest.java
b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSSEAlgorithmSelfTest.java
new file mode 100644
index 0000000..7bfb75d
--- /dev/null
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSSEAlgorithmSelfTest.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spi.checkpoint.s3;
+
+import com.amazonaws.auth.AWSCredentials;
+import com.amazonaws.auth.BasicAWSCredentials;
+import org.apache.ignite.spi.GridSpiStartStopAbstractTest;
+import org.apache.ignite.testframework.junits.spi.GridSpiTest;
+import org.apache.ignite.testsuites.IgniteIgnore;
+import org.apache.ignite.testsuites.IgniteS3TestSuite;
+
+/**
+ * Grid S3 checkpoint SPI start stop self test.
+ */
+@GridSpiTest(spi = S3CheckpointSpi.class, group = "Checkpoint SPI")
+public class S3CheckpointSpiStartStopSSEAlgorithmSelfTest extends GridSpiStartStopAbstractTest<S3CheckpointSpi>
{
+    /** {@inheritDoc} */
+    @Override protected void spiConfigure(S3CheckpointSpi spi) throws Exception {
+        AWSCredentials cred = new BasicAWSCredentials(IgniteS3TestSuite.getAccessKey(),
+            IgniteS3TestSuite.getSecretKey());
+
+        spi.setAwsCredentials(cred);
+        spi.setBucketNameSuffix(S3CheckpointSpiSelfTest.getBucketNameSuffix());
+        spi.setSSEAlgorithm("AES256");
+
+        super.spiConfigure(spi);
+    }
+
+    /** {@inheritDoc} */
+    @IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
+    @Override public void testStartStop() throws Exception {
+        super.testStartStop();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/fe36e629/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderAbstractSelfTest.java
b/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderAbstractSelfTest.java
index 89a44be..af4a47a 100644
--- a/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderAbstractSelfTest.java
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderAbstractSelfTest.java
@@ -26,12 +26,20 @@ import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinderAbstractSelfTest;
 import org.apache.ignite.testsuites.IgniteIgnore;
 import org.apache.ignite.testsuites.IgniteS3TestSuite;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * Abstract TcpDiscoveryS3IpFinder to test with different ways of setting AWS credentials.
  */
 abstract class TcpDiscoveryS3IpFinderAbstractSelfTest
     extends TcpDiscoveryIpFinderAbstractSelfTest<TcpDiscoveryS3IpFinder> {
+
+    /** Bucket endpoint */
+    protected @Nullable String bucketEndpoint;
+
+    /** Server-side encryption algorithm for Amazon S3-managed encryption keys. */
+    protected @Nullable String SSEAlgorithm;
+
     /**
      * Constructor.
      *
@@ -51,6 +59,7 @@ abstract class TcpDiscoveryS3IpFinderAbstractSelfTest
         setAwsCredentials(finder);
         setBucketEndpoint(finder);
         setBucketName(finder);
+        setSSEAlgorithm(finder);
 
         for (int i = 0; i < 5; i++) {
             Collection<InetSocketAddress> addrs = finder.getRegisteredAddresses();
@@ -85,8 +94,17 @@ abstract class TcpDiscoveryS3IpFinderAbstractSelfTest
      * Set Bucket endpoint into the provided {@code finder}.
      * @param finder finder endpoint to set into.
      */
-    protected void setBucketEndpoint(TcpDiscoveryS3IpFinder finder) {
-        // No-op.
+    private void setBucketEndpoint(TcpDiscoveryS3IpFinder finder) {
+        finder.setBucketEndpoint(bucketEndpoint);
+    }
+
+    /**
+     * Set server-side encryption algorithm for Amazon S3-managed encryption keys into the
provided {@code finder}.
+     *
+     * @param finder finder encryption algorithm to set into.
+     */
+    private void setSSEAlgorithm(TcpDiscoveryS3IpFinder finder) {
+        finder.setSSEAlgorithm(SSEAlgorithm);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/fe36e629/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderBucketEndpointSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderBucketEndpointSelfTest.java
b/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderBucketEndpointSelfTest.java
index 9eda351..07d4839 100644
--- a/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderBucketEndpointSelfTest.java
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderBucketEndpointSelfTest.java
@@ -21,8 +21,9 @@ import com.amazonaws.auth.BasicAWSCredentials;
 import org.apache.ignite.testsuites.IgniteS3TestSuite;
 
 /**
- * TcpDiscoveryS3IpFinder test using AWS credentials and selected bucket endpoint
- * Possible endpoints are here: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region.
+ * TcpDiscoveryS3IpFinder tests bucket endpoint for IP finder.
+ * For information about possible endpoint names visit
+ * <a href="http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">docs.aws.amazon.com</a>.
  */
 public class TcpDiscoveryS3IpFinderBucketEndpointSelfTest extends TcpDiscoveryS3IpFinderAbstractSelfTest
{
     /**
@@ -31,7 +32,7 @@ public class TcpDiscoveryS3IpFinderBucketEndpointSelfTest extends TcpDiscoveryS3
      * @throws Exception If any error occurs.
      */
     public TcpDiscoveryS3IpFinderBucketEndpointSelfTest() throws Exception {
-        // No-op.
+        bucketEndpoint = "s3.us-east-2.amazonaws.com";
     }
 
     /** {@inheritDoc} */
@@ -41,13 +42,6 @@ public class TcpDiscoveryS3IpFinderBucketEndpointSelfTest extends TcpDiscoveryS3
     }
 
     /** {@inheritDoc} */
-    @Override protected void setBucketEndpoint(TcpDiscoveryS3IpFinder finder) {
-        super.setBucketEndpoint(finder);
-
-        finder.setBucketEndpoint("s3.us-east-2.amazonaws.com");
-    }
-
-    /** {@inheritDoc} */
     @Override protected void setBucketName(TcpDiscoveryS3IpFinder finder) {
         super.setBucketName(finder);
 
@@ -58,4 +52,4 @@ public class TcpDiscoveryS3IpFinderBucketEndpointSelfTest extends TcpDiscoveryS3
     @Override public void testIpFinder() throws Exception {
         super.testIpFinder();
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/fe36e629/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSSEAlgorithmSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSSEAlgorithmSelfTest.java
b/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSSEAlgorithmSelfTest.java
new file mode 100644
index 0000000..838a3c6
--- /dev/null
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSSEAlgorithmSelfTest.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.spi.discovery.tcp.ipfinder.s3;
+
+import com.amazonaws.auth.BasicAWSCredentials;
+import org.apache.ignite.testsuites.IgniteS3TestSuite;
+
+/**
+ * TcpDiscoveryS3IpFinder tests server-side encryption algorithm for Amazon S3-managed encryption
keys.
+ * For information about possible S3-managed encryption keys visit
+ * <a href="http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html">docs.aws.amazon.com</a>.
+ */
+public class TcpDiscoveryS3IpFinderSSEAlgorithmSelfTest extends TcpDiscoveryS3IpFinderAbstractSelfTest
{
+    /**
+     * Constructor.
+     *
+     * @throws Exception If any error occurs.
+     */
+    public TcpDiscoveryS3IpFinderSSEAlgorithmSelfTest() throws Exception {
+        SSEAlgorithm = "AES256";
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void setAwsCredentials(TcpDiscoveryS3IpFinder finder) {
+        finder.setAwsCredentials(new BasicAWSCredentials(IgniteS3TestSuite.getAccessKey(),
+            IgniteS3TestSuite.getSecretKey()));
+    }
+
+    /** {@inheritDoc} */
+    @Override public void testIpFinder() throws Exception {
+        super.testIpFinder();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/fe36e629/modules/aws/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
b/modules/aws/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
index 009916b..f96340e 100644
--- a/modules/aws/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
+++ b/modules/aws/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
@@ -22,11 +22,13 @@ import org.apache.ignite.spi.checkpoint.s3.S3CheckpointManagerSelfTest;
 import org.apache.ignite.spi.checkpoint.s3.S3CheckpointSpiConfigSelfTest;
 import org.apache.ignite.spi.checkpoint.s3.S3CheckpointSpiSelfTest;
 import org.apache.ignite.spi.checkpoint.s3.S3CheckpointSpiStartStopBucketEndpointSelfTest;
+import org.apache.ignite.spi.checkpoint.s3.S3CheckpointSpiStartStopSSEAlgorithmSelfTest;
 import org.apache.ignite.spi.checkpoint.s3.S3CheckpointSpiStartStopSelfTest;
 import org.apache.ignite.spi.checkpoint.s3.S3SessionCheckpointSelfTest;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinderAwsCredentialsProviderSelfTest;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinderAwsCredentialsSelfTest;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinderBucketEndpointSelfTest;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinderSSEAlgorithmSelfTest;
 import org.apache.ignite.testframework.IgniteTestSuite;
 
 /**
@@ -47,11 +49,13 @@ public class IgniteS3TestSuite extends TestSuite {
         suite.addTestSuite(S3CheckpointManagerSelfTest.class);
         suite.addTestSuite(S3SessionCheckpointSelfTest.class);
         suite.addTestSuite(S3CheckpointSpiStartStopBucketEndpointSelfTest.class);
+        suite.addTestSuite(S3CheckpointSpiStartStopSSEAlgorithmSelfTest.class);
 
         // S3 IP finder.
         suite.addTestSuite(TcpDiscoveryS3IpFinderAwsCredentialsSelfTest.class);
         suite.addTestSuite(TcpDiscoveryS3IpFinderAwsCredentialsProviderSelfTest.class);
         suite.addTestSuite(TcpDiscoveryS3IpFinderBucketEndpointSelfTest.class);
+        suite.addTestSuite(TcpDiscoveryS3IpFinderSSEAlgorithmSelfTest.class);
 
         return suite;
     }


Mime
View raw message