From be51072ade6e386ff33f353ac9193edaca08ed10 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Wed, 9 Mar 2016 15:53:58 -0800 Subject: [PATCH] fork off |init-oauth1 from |init-oauth2 and discard subdomains in both --- gen/hood/init-oauth1.hoon | 34 ++++++++++++++++++++++++++++++++++ gen/hood/init-oauth2.hoon | 1 + 2 files changed, 35 insertions(+) create mode 100644 gen/hood/init-oauth1.hoon diff --git a/gen/hood/init-oauth1.hoon b/gen/hood/init-oauth1.hoon new file mode 100644 index 000000000..2abb8d601 --- /dev/null +++ b/gen/hood/init-oauth1.hoon @@ -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 ~)] diff --git a/gen/hood/init-oauth2.hoon b/gen/hood/init-oauth2.hoon index 04e217c23..f0b8b412d 100644 --- a/gen/hood/init-oauth2.hoon +++ b/gen/hood/init-oauth2.hoon @@ -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))