urbit/gen/hood/init-oauth1.hoon

37 lines
771 B
Plaintext
Raw Normal View History

2016-10-22 02:44:39 +03:00
:: API: input oauth1 application credentials for domain
::
:::: /hoon/init-oauth1/hood/gen
::
/? 314
/- sole
/+ generators
::
::::
2016-11-17 04:42:58 +03:00
::
=, generators
=, eyre
:- %ask
2016-08-11 21:15:06 +03:00
|= $: {now/@da eny/@uvJ bec/beak}
2018-03-19 07:18:20 +03:00
{arg/$@(~ {dom/path ~})}
~
==
^- (sole-result:sole {$write-sec-atom p/host q/@})
=- ?~ arg -
(fun.q.q [%& dom.arg])
%+ prompt
[%& %oauth-hostname "api hostname: https://"]
%+ parse thos:de-purl:html
|= hot/host
2018-03-19 06:54:47 +03:00
?: ?=(%| -.hot)
~|(%ips-unsupported !!)
%+ prompt
[%& %oauth-client "consumer key: "]
%+ parse (boss 256 (star prn))
|= key/@t
%+ prompt
[%& %oauth-secret "consumer secret: "]
%+ parse (boss 256 (star prn))
|= sec/@t
%+ produce %write-sec-atom :: XX typed pair
2017-11-10 03:06:58 +03:00
[hot (of-wain:format key sec ~)]