fork off |init-oauth1 from |init-oauth2

and discard subdomains in both
This commit is contained in:
Anton Dyudin 2016-03-09 15:53:58 -08:00
parent 738bd1946c
commit be51072ade
2 changed files with 35 additions and 0 deletions

34
gen/hood/init-oauth1.hoon Normal file
View File

@ -0,0 +1,34 @@
::
:::: /hoon/init-oauth1/hood/gen
::
/? 314
/- sole
::
::::
!:
[sole .]
:- %ask
|= $: {now/@da eny/@uvI 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 !!)
=. p.hot (scag 2 p.hot) :: ignore subdomain
%+ 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 ~)]

View File

@ -21,6 +21,7 @@
|= hot/host
?: ?=($| -.hot)
~|(%ips-unsupported !!)
=. p.hot (scag 2 p.hot) :: ignore subdomain
%+ sole-lo
[%& %oauth-client "client id: "]
%+ sole-go (boss 256 (star prn))