Software /
code /
prosody
Annotate
teal-src/net/http/parser.d.tl @ 12694:26a004c96ef8
util.paseto: Implementation of PASETO v4.public tokens
PASETO provides an alternative to JWT with the promise of fewer implementation
pitfalls. The v4.public algorithm allows asymmetric cryptographically-verified
token issuance and validation.
In summary, such tokens can be issued by one party and securely verified by
any other party independently using the public key of the issuer. This has a
number of potential applications in a decentralized network and ecosystem such
as XMPP. For example, such tokens could be combined with XEP-0317 to allow
hats to be verified even in the context of a third-party MUC service.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 24 Jun 2022 17:03:28 +0100 |
parent | 12609:a8eb838fc6cf |
rev | line source |
---|---|
12609
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 local record httpstream |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 feed : function(httpstream, string) |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 end |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 local type sink_cb = function () |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 local record httppacket |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 enum http_method |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 "HEAD" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 "GET" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 "POST" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 "PUT" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 "DELETE" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 "OPTIONS" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 -- etc |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 end |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 method : http_method |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 record url_details |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 path : string |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 query : string |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
21 end |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
22 url : url_details |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
23 path : string |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
24 enum http_version |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
25 "1.0" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
26 "1.1" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
27 end |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
28 httpversion : http_version |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
29 headers : { string : string } |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
30 body : string | boolean |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
31 body_sink : sink_cb |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
32 chunked : boolean |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
33 partial : boolean |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
34 end |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
35 |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
36 local enum error_conditions |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
37 "cancelled" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
38 "connection-closed" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
39 "certificate-chain-invalid" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
40 "certificate-verify-failed" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
41 "connection failed" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
42 "invalid-url" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
43 "unable to resolve service" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
44 end |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
45 |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
46 local type success_cb = function (httppacket) |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
47 local type error_cb = function (error_conditions) |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
48 |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
49 local enum stream_mode |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
50 "client" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
51 "server" |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
52 end |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
53 |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
54 local record lib |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
55 new : function (success_cb, error_cb, stream_mode) : httpstream |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
56 end |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
57 |
a8eb838fc6cf
net.http: Add teal description files
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
58 return lib |