Software /
code /
prosody
Comparison
plugins/mod_http_file_share.lua @ 11501:2c9db2278fed
mod_http_file_share: Group related properties for readability
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 05 Apr 2021 17:15:12 +0200 |
parent | 11500:21706a581b8a |
child | 11502:8fd760c04cdf |
comparison
equal
deleted
inserted
replaced
11500:21706a581b8a | 11501:2c9db2278fed |
---|---|
132 return true; | 132 return true; |
133 end | 133 end |
134 | 134 |
135 function get_authz(slot, uploader, filename, filesize, filetype) | 135 function get_authz(slot, uploader, filename, filesize, filetype) |
136 return jwt.sign(secret, { | 136 return jwt.sign(secret, { |
137 -- token properties | |
137 sub = uploader; | 138 sub = uploader; |
139 exp = os.time()+300; | |
140 | |
141 -- slot properties | |
142 slot = slot; | |
143 -- file properties | |
138 filename = filename; | 144 filename = filename; |
139 filesize = filesize; | 145 filesize = filesize; |
140 filetype = filetype; | 146 filetype = filetype; |
141 slot = slot; | |
142 exp = os.time()+300; | |
143 }); | 147 }); |
144 end | 148 end |
145 | 149 |
146 function get_url(slot, filename) | 150 function get_url(slot, filename) |
147 local base_url = external_base_url or module:http_url(); | 151 local base_url = external_base_url or module:http_url(); |