Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#1945 cgs merge #338

Merged
merged 4 commits into from
Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
deploy/
coverage/
node_modules/
.dockerignore
.editorconfig
.git/
.gitignore
.istanbul.yml
circle.yml
docker-compose.circle.yml
docker-compose.dev.yml
docker-compose.functional.yml
docker-compose.yml
Dockerfile
LICENSE
sonar-project.properties
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ jspm_packages
**/*.iml

.history
/.gitlab-ci.env
junit.xml
12 changes: 12 additions & 0 deletions .ncurc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"reject":
[
"mustache",
"nodemon",
"npm-check-updates",
"nyc",
"sinon",
"standard",
"tape",
],
}
22 changes: 22 additions & 0 deletions .nycrc.integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
temp-directory: "./.nyc_output"
check-coverage: true
per-file: true
lines: 90
statements: 90
functions: 90
branches: 90
all: true
include: [
"src/**/*.js"
]
instrument: true
reporter: [
"lcov",
"text-summary",
"html"
]
exclude: [
"**/node_modules/**",
'**/migrations/**',
'**/docs/**',
]
6 changes: 4 additions & 2 deletions .nycrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ all: true
include: [
"src/**/*.js"
]
instrument: true
reporter: [
"lcov",
"text-summary"
"text-summary",
"html"
]
exclude: [
"**/node_modules/**",
'**/migrations/**',
'**/docs/**'
'**/docs/**',
]
31 changes: 31 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.
## These owners will be the default owners for everything in
## the repo. Unless a later match takes precedence,
## @global-owner1 and @global-owner2 will be requested for
## review when someone opens a pull request.
#* @global-owner1 @global-owner2
* @vgenev @mdebarros @elnyry-sam-k @lewisdaly @oderayi @shashi165
## Order is important; the last matching pattern takes the most
## precedence. When someone opens a pull request that only
## modifies JS files, only @js-owner and not the global
## owner(s) will be requested for a review.
# *.js @js-owner
## You can also use email addresses if you prefer. They'll be
## used to look up users just like we do for commit author
## emails.
#*.go docs@example.com
# In this example, @doctocat owns any files in the build/logs
# directory at the root of the repository and any of its
# subdirectories.
# /build/logs/ @doctocat
## The `docs/*` pattern will match files like
## `docs/getting-started.md` but not further nested files like
## `docs/build-app/troubleshooting.md`.
# docs/* docs@example.com
## In this example, @octocat owns any file in an apps directory
## anywhere in your repository.
#apps/ @octocat
## In this example, @doctocat owns any file in the `/docs`
## directory in the root of your repository.
#/docs/ @doctocat
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@ COPY package.json package-lock.json* /opt/central-settlement/
RUN npm install

COPY config /opt/central-settlement/config
COPY scripts /opt/central-settlement/scripts
COPY src /opt/central-settlement/src
COPY README.md /opt/central-settlement

FROM node:12.16.1-alpine
FROM builder
WORKDIR /opt/central-settlement

# Create empty log file & link stdout to the application log file
RUN mkdir ./logs && touch ./logs/combined.log
RUN ln -sf /dev/stdout ./logs/combined.log

RUN mkdir ./logs && touch ./logs/combined.log \
&& ln -sf /dev/stdout ./logs/combined.log \
&& adduser -D ml-user
# Create a non-root user: ml-user
RUN adduser -D ml-user
# RUN adduser -D ml-user
USER ml-user

COPY --chown=ml-user --from=builder /opt/central-settlement .
RUN npm prune --production

EXPOSE 3007
CMD node src/api/index.js
CMD ["node" "src/handlers/index.js" "h" "--transfersettlement"]
vgenev marked this conversation as resolved.
Show resolved Hide resolved
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ The service manages Settlement Windows and Settlements Event Triggers and provid

## Contents:

