({ algorithm, keyId })
| 2 | |
| 3 | |
| 4 | function templateSSEConfig({ algorithm, keyId }) { |
| 5 | const xml = []; |
| 6 | xml.push(` |
| 7 | <?xml version="1.0" encoding="UTF-8"?> |
| 8 | <ServerSideEncryptionConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> |
| 9 | <Rule> |
| 10 | <ApplyServerSideEncryptionByDefault>` |
| 11 | ); |
| 12 | |
| 13 | if (algorithm) { |
| 14 | xml.push(`<SSEAlgorithm>${algorithm}</SSEAlgorithm>`); |
| 15 | } |
| 16 | |
| 17 | if (keyId) { |
| 18 | xml.push(`<KMSMasterKeyID>${keyId}</KMSMasterKeyID>`); |
| 19 | } |
| 20 | |
| 21 | xml.push(`</ApplyServerSideEncryptionByDefault> |
| 22 | </Rule> |
| 23 | </ServerSideEncryptionConfiguration>`); |
| 24 | return xml.join(''); |
| 25 | } |
| 26 | |
| 27 | function templateRequest(bucketName, { post }) { |
| 28 | return { |
no outgoing calls
no test coverage detected