urbit/pkg/arvo/gen/hood/init-oauth2.hoon
Jared Tobin b3901ab42f Add 'pkg/arvo/' from commit 'c20e2a185f131ff3f5d3961829bd7a3fe0f227f8'
git-subtree-dir: pkg/arvo
git-subtree-mainline: 9c8f40bf6c
git-subtree-split: c20e2a185f
2019-06-28 12:48:05 +08:00

36 lines
767 B
Plaintext

:: API: input oauth2 application credentials for domain
::
:::: /hoon/init-oauth2/hood/gen
::
/? 314
/- sole
/+ generators
::
::::
::
=, generators
:- %ask
|= $: {now/@da eny/@uvJ bec/beak}
{arg/$@(~ {dom/path ~})}
~
==
^- (sole-result:sole {$write-sec-atom p/host:eyre q/@})
=- ?~ arg -
(fun.q.q [%& dom.arg])
%+ prompt
[%& %oauth-hostname "api hostname: https://"]
%+ parse thos:de-purl:html
|= hot/host:eyre
?: ?=(%| -.hot)
~|(%ips-unsupported !!)
%+ prompt
[%& %oauth-client "client id: "]
%+ parse (boss 256 (star prn))
|= cid/@t
%+ prompt
[%& %oauth-secret "client secret: "]
%+ parse (boss 256 (star prn))
|= cis/@t
%+ produce %write-sec-atom :: XX typed pair
[hot (of-wain:format cid cis ~)]