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

Set up credentials router for user management backend #2882

Merged
merged 13 commits into from
Feb 28, 2022
14 changes: 6 additions & 8 deletions packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,12 @@ import { DEFAULT_EXECUTIONS_GET_ALL_LIMIT, validateEntity } from './GenericHelpe
import { ExecutionEntity } from './databases/entities/ExecutionEntity';
import { SharedWorkflow } from './databases/entities/SharedWorkflow';
import { RESPONSE_ERROR_MESSAGES } from './constants';
import { credentialsEndpoints } from './api/namespaces/credentials';
import { credentialsController } from './api/credentials.api';

require('body-parser-xml')(bodyParser);

export const externalHooks: IExternalHooksClass = ExternalHooks();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instantiated outside App to share with credentials router.


class App {
app: express.Application;

Expand Down Expand Up @@ -260,7 +262,7 @@ class App {
this.sslKey = config.get('ssl_key');
this.sslCert = config.get('ssl_cert');

this.externalHooks = ExternalHooks();
this.externalHooks = externalHooks;

this.presetCredentialsLoaded = false;
this.endpointPresetCredentials = config.get('credentials.overwrite.endpoint') as string;
Expand Down Expand Up @@ -653,6 +655,8 @@ class App {
// ----------------------------------------
await userManagementRouter.addRoutes.apply(this, [ignoredEndpoints, this.restEndpoint]);

this.app.use(`/${this.restEndpoint}/credentials`, credentialsController);

// ----------------------------------------
// Healthcheck
// ----------------------------------------
Expand Down Expand Up @@ -1557,12 +1561,6 @@ class App {
}),
);

// ----------------------------------------
// Credentials
// ----------------------------------------

credentialsEndpoints.apply(this);

// ----------------------------------------
// Credential-Types
// ----------------------------------------
Expand Down
Loading