diff options
author | Francois Kritzinger <francois@codesynthesis.com> | 2024-02-12 11:23:16 +0200 |
---|---|---|
committer | Francois Kritzinger <francois@codesynthesis.com> | 2024-06-05 09:12:45 +0200 |
commit | 6a7e81b3d331c84633732d6b80d82fcbeb9eed44 (patch) | |
tree | ab9f5b5dc30612bdf89c76c1e8880c0d308f19be /mod/jwt.cxx | |
parent | 3d53ca86d53c119e9b937d3a51571127f75b140c (diff) |
Post-review changes
Diffstat (limited to 'mod/jwt.cxx')
-rw-r--r-- | mod/jwt.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mod/jwt.cxx b/mod/jwt.cxx index 43b8629..962ed1e 100644 --- a/mod/jwt.cxx +++ b/mod/jwt.cxx @@ -2,7 +2,6 @@ #include <libbutl/base64.hxx> #include <libbutl/openssl.hxx> -#include <libbutl/timestamp.hxx> #include <libbutl/json/serializer.hxx> using namespace std; @@ -56,7 +55,8 @@ string brep:: gen_jwt (const options::openssl_options& o, const path& pk, const string& iss, - const std::chrono::minutes& vp) + const chrono::minutes& vp, + const chrono::seconds& bd) { // Create the header. // @@ -81,15 +81,15 @@ gen_jwt (const options::openssl_options& o, // "Issued at" time. // - seconds iat ( - duration_cast<seconds> (system_clock::now ().time_since_epoch ())); + seconds iat (duration_cast<seconds> ( + system_clock::now ().time_since_epoch () - bd)); // Expiration time. // seconds exp (iat + vp); vector<char> b; - json::buffer_serializer s (b); + json::buffer_serializer s (b, 0 /* indentation */); s.begin_object (); s.member ("iss", iss); @@ -116,7 +116,7 @@ gen_jwt (const options::openssl_options& o, // Note that RSA is indicated by the contents of the private key. // // Note that here we assume both output and diagnostics will fit into pipe - // buffers and don't both with fdselect(). + // buffers and don't poll both with fdselect(). // openssl os (path ("-"), // Read message from openssl::out. path ("-"), // Write output to openssl::in. |