get-gcp-jwt: returns time of expiry
Couldn't bring myself to pass in a relative date without a base, so we
instead pass now into get-access-token, and return the time of expiry.
'https://www.googleapis.com/auth/cloud-platform'
aud now.bowl
==
-;< p=[tok=@t exp=@dr] bind:m (get-access-token sot aud)
+;< p=[tok=@t exp=@da] bind:m
+ (get-access-token sot aud now.bowl)
(pure:m !>(p))
::
++ read-setting
:: https://developers.google.com/identity/protocols/oauth2/service-account
::
++ get-access-token
- |= [jot=@t url=@t]
- =/ m (strand ,[@t @dr]) ^- form:m
+ |= [jot=@t url=@t now=@da]
+ =/ m (strand ,[@t @da]) ^- form:m
;< ~ bind:m
%: send-request:strandio
method=%'POST'
==
?> =('Bearer' typ)
%- pure:m
- [tok exp]
+ [tok (add exp now)]
--
