From 2105b10ccdff58a6d1986776c37fc179249f369f Mon Sep 17 00:00:00 2001
From: Tejay Cardon <tejay.cardon@gmail.com>
Date: Tue, 8 Aug 2017 08:15:20 -0600
Subject: FIXES PLT-6648 Add support for Server Side Encryption on S3 (#6467)

Help from Jason Blais on wording
Update storage_settings.jsx
Update en.json
---
 .../components/admin_console/storage_settings.jsx  | 23 +++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

(limited to 'webapp/components/admin_console/storage_settings.jsx')

diff --git a/webapp/components/admin_console/storage_settings.jsx b/webapp/components/admin_console/storage_settings.jsx
index 4e0d9d19b..89a56c04b 100644
--- a/webapp/components/admin_console/storage_settings.jsx
+++ b/webapp/components/admin_console/storage_settings.jsx
@@ -36,6 +36,7 @@ export default class StorageSettings extends AdminSettings {
         config.FileSettings.AmazonS3Bucket = this.state.amazonS3Bucket;
         config.FileSettings.AmazonS3Endpoint = this.state.amazonS3Endpoint;
         config.FileSettings.AmazonS3SSL = this.state.amazonS3SSL;
+        config.FileSettings.AmazonS3SSE = this.state.amazonS3SSE;
 
         return config;
     }
@@ -52,7 +53,8 @@ export default class StorageSettings extends AdminSettings {
             amazonS3SecretAccessKey: config.FileSettings.AmazonS3SecretAccessKey,
             amazonS3Bucket: config.FileSettings.AmazonS3Bucket,
             amazonS3Endpoint: config.FileSettings.AmazonS3Endpoint,
-            amazonS3SSL: config.FileSettings.AmazonS3SSL
+            amazonS3SSL: config.FileSettings.AmazonS3SSL,
+            amazonS3SSE: config.FileSettings.AmazonS3SSE
         };
     }
 
@@ -252,6 +254,25 @@ export default class StorageSettings extends AdminSettings {
                     onChange={this.handleChange}
                     disabled={this.state.driverName !== DRIVER_S3}
                 />
+                <BooleanSetting
+                    id='AmazonSSE'
+                    label={
+                        <FormattedMessage
+                            id='admin.image.AmazonSSETitle'
+                            defaultMessage='Enable Server-Side Encryption for Amazon S3:'
+                        />
+                    }
+                    placeholder={Utils.localizeMessage('admin.image.AmazonSSEExample', 'Ex "false"')}
+                    helpText={
+                        <FormattedMessage
+                            id='admin.image.AmazonSSEDescription'
+                            defaultMessage='When true, encrypt files in Amazon S3 using server-side encryption with Amazon S3-managed keys. See <a href="https://about.mattermost.com/default-server-side-encryption" target="_blank">documentation</a> to learn more.'
+                        />
+                    }
+                    value={this.state.AmazonSSE}
+                    onChange={this.handleChange}
+                    disabled={this.state.driverName !== DRIVER_S3}
+                />
                 <BooleanSetting
                     id='enableFileAttachments'
                     label={
-- 
cgit v1.2.3-1-g7c22

