[CORL-687] Webhooks (#2738)

* feat: initial webhook impl

* feat: added support for key rotation

* feat: harmonized fetcher

* feat: added expired secrets cleaning

* feat: event system refactor

* feat: added story event

* feat: simplfiied webhook handler

* feat: added ref's to locations where user events can be added

* feat: added UI to support webhooks

* fix: renaming some Webhook -> WebhookEndpoint

* fix: review comments to adjuist flow

* feat: added localizations

* fix: linting, updated snapshots

* fix: adapted for new fluent

* fix: rearranged folders

* fix: linting

* feat: added webhooks documentation

* feat: improved toc generation

* feat: added some tests to webhooks

* fix: chain transition hooks

* feat: added tests around webhook ui

* fix: renamed events

* fix: adjusted circle markdown linting

* fix: adjusted doctoc script call

* review: review fixes

* review: review comments

* review: adjusted signing secret confirmation

* review: adjusted styles to harmonize button usage

* fix: updated snapshots and tests

* review: move form out of webhooks

Moved the form out of the webhooks by relocating the layout used for the
route associated with the configure routes.

* fix: fixed bugs and snapshots with tests

* feat: revised slack message format to use block api

* fix: fixed a small text bug

Co-authored-by: Vinh <vinh@vinh.tech>
Co-authored-by: Kim Gardner <kgardnr@gmail.com>
This commit is contained in:
Wyatt Johnson
2020-02-18 13:25:48 -05:00
committed by GitHub
co-authored by Vinh Kim Gardner
parent 34ba2da88d
commit e42c2b925d
137 changed files with 5633 additions and 1020 deletions
+6 -20
View File
@@ -4,21 +4,18 @@ import uuid from "uuid";
import { LanguageCode } from "coral-common/helpers/i18n/locales";
import { Config } from "coral-server/config";
import {
createPublisher,
Publisher,
} from "coral-server/graph/subscriptions/publisher";
import CoralEventListenerBroker, {
CoralEventPublisherBroker,
} from "coral-server/events/publisher";
import logger, { Logger } from "coral-server/logger";
import { PersistedQuery } from "coral-server/models/queries";
import { Tenant } from "coral-server/models/tenant";
import { User } from "coral-server/models/user";
import { MailerQueue } from "coral-server/queue/tasks/mailer";
import { NotifierQueue } from "coral-server/queue/tasks/notifier";
import { ScraperQueue } from "coral-server/queue/tasks/scraper";
import { I18n } from "coral-server/services/i18n";
import { JWTSigningConfig } from "coral-server/services/jwt";
import { AugmentedRedis } from "coral-server/services/redis";
import createSlackPublisher from "coral-server/services/slack/publisher";
import TenantCache from "coral-server/services/tenant/cache";
import { Request } from "coral-server/types/express";
@@ -41,16 +38,17 @@ export interface GraphContextOptions {
i18n: I18n;
mailerQueue: MailerQueue;
mongo: Db;
notifierQueue: NotifierQueue;
pubsub: RedisPubSub;
redis: AugmentedRedis;
scraperQueue: ScraperQueue;
tenant: Tenant;
tenantCache: TenantCache;
broker: CoralEventListenerBroker;
}
export default class GraphContext {
public readonly config: Config;
public readonly broker: CoralEventPublisherBroker;
public readonly disableCaching: boolean;
public readonly i18n: I18n;
public readonly id: string;
@@ -61,7 +59,6 @@ export default class GraphContext {
public readonly mongo: Db;
public readonly mutators: ReturnType<typeof mutators>;
public readonly now: Date;
public readonly publisher: Publisher;
public readonly pubsub: RedisPubSub;
public readonly redis: AugmentedRedis;
public readonly scraperQueue: ScraperQueue;
@@ -100,18 +97,7 @@ export default class GraphContext {
this.signingConfig = options.signingConfig;
this.clientID = options.clientID;
this.publisher = createPublisher({
pubsub: this.pubsub,
slackPublisher: createSlackPublisher(
this.mongo,
this.config,
this.tenant
),
notifierQueue: options.notifierQueue,
tenantID: this.tenant.id,
clientID: this.clientID,
});
this.broker = options.broker.instance(this);
this.loaders = loaders(this);
this.mutators = mutators(this);
}