MCPcopy Index your code
hub / github.com/scality/cloudserver / templateSSEConfig

Function templateSSEConfig

tests/unit/utils/bucketEncryption.js:4–25  ·  view source on GitHub ↗
({ algorithm, keyId })

Source from the content-addressed store, hash-verified

2
3
4function 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
27function templateRequest(bucketName, { post }) {
28 return {

Callers 3

bucketDelete.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected