Skip to content

Commit

Permalink
feat: Integrate certificate store (#680)
Browse files Browse the repository at this point in the history
So that we can rotate certificates.

Fixes #49

TODO

- [x] Move certificates from private key store to certificate store.
- [x] Write migration script.
- [x] Delete all references to `GATEWAY_KEY_ID` env var
- [x] Alter `/cogrpc/service.spec.ts` to use real MongoDB instead of complicated mocks.
- [x] Remove `retrieveOwnCertificates`.
- [x] Remove all `VAULT_*` env vars from functional test dir.
  • Loading branch information
gnarea authored Nov 30, 2021
1 parent 89df49a commit 5a78d88
Show file tree
Hide file tree
Showing 47 changed files with 997 additions and 380 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install dependencies
run: npm ci
- run: npm run static-checks
- run: npm run test:ci:unit
- run: npm run test:unit

- uses: azure/setup-helm@v1
with:
Expand Down Expand Up @@ -61,7 +61,6 @@ jobs:
kubectl port-forward --address 127.0.0.1 svc/public-gateway-pohttp 8081:8080 &
kubectl port-forward --address 127.0.0.1 svc/public-gateway-cogrpc 8082:8081 &
kubectl port-forward --address 127.0.0.1 svc/relaynet-pong-pohttp 8083:80 &
kubectl port-forward --address 127.0.0.1 svc/public-gateway-vault 8200:8200 &
kubectl port-forward --address 127.0.0.1 svc/nats 4222:4222 &
kubectl port-forward --address 127.0.0.1 svc/minio 9000:9000 &
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ docs/vendor

chart/charts
chart/tmpcharts

# Work around https://github.com/shelfio/jest-mongodb/issues/214
/globalConfig.json
3 changes: 0 additions & 3 deletions chart/templates/cogrpc-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ spec:
{{- toYaml .Values.podAnnotations | nindent 8 }}
{{- end }}
global-cm-digest: {{ include "relaynet-internet-gateway.resourceDigest" (merge (dict "fileName" "global-cm.yml") .) }}
generated-cm-digest: {{ include "relaynet-internet-gateway.resourceDigest" (merge (dict "fileName" "generated-cm.yml") .) }}
mongo-cm-digest: {{ include "relaynet-internet-gateway.resourceDigest" (merge (dict "fileName" "mongo-cm.yml") .) }}
global-secret-digest: {{ include "relaynet-internet-gateway.resourceDigest" (merge (dict "fileName" "global-secret.yml") .) }}
labels:
Expand Down Expand Up @@ -50,8 +49,6 @@ spec:
envFrom:
- configMapRef:
name: {{ include "relaynet-internet-gateway.fullname" . }}
- configMapRef:
name: {{ include "relaynet-internet-gateway.fullname" . }}-generated
- configMapRef:
name: {{ include "relaynet-internet-gateway.fullname" . }}-mongo
- secretRef:
Expand Down
11 changes: 0 additions & 11 deletions chart/templates/generated-cm.yml

This file was deleted.

2 changes: 0 additions & 2 deletions chart/templates/keygen-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ spec:
envFrom:
- configMapRef:
name: {{ include "relaynet-internet-gateway.fullname" . }}
- configMapRef:
name: {{ include "relaynet-internet-gateway.fullname" . }}-generated
- configMapRef:
name: {{ include "relaynet-internet-gateway.fullname" . }}-mongo
- secretRef:
Expand Down
3 changes: 0 additions & 3 deletions chart/templates/poweb-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ spec:
{{- toYaml .Values.podAnnotations | nindent 8 }}
{{- end }}
global-cm-digest: {{ include "relaynet-internet-gateway.resourceDigest" (merge (dict "fileName" "global-cm.yml") .) }}
generated-cm-digest: {{ include "relaynet-internet-gateway.resourceDigest" (merge (dict "fileName" "generated-cm.yml") .) }}
mongo-cm-digest: {{ include "relaynet-internet-gateway.resourceDigest" (merge (dict "fileName" "mongo-cm.yml") .) }}
global-secret-digest: {{ include "relaynet-internet-gateway.resourceDigest" (merge (dict "fileName" "global-secret.yml") .) }}
labels:
Expand All @@ -44,8 +43,6 @@ spec:
envFrom:
- configMapRef:
name: {{ include "relaynet-internet-gateway.fullname" . }}
- configMapRef:
name: {{ include "relaynet-internet-gateway.fullname" . }}-generated
- configMapRef:
name: {{ include "relaynet-internet-gateway.fullname" . }}-mongo
- secretRef:
Expand Down
3 changes: 0 additions & 3 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@
}
}
},
"gatewayKeyId": {
"type": "string"
},
"proxyRequestIdHeader": {
"type": "string"
},
Expand Down
11 changes: 11 additions & 0 deletions jest-mongodb-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
mongodbMemoryServerOptions: {
binary: {
version: '4.2.17',
skipMD5: false,
},
instance: {},
autoStart: false,
},
useSharedDBForAllJestWorkers: false,
};
11 changes: 0 additions & 11 deletions jest.config.ci.js

This file was deleted.

11 changes: 5 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
const { defaults: tsjPreset } = require('ts-jest/presets');

module.exports = {
// All imported modules in your tests should be mocked automatically
Expand Down Expand Up @@ -90,7 +89,7 @@ module.exports = {
// notifyMode: "failure-change",

// A preset that is used as a base for Jest's configuration
preset: "ts-jest",
preset: "@shelf/jest-mongodb",

// Run tests from one or more projects
// projects: null,
Expand Down Expand Up @@ -130,8 +129,8 @@ module.exports = {
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
// snapshotSerializers: [],

// The test environment that will be used for testing
testEnvironment: "node",
// Work around https://github.com/shelfio/jest-mongodb/issues/109
// testEnvironment: "node",

// Options that will be passed to the testEnvironment
// testEnvironmentOptions: {},
Expand Down Expand Up @@ -167,7 +166,7 @@ module.exports = {
// timers: "real",

// A map from regular expressions to paths to transformers
// transform: null,
transform: tsjPreset.transform,

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
// transformIgnorePatterns: [
Expand Down
Loading

0 comments on commit 5a78d88

Please sign in to comment.