added |init-oauth2 secrets dialog

This commit is contained in:
Anton Dyudin 2016-02-04 15:03:51 -08:00
parent 49f8110b2d
commit 1a61fe4378
4 changed files with 40 additions and 1 deletions

View File

@ -127,6 +127,7 @@
++ poke-kiln-overload (wrap poke-overload):from-kiln
++ poke-kiln-unmount (wrap poke-unmount):from-kiln
++ poke-kiln-unsync (wrap poke-unsync):from-kiln
++ poke-write-sec-atom (wrap poke-sec-atom):from-write
++ poke-write-paste (wrap poke-paste):from-write
++ poke-will (wrap poke-will):from-helm
++ quit-drum-phat (wrap quit-phat):from-drum

33
gen/hood/init-oauth2.hoon Normal file
View File

@ -0,0 +1,33 @@
::
:::: /hoon/init-oauth2/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 !!)
%+ sole-lo
[%& %oauth-client "client id: "]
%+ sole-go (boss 256 (star prn))
|= cid=@t
%+ sole-lo
[%& %oauth-secret "client secret: "]
%+ sole-go (boss 256 (star prn))
|= cis=@t
%+ sole-so %write-sec-atom :: XX typed pair
[hot (role cid cis ~)]

View File

@ -37,6 +37,11 @@
|= [typ=?(%hoon %md %txt) txt=@t] ^+ abet
(poke--data [`typ /web/paste/(scot %da now)] %mime / (taco txt))
::
++ poke-sec-atom
|= [hot=host dat=@]
?> ?=(%& -.hot)
(poke--data [`%atom [%sec p.hot]] %mime / (taco dat))
::
++ poke--data
|= [[ext=(unit ,@t) pax=path] dat=data] ^+ abet
?~ ext $(ext [~ -.dat])

View File

@ -17,7 +17,7 @@
=< .(state-usr &)
%- oauth2
=- [[`/com/google/accounts /o/oauth2/v2/auth -] /oauth2/v4/token]
:~ login-hint/(crip (rash lon suffix-email))
:~ login-hint/?~(lon '' (crip (rash lon suffix-email)))
access-type/%offline
response-type/%code
==