Commit a93fcb3
authored
Allow components to support the
`http-message-sig` package is currently not compliant with the spec - in
particular, it returns `@authority` as a derived component in the
response, when in reality it should be returning `"@authority";req`.
This makes it impossible to write a compliant HTTP message directory,
for instance.
To support this, I've made several changes:
1. I've defined a new type called `ComponentParameters`, which can store
arbitrary parameters attached to components. This allows us to expose
`req`, `bs`, `sf`, etc. and even `key`. I've added it as a variant of
`Component`.
2. I've replaced the handwritten parser with `structured-headers`
library, which does the parsing for us. I've done my best to
preserve the error cases we had in the past, but I've removed cases
that assumed an unknown parameter meant invalid parsing - unknown
list parameters are fine to keep and do not imply invalid parsing.
3. I've defined a new type called `ResponseRequestPair`, which bundles
both request and response together, and written a resolver that
inspects whether or not a component needs the pair, or can make do
with just the raw message.req component parameter in Typescript (cloudflare#67)1 parent e3d7684 commit a93fcb3
16 files changed
Lines changed: 6649 additions & 4025 deletions
File tree
- examples
- httpie-web-bot-auth
- signature-agent-card-and-registry
- packages
- http-message-sig
- src
- test
- web-bot-auth/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
0 commit comments