- [Deployment](#deployment)
- [Configuration](#configuration)
- [API](#api)
- [Logging](#logging)
- [Tests](#tests)
- [Auditing Dependencies](#auditing-dependencies)
- [Container Scans](#container-scans)
- [central-settlements](#central-settlements)
- [Contents:](#contents)
- [Deployment](#deployment)
- [Configuration](#configuration)
- [Environmental variables](#environmental-variables)
- [API](#api)
- [Logging](#logging)
- [Tests](#tests)
- [Running Integration Tests interactively](#running-integration-tests-interactively)
- [Auditing Dependencies](#auditing-dependencies)
- [Container Scans](#container-scans)

## Deployment

Expand Down Expand Up @@ -51,6 +55,10 @@ Running the tests:

Tests include code coverage via istanbul. See the test/ folder for testing scripts.

Running integration tests (narrow)

npm run test:int:narrow

### Running Integration Tests interactively

If you want to run integration tests in a repetitive manner, you can startup the test containers using `docker-compose`, login to running `central-settlement` container like so:
Expand Down Expand Up @@ -92,4 +100,4 @@ If you find your release builds are failing, refer to the [container scanning](h
For more information on anchore and anchore-cli, refer to:
- [Anchore CLI](https://github.com/anchore/anchore-cli)
- [Circle Orb Registry](https://circleci.com/orbs/registry/orb/anchore/anchore-engine)

-
115 changes: 65 additions & 50 deletions audit-resolve.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,113 +86,113 @@
},
"1179|@mojaloop/central-ledger>@mojaloop/central-services-health>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>node-pre-gyp>mkdirp>minimist": {
"decision": "ignore",
"madeAt": 1607598687029,
"expiresAt": 1608203403058
"madeAt": 1612274482175,
"expiresAt": 1614866450093
},
"1179|@mojaloop/central-ledger>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>node-pre-gyp>mkdirp>minimist": {
"decision": "ignore",
"madeAt": 1607598687029,
"expiresAt": 1608203403058
"madeAt": 1612274482175,
"expiresAt": 1614866450093
},
"1179|@mojaloop/central-ledger>@mojaloop/event-sdk>grpc>node-pre-gyp>mkdirp>minimist": {
"decision": "ignore",
"madeAt": 1607598687029,
"expiresAt": 1608203403058
"madeAt": 1612274482175,
"expiresAt": 1614866450093
},
"1179|@mojaloop/central-ledger>@mojaloop/central-services-health>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>node-pre-gyp>tar>mkdirp>minimist": {
"decision": "ignore",
"madeAt": 1607598687029,
"expiresAt": 1608203403058
"madeAt": 1612274482175,
"expiresAt": 1614866450093
},
"1179|@mojaloop/central-ledger>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>node-pre-gyp>tar>mkdirp>minimist": {
"decision": "ignore",
"madeAt": 1607598687029,
"expiresAt": 1608203403058
"madeAt": 1612274482175,
"expiresAt": 1614866450093
},
"1179|@mojaloop/central-ledger>@mojaloop/event-sdk>grpc>node-pre-gyp>tar>mkdirp>minimist": {
"decision": "ignore",
"madeAt": 1607598687029,
"expiresAt": 1608203403058
"madeAt": 1612274482175,
"expiresAt": 1614866450093
},
"1179|@mojaloop/central-ledger>@mojaloop/central-services-health>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>node-pre-gyp>rc>minimist": {
"decision": "ignore",
"madeAt": 1607598687029,
"expiresAt": 1608203403058
"madeAt": 1612274482175,
"expiresAt": 1614866450093
},
"1179|@mojaloop/central-ledger>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>node-pre-gyp>rc>minimist": {
"decision": "ignore",
"madeAt": 1607598687029,
"expiresAt": 1608203403058
"madeAt": 1612274482175,
"expiresAt": 1614866450093
},
"1179|@mojaloop/central-ledger>@mojaloop/event-sdk>grpc>node-pre-gyp>rc>minimist": {
"decision": "ignore",
"madeAt": 1607598687029,
"expiresAt": 1608203403058
"madeAt": 1612274482175,
"expiresAt": 1614866450093
},
"1500|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1607598691812,
"expiresAt": 1608203403058
"madeAt": 1612274490130,
"expiresAt": 1614866450093
},
"1523|@mojaloop/central-ledger>@mojaloop/central-services-database>lodash": {
"decision": "ignore",
"madeAt": 1607598701364,
"expiresAt": 1608203403058
"madeAt": 1612274494369,
"expiresAt": 1614866450093
},
"1523|@mojaloop/central-ledger>@mojaloop/central-services-error-handling>lodash": {
"decision": "ignore",
"madeAt": 1607598701364,
"expiresAt": 1608203403058
"madeAt": 1612274494370,
"expiresAt": 1614866450093
},
"1523|@mojaloop/central-ledger>@mojaloop/central-services-health>@mojaloop/central-services-error-handling>lodash": {
"decision": "ignore",
"madeAt": 1607598701364,
"expiresAt": 1608203403058
"madeAt": 1612274494370,
"expiresAt": 1614866450093
},
"1523|@mojaloop/central-ledger>@mojaloop/central-services-health>@mojaloop/central-services-shared>@mojaloop/central-services-error-handling>lodash": {
"decision": "ignore",
"madeAt": 1607598701364,
"expiresAt": 1608203403058
"madeAt": 1612274494370,
"expiresAt": 1614866450093
},
"1523|@mojaloop/central-ledger>@mojaloop/central-services-shared>@mojaloop/central-services-error-handling>lodash": {
"decision": "ignore",
"madeAt": 1607598701364,
"expiresAt": 1608203403058
"madeAt": 1612274494370,
"expiresAt": 1614866450093
},
"1523|@mojaloop/central-ledger>@mojaloop/central-services-stream>@mojaloop/central-services-error-handling>lodash": {
"decision": "ignore",
"madeAt": 1607598701364,
"expiresAt": 1608203403058
"madeAt": 1612274494370,
"expiresAt": 1614866450093
},
"1523|@mojaloop/central-ledger>@mojaloop/central-services-health>@mojaloop/central-services-shared>@mojaloop/event-sdk>lodash": {
"decision": "ignore",
"madeAt": 1607598701364,
"expiresAt": 1608203403058
"madeAt": 1612274494370,
"expiresAt": 1614866450093
},
"1523|@mojaloop/central-ledger>@mojaloop/central-services-health>@mojaloop/central-services-shared>lodash": {
"decision": "ignore",
"madeAt": 1607598701364,
"expiresAt": 1608203403058
"madeAt": 1612274494370,
"expiresAt": 1614866450093
},
"1523|@mojaloop/central-ledger>@mojaloop/central-services-shared>@mojaloop/event-sdk>lodash": {
"decision": "ignore",
"madeAt": 1607598701364,
"expiresAt": 1608203403058
"madeAt": 1612274494370,
"expiresAt": 1614866450093
},
"1523|@mojaloop/central-ledger>@mojaloop/event-sdk>lodash": {
"decision": "ignore",
"madeAt": 1607598701364,
"expiresAt": 1608203403058
"madeAt": 1612274494370,
"expiresAt": 1614866450093
},
"1523|@mojaloop/central-ledger>@mojaloop/central-services-shared>lodash": {
"decision": "ignore",
"madeAt": 1607598701364,
"expiresAt": 1608203403058
"madeAt": 1612274494370,
"expiresAt": 1614866450093
},
"1523|@mojaloop/central-ledger>lodash": {
"decision": "ignore",
"madeAt": 1607598701364,
"expiresAt": 1608203403058
"madeAt": 1612274494370,
"expiresAt": 1614866450093
},
"1589|@mojaloop/central-ledger>@mojaloop/central-object-store>@mojaloop/central-services-logger>rc>ini": {
"decision": "fix",
Expand Down Expand Up @@ -312,18 +312,33 @@
},
"1589|@mojaloop/central-ledger>@mojaloop/central-services-health>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>node-pre-gyp>rc>ini": {
"decision": "ignore",
"madeAt": 1607619606561,
"expiresAt": 1608224358700
"madeAt": 1612274497165,
"expiresAt": 1614866450093
},
"1589|@mojaloop/central-ledger>@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>node-pre-gyp>rc>ini": {
"decision": "ignore",
"madeAt": 1607619606561,
"expiresAt": 1608224358700
"madeAt": 1612274497165,
"expiresAt": 1614866450093
},
"1589|@mojaloop/central-ledger>@mojaloop/event-sdk>grpc>node-pre-gyp>rc>ini": {
"decision": "ignore",
"madeAt": 1607619606561,
"expiresAt": 1608224358700
"madeAt": 1612274497165,
"expiresAt": 1614866450093
},
"1500|@mojaloop/central-services-health>@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1612274490130,
"expiresAt": 1614866450093
},
"1594|@mojaloop/central-ledger>@mojaloop/central-services-health>@mojaloop/central-services-shared>axios": {
"decision": "ignore",
"madeAt": 1612274499239,
"expiresAt": 1614866450093
},
"1594|@mojaloop/central-ledger>@mojaloop/central-services-shared>axios": {
"decision": "ignore",
"madeAt": 1612274499239,
"expiresAt": 1614866450093
}
},
"rules": {},
Expand Down
Loading