@t4h.framework/webhook 0.2.1 → 0.2.3

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.
@@ -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,46 @@
1
1
  # @t4h.framework/webhook
2
2
 
3
+ ## 0.2.3
4
+
5
+ ## 0.2.2
6
+
7
+ ### Patch Changes
8
+
9
+ - [#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
10
+ `type: Secret` hands the workflow the name of the variable; the host binds the
11
+ value where the activity runs, so no input, output or history record holds it.
12
+
13
+ **Breaking**: every field that carries a credential now accepts only a
14
+ `Secret`. Declare the entry with `type: Secret` in your `EnvDesign` and pass it
15
+ whole; `tsc` points at each remaining string.
16
+
17
+ **core**: `Secret` (a `SerializableClass` whose `toString`, `valueOf` and
18
+ `toJSON` throw), `Secret.resolve` and `Secret.read` for hosts, `Secret.FORMAT`
19
+ for the manifest. `EnvDesign` accepts `type: Secret`, refuses a `defaultValue`
20
+ on a secret entry and throws when a `String` entry receives a secret.
21
+ `AsyncActivityCallbackAuth` carries a `Secret` in `secret`, `password`, `token`
22
+ and `value`.
23
+
24
+ **http**: `auth` accepts `{ username, password }`, `{ bearer }` or
25
+ `{ header, value }` besides an `HttpAuth`, all with a `Secret`, and the
26
+ activity writes the header on the host. `clientSecret` and `password` of the
27
+ OAuth2 grants are a `Secret`.
28
+
29
+ **smtp**, **sftp**, **orm**: `connectionString` is a `Secret`. The
30
+ `SftpConnectionString` and `ORMConnectionString` aliases are gone.
31
+
32
+ **hmac**: the callback authorizer reads the secret through `Secret.read`.
33
+
34
+ **dev**: the codec writes a `Secret` by name and binds the env value only where
35
+ an activity runs, reading the input back from the database as the runtime does.
36
+ The SFTP and SMTP claims read the value on connect.
37
+
38
+ **webhook**: documents the `Secret` in `auth`.
39
+
40
+ - Updated dependencies [[`9449e4e`](https://github.com/tech4humans-brasil/framework/commit/9449e4e9889f42dea1d52418140f47d25dff0535), [`9449e4e`](https://github.com/tech4humans-brasil/framework/commit/9449e4e9889f42dea1d52418140f47d25dff0535)]:
41
+ - @t4h.framework/core@0.15.0
42
+ - @t4h.framework/http@0.7.0
43
+
3
44
  ## 0.2.1
4
45
 
5
46
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t4h.framework/webhook",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
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.14.0",
38
- "@t4h.framework/http": "^0.6.3",
37
+ "@t4h.framework/core": "^0.16.0",
38
+ "@t4h.framework/http": "^0.7.1",
39
39
  "typescript": "^5.9.3",
40
40
  "vitest": "^4.0.18"
41
41
  },
42
42
  "peerDependencies": {
43
- "@t4h.framework/core": "^0.14.0",
44
- "@t4h.framework/http": "^0.6.3"
43
+ "@t4h.framework/core": ">=0.15.0 <1.0.0",
44
+ "@t4h.framework/http": ">=0.7.0 <1.0.0"
45
45
  },
46
46
  "packageManager": "yarn@4.12.0",
47
47
  "engines": {