Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit 3b6f83f

Browse files
committed
Add OAuth support
1 parent 04be347 commit 3b6f83f

18 files changed

+406
-914
lines changed

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ NPM Package version 1.x.x supports Zeebe 0.15/0.16.
2727

2828
Protobuf fields of type `int64` are serialised as type string in the Node library. These fields are serialised as numbers (long) in the Go and Java client. See [grpc/#7229](https://github.com/grpc/grpc/issues/7229) for why the Node library serialises them as string. The Workflow instance key, and other fields that are of type long in other client libraries, are type string in this library. Fields of type `int32` are serialised as type number in the Node library.
2929

30+
## Scaffolding code from a BPM file
31+
32+
You can scaffold your worker code from a BPMN file with the `bin/zeebe-node-cli` command. Pass in the path to the BPMN file, and it will produce a file to implement it.
33+
3034
## Example Use
3135

3236
### Add the Library to your Project
@@ -87,14 +91,23 @@ const zbc = new ZB.ZBClient(gatewayAddress, {
8791

8892
Retry is provided by [promise-retry](https://www.npmjs.com/package/promise-retry), and the back-off strategy is simple ^2.
8993

90-
### TLS
94+
Additionally, the gRPC Client will contiually reconnect when in a failed state.
9195

92-
In case you need to connect to a secured endpoint, you can enable TLS.
96+
### OAuth
97+
98+
In case you need to connect to a secured endpoint with OAuth (such as Camunda Cloud), you can pass in OAuth credentials. This will enable TLS, and handle the OAuth flow to get / renew a JWT:
9399

94100
```typescript
95-
const zbc = new ZB.ZBClient(gatewayAddress, {
96-
tls: true,
97-
})
101+
const zbc = new ZB.ZBClient("103ca930-6da6-4df7-aa97-941eb1f85040.zeebe.camunda.io:443", {
102+
auth: {
103+
url: "https://login.cloud.camunda.io/oauth/token",
104+
audience: "103ca930-6da6-4df7-aa97-941eb1f85040.zeebe.camunda.io",
105+
clientId: "yStuGvJ6a1RQhy8DQpeXJ80yEpar3pXh",
106+
clientSecret:
107+
"WZahIGHjyj0-oQ7DZ_aH2wwNuZt5O8Sq0ZJTz0OaxfO7D6jaDBZxM_Q-BHRsiGO_",
108+
cache: true
109+
}
110+
}
98111
```
99112
100113
### Create a Task Worker
@@ -289,8 +302,6 @@ export enum MessageName = {
289302
};
290303
```
291304
292-
## Scaffolding code from a BPM file
293-
294305
## Logging
295306
296307
Control the log output for the client library by setting the ZBClient log level. Valid log levels are `NONE` (supress all logging), `ERROR` (log only exceptions), `INFO` (general logging), or `DEBUG` (verbose logging). You can set this in the client constructor:

docker/docker-compose.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

docker/monitor/docker-compose.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.
-11.2 MB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)