urbit/gen/hood/init-oauth1.hoon

35 lines
732 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
::
::::
!:
2016-11-17 04:37:39 +03:00
=, sole
:- %ask
2016-08-11 21:15:06 +03:00
|= $: {now/@da eny/@uvJ bec/beak}
{arg/$@($~ {dom/path $~})}
$~
==
^- (sole-result {$write-sec-atom p/host q/@})
=- ?~ arg -
(fun.q.q [%& dom.arg])
%+ sole-lo
[%& %oauth-hostname "api hostname: https://"]
%+ sole-go thos:urlp
|= hot/host
?: ?=($| -.hot)
~|(%ips-unsupported !!)
%+ sole-lo
[%& %oauth-client "consumer key: "]
%+ sole-go (boss 256 (star prn))
|= key/@t
%+ sole-lo
[%& %oauth-secret "consumer secret: "]
%+ sole-go (boss 256 (star prn))
|= sec/@t
%+ sole-so %write-sec-atom :: XX typed pair
[hot (role key sec ~)]