No description
- TypeScript 100%
| .vscode | ||
| src | ||
| test | ||
| .env.example | ||
| .gitignore | ||
| .oxfmtrc.json | ||
| bun.lock | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
Entra ID Connector
Pre-requisites
Structure
- Node List is operation nodes used in workflow.
- Global Env is global environment variables used in workflow.
- Resources is resources used in workflow and being used by onboarding wizard.
Validate Secret
To validate secret in Connector Workflow Onboarding, call the validator with code-engine.
URL: http://code-engine:3000/api/execute/sync
Method: POST
Body:
{
"code": "<code from validator file>",
"context": [
{
"key": "WorkflowContext",
"value": {
"input": {
"ENTRA_TENANT": "<entra-tenant>",
"ENTRA_CLIENT_ID": "<entra-client-id>",
"ENTRA_CLIENT_SECRET": "<entra-client-secret>"
}
}
}
]
}
Test
Operation node suites are added in suites directory.
bun run test
bun run test ./test/suites/{nodeName}.test.ts
Test suite using Mock implementation of code-engine using node:vm for running untrusted code. It also mocks WorkflowContext and WorkflowSDK. For WorkflowSDK Mock and Stub, test bed uses msw (Mock Service Worker) to mock outgoing HTTP/Websocket calls using network interceptors
Test Case structure
High level structure follows the same testing architecture using bun:test test runner. Always prepare the environment for test case using beforeAll or beforeEach to mock / stub dependency and adjust the environment for test case.
beforeAll(() => {
// Create the entity
// Update flags in system
// Setup msw interceptors
});
afterAll(() => {
// Cleanup the entity
// Reset flags in system
// Reset msw interceptors
});
Test Case Secrets
Add all the secrets in Environment Variables (.env file).