@t4h.framework/webhook 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ai/skills/framework-webhook/SKILL.md +7 -0
- package/CHANGELOG.md +64 -0
- package/README.md +2 -1
- package/package.json +5 -5
|
@@ -33,7 +33,14 @@ const callback = await webhook({
|
|
|
33
33
|
schema: Type.Object({ status: Type.String() }),
|
|
34
34
|
timeoutInMs: 86_400_000,
|
|
35
35
|
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`auth.secret` (and `password`, `token`, `value` of the other auth types) is a
|
|
39
|
+
`Secret`: declare the env entry with `type: Secret` and pass it whole. The host
|
|
40
|
+
reads the value when it verifies a callback; the pending activity records the
|
|
41
|
+
name, never the value.
|
|
36
42
|
|
|
43
|
+
```typescript
|
|
37
44
|
callback.dispatch?.body // the partner's answer to the request
|
|
38
45
|
callback.body.status // the callback body, typed by schema
|
|
39
46
|
```
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
# @t4h.framework/webhook
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#181](https://github.com/tech4humans-brasil/framework/pull/181) [`9449e4e`](https://github.com/tech4humans-brasil/framework/commit/9449e4e9889f42dea1d52418140f47d25dff0535) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - A credential is a `Secret`, never a string. An env entry declared with
|
|
8
|
+
`type: Secret` hands the workflow the name of the variable; the host binds the
|
|
9
|
+
value where the activity runs, so no input, output or history record holds it.
|
|
10
|
+
|
|
11
|
+
**Breaking**: every field that carries a credential now accepts only a
|
|
12
|
+
`Secret`. Declare the entry with `type: Secret` in your `EnvDesign` and pass it
|
|
13
|
+
whole; `tsc` points at each remaining string.
|
|
14
|
+
|
|
15
|
+
**core**: `Secret` (a `SerializableClass` whose `toString`, `valueOf` and
|
|
16
|
+
`toJSON` throw), `Secret.resolve` and `Secret.read` for hosts, `Secret.FORMAT`
|
|
17
|
+
for the manifest. `EnvDesign` accepts `type: Secret`, refuses a `defaultValue`
|
|
18
|
+
on a secret entry and throws when a `String` entry receives a secret.
|
|
19
|
+
`AsyncActivityCallbackAuth` carries a `Secret` in `secret`, `password`, `token`
|
|
20
|
+
and `value`.
|
|
21
|
+
|
|
22
|
+
**http**: `auth` accepts `{ username, password }`, `{ bearer }` or
|
|
23
|
+
`{ header, value }` besides an `HttpAuth`, all with a `Secret`, and the
|
|
24
|
+
activity writes the header on the host. `clientSecret` and `password` of the
|
|
25
|
+
OAuth2 grants are a `Secret`.
|
|
26
|
+
|
|
27
|
+
**smtp**, **sftp**, **orm**: `connectionString` is a `Secret`. The
|
|
28
|
+
`SftpConnectionString` and `ORMConnectionString` aliases are gone.
|
|
29
|
+
|
|
30
|
+
**hmac**: the callback authorizer reads the secret through `Secret.read`.
|
|
31
|
+
|
|
32
|
+
**dev**: the codec writes a `Secret` by name and binds the env value only where
|
|
33
|
+
an activity runs, reading the input back from the database as the runtime does.
|
|
34
|
+
The SFTP and SMTP claims read the value on connect.
|
|
35
|
+
|
|
36
|
+
**webhook**: documents the `Secret` in `auth`.
|
|
37
|
+
|
|
38
|
+
- Updated dependencies [[`9449e4e`](https://github.com/tech4humans-brasil/framework/commit/9449e4e9889f42dea1d52418140f47d25dff0535), [`9449e4e`](https://github.com/tech4humans-brasil/framework/commit/9449e4e9889f42dea1d52418140f47d25dff0535)]:
|
|
39
|
+
- @t4h.framework/core@0.15.0
|
|
40
|
+
- @t4h.framework/http@0.7.0
|
|
41
|
+
|
|
42
|
+
## 0.2.1
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- [#170](https://github.com/tech4humans-brasil/framework/pull/170) [`aa72268`](https://github.com/tech4humans-brasil/framework/commit/aa72268d040a743743cac31cc14e26b8620b0e3f) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - Adds the `jwks` callback auth: a detached signature over the callback body,
|
|
47
|
+
verified with the public key the `kid` resolves to at a JWKS URL — the way Amber
|
|
48
|
+
signs its webhooks.
|
|
49
|
+
|
|
50
|
+
**core**: `AsyncActivityCallbackAuthJwks` joins `AsyncActivityCallbackAuth`
|
|
51
|
+
(`jwksUri`, `header`, `kid`/`kidHeader`, `algorithm`/`algorithmHeader`,
|
|
52
|
+
`signatureFormat`/`signatureFormatHeader`, `timestampHeader`,
|
|
53
|
+
`toleranceInSeconds`, `signedPayload` as a template over `{timestamp}` and
|
|
54
|
+
`{body}`).
|
|
55
|
+
|
|
56
|
+
**jwks**: `jwksCallback` (default of `@t4h.framework/jwks/callback`) now serves
|
|
57
|
+
both `jwt` and `jwks`. Hosts pass it as `{ jwt: jwksCallback, jwks: jwksCallback }`.
|
|
58
|
+
|
|
59
|
+
**dev**: loads `@t4h.framework/jwks` for the `jwks` type as well.
|
|
60
|
+
|
|
61
|
+
**webhook**: documents the new type.
|
|
62
|
+
|
|
63
|
+
- Updated dependencies [[`aa72268`](https://github.com/tech4humans-brasil/framework/commit/aa72268d040a743743cac31cc14e26b8620b0e3f)]:
|
|
64
|
+
- @t4h.framework/core@0.14.0
|
|
65
|
+
- @t4h.framework/http@0.6.3
|
|
66
|
+
|
|
3
67
|
## 0.2.0
|
|
4
68
|
|
|
5
69
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -32,7 +32,8 @@ arrives before `timeoutInMs` throws `WebhookTimeoutError`, so the workflow
|
|
|
32
32
|
never sees a callback that did not happen.
|
|
33
33
|
|
|
34
34
|
Supported `auth`: `hmac` (GitHub, Shopify, Slack style), `basic`, `header`,
|
|
35
|
-
`bearer` and `
|
|
35
|
+
`bearer`, `jwt` (bearer JWT verified with a JWKS) and `jwks` (detached
|
|
36
|
+
signature verified with a JWKS key).
|
|
36
37
|
|
|
37
38
|
Pass `{ wait: false }` as the second argument to send the request without
|
|
38
39
|
suspending; you get a handle and call `handle.wait()` later.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t4h.framework/webhook",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Webhook module for the T4H Framework",
|
|
5
5
|
"homepage": "https://github.com/tech4humans-brasil/framework/tree/main/packages/webhook",
|
|
6
6
|
"bugs": "https://github.com/tech4humans-brasil/framework/issues",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"typebox": "^1.1.6"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@t4h.framework/core": "^0.
|
|
38
|
-
"@t4h.framework/http": "^0.
|
|
37
|
+
"@t4h.framework/core": "^0.15.0",
|
|
38
|
+
"@t4h.framework/http": "^0.7.0",
|
|
39
39
|
"typescript": "^5.9.3",
|
|
40
40
|
"vitest": "^4.0.18"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@t4h.framework/core": "^0.
|
|
44
|
-
"@t4h.framework/http": "^0.
|
|
43
|
+
"@t4h.framework/core": "^0.15.0",
|
|
44
|
+
"@t4h.framework/http": "^0.7.0"
|
|
45
45
|
},
|
|
46
46
|
"packageManager": "yarn@4.12.0",
|
|
47
47
|
"engines": {
|