Software /
code /
prosody
Annotate
teal-src/util/promise.d.tl @ 12953:ebe3b2f96cad
mod_tokenauth: Switch to new token format (invalidates existing tokens!)
The new format has the following properties:
- 5 bytes longer than the previous format
- The token now has separate 'id' and 'secret' parts - the token itself is no
longer stored in the DB, and the secret part is hashed
- The only variable length field (JID) has been moved to the end
- The 'secret-token:' prefix (RFC 8959) is now included
Compatibility with the old token format was not maintained, and all previously
issued tokens are invalid after this commit (they will be removed from the DB
if used).
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 21 Mar 2023 14:33:29 +0000 |
parent | 12612:588b1d175838 |
rev | line source |
---|---|
12612
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 local record lib |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 type resolve_func = function (any) |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 type promise_body = function (resolve_func, resolve_func) |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 record Promise<A, B> |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 type on_resolved = function (A) : any |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 type on_rejected = function (B) : any |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 next : function (Promise, on_resolved, on_rejected) : Promise<any, any> |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 end |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 new : function (promise_body) : Promise |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 resolve : function (any) : Promise |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 reject : function (any) : Promise |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 all : function ({ Promise }) : Promise |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 all_settled : function ({ Promise }) : Promise |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 race : function ({ Promise }) : Promise |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 try : function |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 is_promise : function(any) : boolean |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 end |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
21 |
588b1d175838
util.promise: Add Teal interface specification file
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
22 return lib |