Changeset

11502:8fd760c04cdf

mod_http_file_share: Include time of issuance in auth token In case an external upload service wants to have the original creation time, or calculate the token expiry itself.
author Kim Alvefur <zash@zash.se>
date Mon, 05 Apr 2021 17:16:18 +0200
parents 11501:2c9db2278fed
children 11503:7adda14945ad
files plugins/mod_http_file_share.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_http_file_share.lua	Mon Apr 05 17:15:12 2021 +0200
+++ b/plugins/mod_http_file_share.lua	Mon Apr 05 17:16:18 2021 +0200
@@ -133,10 +133,12 @@
 end
 
 function get_authz(slot, uploader, filename, filesize, filetype)
+local now = os.time();
 	return jwt.sign(secret, {
 		-- token properties
 		sub = uploader;
-		exp = os.time()+300;
+		iat = now;
+		exp = now+300;
 
 		-- slot properties
 		slot = slot;