-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/perf-test
- Loading branch information
Showing
13 changed files
with
1,865 additions
and
1,590 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:20.10.0-bullseye-slim as base-with-encryption | ||
FROM node:20.11.0-bullseye-slim as base-with-encryption | ||
|
||
WORKDIR /cryptd | ||
|
||
|
@@ -10,7 +10,7 @@ RUN apt-get update && \ | |
|
||
######################################################################################################################## | ||
|
||
FROM node:20.10.0-bullseye-slim as build | ||
FROM node:20.11.0-bullseye-slim as build | ||
|
||
ARG COMMIT_SHA=<not-specified> | ||
ENV NODE_ENV=production | ||
|
@@ -30,7 +30,7 @@ RUN echo "crud-service: $COMMIT_SHA" >> ./commit.sha | |
|
||
# create a CRUD Service image that does not support automatic CSFLE | ||
# and therefore it can be employed by everybody in any MongoDB product | ||
FROM node:20.10.0-bullseye-slim as crud-service-no-encryption | ||
FROM node:20.11.0-bullseye-slim as crud-service-no-encryption | ||
|
||
# note: zlib can be removed once node image version is updated | ||
RUN apt-get update \ | ||
|
@@ -43,7 +43,7 @@ LABEL maintainer="Mia Platform Core Team<[email protected]>" \ | |
name="CRUD Service" \ | ||
description="HTTP interface to perform CRUD operations on configured MongoDB collections" \ | ||
eu.mia-platform.url="https://www.mia-platform.eu" \ | ||
eu.mia-platform.version="6.9.4" | ||
eu.mia-platform.version="6.9.5" | ||
|
||
ENV NODE_ENV=production | ||
ENV LOG_LEVEL=info | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright 2024 Mia s.r.l. | ||
* | ||
* Licensed 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. | ||
*/ | ||
'use strict' | ||
|
||
const csvParse = require('csv-parse') | ||
const csvStringify = require('csv-stringify') | ||
|
||
module.exports = (parsingOptions) => ({ | ||
stringifier: () => [csvStringify.stringify({ | ||
encoding: 'utf8', | ||
delimiter: ',', | ||
escape: '\\', | ||
header: true, | ||
quote: false, | ||
...parsingOptions, | ||
cast: { | ||
object: (value) => { | ||
try { | ||
return { value: JSON.stringify(value), quote: true } | ||
} catch (errs) { | ||
return value | ||
} | ||
}, | ||
}, | ||
})], | ||
parser: () => csvParse.parse({ | ||
encoding: 'utf8', | ||
delimiter: ',', | ||
columns: true, | ||
skip_empty_lines: true, | ||
relax_quotes: true, | ||
escape: '\\', | ||
...parsingOptions, | ||
cast: (value) => { | ||
try { | ||
return JSON.parse(value) | ||
} catch (errs) { | ||
return value | ||
} | ||
}, | ||
}), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright 2024 Mia s.r.l. | ||
* | ||
* Licensed 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. | ||
*/ | ||
'use strict' | ||
|
||
const { Transform } = require('stream') | ||
const XLSXTransformStream = require('xlsx-write-stream') | ||
|
||
module.exports = () => ({ | ||
stringifier: () => { | ||
let headerProcessed = false | ||
const dataTransformer = new Transform({ | ||
transform(chunk, _, callback) { | ||
if (!headerProcessed) { | ||
headerProcessed = true | ||
const columns = Object.keys(chunk) | ||
this.push(columns) | ||
} | ||
|
||
this.push( | ||
Object.values(chunk) | ||
.map(documentValue => ( | ||
typeof documentValue === 'object' | ||
? JSON.stringify(documentValue) | ||
: documentValue | ||
)) | ||
) | ||
return callback() | ||
}, | ||
objectMode: true, | ||
}) | ||
const xlsxTransformer = new XLSXTransformStream() | ||
return [dataTransformer, xlsxTransformer] | ||
}, | ||
parser: () => { throw new Error('not implemented') }, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2024 Mia s.r.l. | ||
* | ||
* Licensed 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. | ||
*/ | ||
'use strict' | ||
|
||
const JSONStream = require('JSONStream') | ||
|
||
module.exports = () => ({ | ||
stringifier: () => [JSONStream.stringify()], | ||
parser: () => JSONStream.parse('*'), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2024 Mia s.r.l. | ||
* | ||
* Licensed 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. | ||
*/ | ||
'use strict' | ||
|
||
const ndjson = require('ndjson') | ||
|
||
module.exports = () => ({ | ||
stringifier: () => [ndjson.stringify()], | ||
parser: () => ndjson.parse(), | ||
}) |
Oops, something went wrong.