Skip to content

Commit

Permalink
♻️ (gocardless) renamed nordigen_* secrets to gocardless_*
Browse files Browse the repository at this point in the history
  • Loading branch information
MatissJanis committed Dec 15, 2023
1 parent 5ac4c58 commit 633463a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
19 changes: 19 additions & 0 deletions migrations/1702667624000-rename-nordigen-secrets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import getAccountDb from '../src/account-db.js';

export const up = async function () {
await getAccountDb().exec(
`UPDATE secrets SET name = "gocardless_secretId" WHERE name = "nordigen_secretId"`,
);
await getAccountDb().exec(
`UPDATE secrets SET name = "gocardless_secretKey" WHERE name = "nordigen_secretKey" `,
);
};

export const down = async function () {
await getAccountDb().exec(
`UPDATE secrets SET name = "nordigen_secretId" WHERE name = "gocardless_secretId"`,
);
await getAccountDb().exec(
`UPDATE secrets SET name = "nordigen_secretKey" WHERE name = "gocardless_secretKey" `,
);
};
4 changes: 2 additions & 2 deletions src/app-gocardless/services/gocardless-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const clients = new Map();

const getGocardlessClient = () => {
const secrets = {
secretId: secretsService.get(SecretName.nordigen_secretId),
secretKey: secretsService.get(SecretName.nordigen_secretKey),
secretId: secretsService.get(SecretName.gocardless_secretId),
secretKey: secretsService.get(SecretName.gocardless_secretKey),
};

const hash = JSON.stringify(secrets);
Expand Down
1 change: 0 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ app.use(

app.use('/sync', syncApp.handlers);
app.use('/account', accountApp.handlers);
app.use('/nordigen', goCardlessApp.handlers);
app.use('/gocardless', goCardlessApp.handlers);
app.use('/secret', secretApp.handlers);

Expand Down
4 changes: 2 additions & 2 deletions src/services/secrets-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import getAccountDb from '../account-db.js';
* @enum {string}
*/
export const SecretName = {
nordigen_secretId: 'nordigen_secretId',
nordigen_secretKey: 'nordigen_secretKey',
gocardless_secretId: 'gocardless_secretId',
gocardless_secretKey: 'gocardless_secretKey',
};

class SecretsDb {
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/293.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MatissJanis]
---

migration: rename `nordigen_*` secrets to `gocardless_*`

0 comments on commit 633463a

Please sign in to comment.