@t4h.framework/webhook 0.2.1 → 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.
@@ -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,44 @@
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
+
3
42
  ## 0.2.1
4
43
 
5
44
  ### 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.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.14.0",
38
- "@t4h.framework/http": "^0.6.3",
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.14.0",
44
- "@t4h.framework/http": "^0.6.3"
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": {