urbit/pkg/arvo/gen/hood/init-oauth2/google.hoon

33 lines
787 B
Plaintext
Raw Normal View History

2016-10-22 02:44:39 +03:00
:: API: input auth2 client_secret_*.json for .googleapis.com
::
2016-03-05 03:24:23 +03:00
:::: /hoon/google/init-oauth2/hood/gen
::
/? 314
/- sole
/+ generators
::
::::
2016-11-17 04:42:58 +03:00
::
=, generators
=, html
2017-10-24 00:41:07 +03:00
=, format
:- %ask
|= $: [now=@da eny=@uvJ bec=beak]
[arg=$@(~ [jon=json ~])]
2018-03-19 07:18:20 +03:00
~
==
^- (sole-result:sole [%write-sec-atom p=host:eyre q=@])
%+ print leaf+"Accepting credentials for https://*.googleapis.com"
=+ hot=[%& /com/googleapis]
=- ?~ arg -
(fun.q.q jon.arg)
%+ prompt
[%& %oauth-json "json credentials: "]
%+ parse apex:de-json
|= jon=json
=+ ~| bad-json+jon
=- `[cid=@t cis=@t]`(need (rep jon))
2017-10-24 00:26:32 +03:00
rep=(ot web+(ot 'client_id'^so 'client_secret'^so ~) ~):dejs-soft:format
%+ produce %write-sec-atom :: XX typed pair
2017-10-24 00:26:32 +03:00
[hot (of-wain:format cid cis ~)]