You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.[Cavage](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures) and subsequent [RichAnna](https://datatracker.ietf.org/doc/html/draft-richanna-http-message-signatures)
14
14
15
15
## Approach
16
16
17
-
As the cavage specification is now expired and superseded by the HTTPBIS one, this library takes a
18
-
"HTTPBIS-first" approach. This means that most support and maintenance will go into the HTTPBIS
19
-
implementation and syntax. The syntax is then back-ported to the Cavage implementation as much as
20
-
possible.
17
+
As the Cavage/RichAnna specification is now expired and superseded by the HTTPbis one, this library takes a
18
+
"HTTPbis-first" approach. This means that most support and maintenance will go into the HTTPbis
19
+
implementation and syntax. The syntax is then back-ported to the as much as possible.
20
+
21
+
## Caveats
22
+
23
+
The Cavage/RichAnna specifications have changed over time, introducing new features. The aim is to support
24
+
the [latest version of the specification](https://datatracker.ietf.org/doc/html/draft-richanna-http-message-signatures)
25
+
and not to try to support each version in isolation.
26
+
27
+
## Limitations in compliance with the specification
28
+
29
+
As with many libraries and environments, HTTP Requests and Responses are abstracted away from the
30
+
developer. This fact is noted in the specification. As such (in compliance with the specification),
31
+
consumers of this library should take care to make sure that they are processing signatures that
32
+
only cover fields/components whose values can be reliably resolved. Below is a list of limitations
33
+
that you should be aware of when selecting a list of parameters to sign or accept.
34
+
35
+
### Derived component limitations
36
+
37
+
Many of the derived components are expected to be sourced from what are effectively http2 pseudo
38
+
headers. However, if the application is not running in http2 mode or the message being signed is
39
+
not being built as a http2 message, then some of these pseudo headers will not be available to the
40
+
application and must be derived from a URL.
41
+
42
+
#### @request-target
43
+
44
+
The [`@request-target`](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-message-signatures#section-2.2.5)
45
+
component is intended to be the equivalent to the "request target portion of the request line".
46
+
See the specification for examples of what this means. In NodeJS, this line in requests is automatically
47
+
constructed for consumers, so it's not possible to know for certainty what this will be. For incoming
48
+
requests, it is possible to extract, but for simplicity’s sake this library does not process the raw
49
+
headers for the incoming request and, as such, cannot calculate this value with certainty. It is
50
+
recommended that this component is avoided.
51
+
52
+
### Multiple message component contexts
53
+
54
+
As described in [section 7.4.4](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-message-signatures#section-7.4.4)
55
+
it is deemed that complex message context resolution is outside the scope of this library.
56
+
57
+
This means that it is the responsibility of the consumer of this library to construct the equivalent
58
+
message context for signatures that need to be reinterpreted based on other signer contexts.
59
+
60
+
61
+
### Padding attacks
62
+
63
+
As described in [section 7.5.7](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-message-signatures-13#section-7.5.7)
64
+
it is expected that the NodeJS application has taken steps to ensure that headers are valid and not
65
+
"garbage". For this library to take on that obligation would be to widen the scope of the library to
0 commit comments