-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(feature-manager): remove webhooks, verified content (#2159)
* feat(feature-manager): remove webhooks, verified content from feature manager * build: add default signing key in dev * docs: add comment about SQS url default
- Loading branch information
1 parent
410e828
commit 7c07f2f
Showing
11 changed files
with
52 additions
and
280 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import FeatureManager from './util/FeatureManager.class' | ||
import sms from './sms.config' | ||
import spcpMyInfo from './spcp-myinfo.config' | ||
import webhookVerifiedContent from './webhook-verified-content.config' | ||
|
||
export * from './types' | ||
|
||
const featureManager = new FeatureManager() | ||
|
||
// Register features and associated middleware/fallbacks | ||
featureManager.register(spcpMyInfo) | ||
featureManager.register(webhookVerifiedContent) | ||
featureManager.register(sms) | ||
|
||
export default featureManager |
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
46 changes: 26 additions & 20 deletions
46
src/app/config/feature-manager/webhook-verified-content.config.ts
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,22 +1,28 @@ | ||
import { FeatureNames, RegisterableFeature } from './types' | ||
import convict, { Schema } from 'convict' | ||
|
||
const webhookVerifiedContentFeature: RegisterableFeature<FeatureNames.WebhookVerifiedContent> = | ||
{ | ||
name: FeatureNames.WebhookVerifiedContent, | ||
schema: { | ||
signingSecretKey: { | ||
doc: 'The secret key for signing verified content passed into the database and for signing webhooks', | ||
format: String, | ||
default: null, | ||
env: 'SIGNING_SECRET_KEY', | ||
}, | ||
webhookQueueUrl: { | ||
doc: 'URL of AWS SQS queue for webhook retries', | ||
format: String, | ||
default: '', | ||
env: 'WEBHOOK_SQS_URL', | ||
}, | ||
}, | ||
} | ||
export interface IWebhooksAndVerifiedContent { | ||
signingSecretKey: string | ||
webhookQueueUrl: string | ||
} | ||
|
||
export default webhookVerifiedContentFeature | ||
const webhooksAndVerifiedContentSchema: Schema<IWebhooksAndVerifiedContent> = { | ||
signingSecretKey: { | ||
doc: 'The secret key for signing verified content passed into the database and for signing webhooks', | ||
format: String, | ||
default: null, | ||
env: 'SIGNING_SECRET_KEY', | ||
}, | ||
webhookQueueUrl: { | ||
doc: 'URL of AWS SQS queue for webhook retries', | ||
format: String, | ||
// Allow this to default to empty string so retries can be disabled easily | ||
default: '', | ||
env: 'WEBHOOK_SQS_URL', | ||
}, | ||
} | ||
|
||
export const webhooksAndVerifiedContentConfig = convict( | ||
webhooksAndVerifiedContentSchema, | ||
) | ||
.validate({ allowed: 'strict' }) | ||
.getProperties() |
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
4 changes: 0 additions & 4 deletions
4
src/app/modules/verified-content/__tests__/__mocks__/verified-content.factory.ts
This file was deleted.
Oops, something went wrong.
140 changes: 0 additions & 140 deletions
140
src/app/modules/verified-content/__tests__/verified-content.factory.spec.ts
This file was deleted.
Oops, something went wrong.
66 changes: 0 additions & 66 deletions
66
src/app/modules/verified-content/verified-content.factory.ts
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.