mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-01 11:33:41 +03:00
gcp: add token type
Also use it in -get-gcp-jwt.
This commit is contained in:
parent
a8113182a8
commit
d94f35aa5c
6
pkg/arvo/sur/gcp.hoon
Normal file
6
pkg/arvo/sur/gcp.hoon
Normal file
@ -0,0 +1,6 @@
|
||||
|%
|
||||
+$ token
|
||||
$: access=@t
|
||||
expiry=@da
|
||||
==
|
||||
--
|
@ -17,7 +17,7 @@
|
||||
:: with a bearer token and expiry.
|
||||
::
|
||||
::
|
||||
/- spider, settings
|
||||
/- gcp, spider, settings
|
||||
/+ jose, pkcs, primitive-rsa, strandio
|
||||
=, strand=strand:spider
|
||||
=, rsa=primitive-rsa
|
||||
@ -35,9 +35,9 @@
|
||||
'https://www.googleapis.com/auth/devstorage.read_write'
|
||||
=/ jot=@t
|
||||
(make-jwt key kid iss scope aud now.bowl)
|
||||
;< p=[access-token=@t expires-at=@da] bind:m
|
||||
;< =token:gcp bind:m
|
||||
(get-access-token jot aud now.bowl)
|
||||
(pure:m !>(p))
|
||||
(pure:m !>(token))
|
||||
::
|
||||
++ read-setting
|
||||
|= key=term
|
||||
@ -100,7 +100,7 @@
|
||||
::
|
||||
++ get-access-token
|
||||
|= [jot=@t url=@t now=@da]
|
||||
=/ m (strand ,[@t @da]) ^- form:m
|
||||
=/ m (strand ,token:gcp) ^- form:m
|
||||
;< ~ bind:m
|
||||
%: send-request:strandio
|
||||
method=%'POST'
|
||||
|
Loading…
Reference in New Issue
Block a user