From 253ef3153172f435279c2e0def808213a6b50efa Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Fri, 8 Feb 2019 15:03:46 -0800 Subject: [PATCH] Initial split of %light into %http-server and %http-client --- app/server.hoon | 22 +- lib/hood/helm.hoon | 7 +- lib/pill.hoon | 4 +- sys/arvo.hoon | 18 +- sys/vane/gall.hoon | 20 +- sys/vane/{light.hoon => http-server.hoon} | 128 +---- sys/vane/jael.hoon | 4 +- sys/zuse.hoon | 6 +- .../sys/vane/{light.hoon => http-server.hoon} | 532 +++++++++--------- tests/sys/vane/jael.hoon | 2 +- 10 files changed, 331 insertions(+), 412 deletions(-) rename sys/vane/{light.hoon => http-server.hoon} (94%) rename tests/sys/vane/{light.hoon => http-server.hoon} (76%) diff --git a/app/server.hoon b/app/server.hoon index 11a6fde81..644e536d7 100644 --- a/app/server.hoon +++ b/app/server.hoon @@ -7,7 +7,7 @@ +$ card $% [%connect wire [(unit @t) (list @t)] %server] [%wait wire @da] - [%http-response =raw-http-response:light] + [%http-response =http-event:http] [%diff %json json] == -- @@ -92,8 +92,8 @@ :: ++ require-authorization |* [=bone move=mold this=*] - |= handler=$-(inbound-request:light (quip move _this)) - |= =inbound-request:light + |= handler=$-(inbound-request:http-server (quip move _this)) + |= =inbound-request:http-server ^- (quip move _this) :: ?: authenticated.inbound-request @@ -103,8 +103,8 @@ ^- (list move) =/ redirect=cord %- crip - "/~/login?redirect={(trip url.http-request.inbound-request)}" - [bone [%http-response %start 307 ['location' redirect]~ ~ %.y]]~ + "/~/login?redirect={(trip url.request.inbound-request)}" + [bone [%http-response %start [307 ['location' redirect]~] ~ %.y]]~ -- |% :: @@ -128,7 +128,7 @@ :: alerts us that we were bound. we need this because the vane calls back. :: ++ bound - |= [wir=wire success=? binding=binding:light] + |= [wir=wire success=? binding=binding:http-server] ~& [%bound success] [~ this] :: @@ -160,10 +160,10 @@ :: ++ poke-handle-http-request %- (require-authorization ost.bow move this) - |= =inbound-request:light + |= =inbound-request:http-server ^- (quip move _this) :: - =+ request-line=(parse-request-line url.http-request.inbound-request) + =+ request-line=(parse-request-line url.request.inbound-request) ~& [%request-line request-line] =/ name=@t =+ back-path=(flop site.request-line) @@ -176,7 +176,7 @@ :~ ^- move :- ost.bow :* %http-response - [%start 200 ['content-type' 'application/javascript']~ [~ hello-js] %.y] + [%start [200 ['content-type' 'application/javascript']~] [~ hello-js] %.y] == == :: @@ -184,13 +184,13 @@ :~ ^- move :- ost.bow :* %http-response - [%start 200 ['content-type' 'text/html']~ [~ (hello name)] %.y] + [%start [200 ['content-type' 'text/html']~] [~ (hello name)] %.y] == == :: +poke-handle-http-cancel: received when a connection was killed :: ++ poke-handle-http-cancel - |= =inbound-request:light + |= =inbound-request:http-server ^- (quip move _this) :: the only long lived connections we keep state about are the stream ones. :: diff --git a/lib/hood/helm.hoon b/lib/hood/helm.hoon index 5190d2911..78e453cbc 100644 --- a/lib/hood/helm.hoon +++ b/lib/hood/helm.hoon @@ -40,7 +40,7 @@ {$flog wire flog:dill} :: [%mint wire our=ship p=ship q=safe:rights:jael] {$nuke wire ship} :: - [%serve wire binding:light generator:light] + [%serve wire binding:http-server generator:http-server] {$poke wire dock pear} :: == :: ++ move (pair bone card) :: user-level move @@ -149,6 +149,7 @@ =+ zus==('z' tip) =+ way=?:(zus (welp top /sys/[nam]) (welp top /sys/vane/[nam])) =+ fil=.^(@ %cx (welp way /hoon)) + ~& [%poke-reload-desk-nam way fil] [%flog /reload [%veer ?:(=('z' tip) %$ tip) way fil]] :: +poke-reset: send %vega to reboot kernel :: @@ -185,11 +186,11 @@ (emit %flog ~ %text "woot: {<[way cop]>}") :: ++ poke-serve - |= [=binding:light =generator:light] =< abet + |= [=binding:http-server =generator:http-server] =< abet (emit %serve /helm/serv binding generator) :: ++ take-bound - |= [wir=wire success=? binding=binding:light] =< abet + |= [wir=wire success=? binding=binding:http-server] =< abet (emit %flog ~ %text "bound: {}") :: ++ poke-tlon-init-stream diff --git a/lib/pill.hoon b/lib/pill.hoon index c70c29607..a798feb54 100644 --- a/lib/pill.hoon +++ b/lib/pill.hoon @@ -17,9 +17,9 @@ :: sys/vane/http-client: http client :: [%http-client /vane/http-client] - :: sys/vane/light: new web + :: sys/vane/http-server: http server :: - [%l /vane/light] + [%http-server /vane/http-server] :: sys/vane/ames: network :: [%a /vane/ames] diff --git a/sys/arvo.hoon b/sys/arvo.hoon index 258d8b94c..825011106 100644 --- a/sys/arvo.hoon +++ b/sys/arvo.hoon @@ -1,3 +1,4 @@ +!: :::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::: :::::: Postface :::::: :::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::: @@ -164,7 +165,7 @@ =+ syg=(slym rev arg) :: update the vane itself :: - :: We don't cache the +slap/+slam types because they're only used once + :: We don't cache the n+slap/+slam types because they're only used once :: right here; they'll never be used again. :: =. vase.vane @@ -243,9 +244,14 @@ ++ slur-e ~/(%slur-e |=({gat/vase hil/mill} =+(%e (slur gat hil)))) ++ slur-f ~/(%slur-f |=({gat/vase hil/mill} =+(%f (slur gat hil)))) ++ slur-g ~/(%slur-g |=({gat/vase hil/mill} =+(%g (slur gat hil)))) - ++ slur-l ~/(%slur-l |=({gat/vase hil/mill} =+(%l (slur gat hil)))) ++ slur-j ~/(%slur-j |=({gat/vase hil/mill} =+(%j (slur gat hil)))) ++ slur-z ~/(%slur-z |=({gat/vase hil/mill} =+(%z (slur gat hil)))) + ++ slur-http-server + ~/ %slur-http-server + |=({gat/vase hil/mill} =+(%http-server (slur gat hil))) + ++ slur-http-client + ~/ %slur-http-client + |=({gat/vase hil/mill} =+(%http-client (slur gat hil))) :: ++ slur-pro :: profiling slur ~/ %slur-pro @@ -258,8 +264,10 @@ $e (slur-e gat hil) $f (slur-f gat hil) $g (slur-g gat hil) - $l (slur-l gat hil) $j (slur-j gat hil) + :: + %http-client (slur-http-client gat hil) + %http-server (slur-http-server gat hil) == :: ++ song :: reduce metacard @@ -463,7 +471,8 @@ {@ $newt *} %a {@ $sync *} %c {@ $term *} %d - {@ $http *} %l + :: TODO: %http-server in the interface. + {@ $http-server *} %http-server {@ $behn *} %b == :: @@ -501,6 +510,7 @@ |- ^- {{p/(list ovum) q/(list muse)} _vanes} ?~ naf [[~ ~] ~] ?. =(lal label.i.naf) + ~| [%lal lal label.i.naf] =+ tuh=$(naf t.naf) [-.tuh [+<.tuh [i.naf +>.tuh]]] :: diff --git a/sys/vane/gall.hoon b/sys/vane/gall.hoon index 8d2e24bd9..d9a77cce3 100644 --- a/sys/vane/gall.hoon +++ b/sys/vane/gall.hoon @@ -821,7 +821,7 @@ $send (ap-move-send -.q.vax cav) $quit (ap-move-quit -.q.vax cav) :: - $connect (ap-move-connect -.q.vax cav) + :: $connect (ap-move-connect -.q.vax cav) $http-response (ap-move-http-response -.q.vax cav) == :: @@ -843,21 +843,6 @@ =^ tel vel (~(slot wa vel) 3 pec) :_(+>.$ [%& sto %give %diff `cage`[-.q.pec tel]]) :: - - ++ ap-move-connect - |= {sto/bone vax/vase} - ^- {(each cove tang) _+>} - =+ pux=((soft path) -.q.vax) - ?. &(?=(^ pux) (levy u.pux (sane %ta))) - ~& [%bad-path pux] - :_(+>.$ [%| (ap-suck "pass: malformed path")]) - =^ tel vel (~(slot wa vel) 3 vax) - :_ +>.$ - ~& [%ap-move-connect sto] - :^ %& sto %pass - :- [(scot %p q.q.pry) %inn u.pux] - [%meta %l (slop (ap-term %tas %http-server) (slop (ap-term %tas %connect) tel))] - :: ++ ap-move-http-response |= [sto=bone vax=vase] ^- [(each cove tang) _+>] @@ -1329,7 +1314,8 @@ $well `%e $wind `%j $wipe `%f - %http-server `%l + $serve `%http-server + $connect `%http-server == -- -- diff --git a/sys/vane/light.hoon b/sys/vane/http-server.hoon similarity index 94% rename from sys/vane/light.hoon rename to sys/vane/http-server.hoon index c4a4e4f7d..a1c0bf407 100644 --- a/sys/vane/light.hoon +++ b/sys/vane/http-server.hoon @@ -2,7 +2,7 @@ :: lighter than eyre :: |= pit=vase -=, light +=, http-server :: internal data structures :: => =~ @@ -19,7 +19,7 @@ :: card=(wind note gift:able) == -:: +note: private request from light to another vane +:: +note: private request from http-server to another vane :: +$ note $% :: %b: to behn @@ -74,62 +74,13 @@ :: |% ++ axle - $: :: date: date at which light's state was updated to this data structure + $: :: date: date at which http-server's state was updated to this data structure :: date=%~2019.1.7 - :: client-state: state of outbound requests - :: - client-state=state:client :: server-state: state of inbound requests :: =server-state == -:: +client: light as an http client -:: -++ client - |% - :: +state:client: state relating to open outbound HTTP connections - :: - +$ state - $: :: next-id: monotonically increasing id number for the next connection - :: - next-id=@ud - :: connection-by-id: open connections to the - :: - connection-by-id=(map @ud [=duct =in-progress-http-request]) - :: outbound-duct: the duct to send outbound requests on - :: - outbound-duct=duct - == - :: +in-progress-http-request: state around an outbound http - :: - +$ in-progress-http-request - $: :: remaining-redirects: http limit of number of redirects before error - :: - remaining-redirects=@ud - :: remaining-retries: number of times to retry the request - :: - remaining-retries=@ud - :: response-headers: the response headers from the %start packet - :: - :: We send the response headers with each %http-progress, so we must - :: save them. - :: - response-headers=(unit response-header:http) - :: chunks: a list of partial results returned from unix - :: - :: This list of octs must be flopped before it is composed as the - :: final response, as we want to be able to quickly insert. - :: - chunks=(list octs) - :: bytes-read: the sum of the size of the :chunks - :: - bytes-read=@ud - :: expected-size: the expected content-length of the http request - :: - expected-size=(unit @ud) - == - -- :: +server-state: state relating to open inbound HTTP connections :: +$ server-state @@ -1337,7 +1288,7 @@ ^- (list move) :_ moves :+ p.state.channel %give - ^- gift:able:light + ^- gift:able:http-server :* %response %continue :: ^= data @@ -1418,7 +1369,7 @@ == :: +handle-response: check a response for correctness and send to earth :: - :: All outbound responses including %light generated responses need to go + :: All outbound responses including %http-server generated responses need to go :: through this interface because we want to have one centralized place :: where we perform logging and state cleanup for connections that we're :: done with. @@ -1621,11 +1572,11 @@ |= [our=ship now=@da eny=@uvJ scry-gate=sley] :: allow jets to be registered within this core :: -~% %light ..is ~ +~% %http-server ..is ~ |% ++ call |= [=duct type=* wrapped-task=(hobo task:able)] - ^- [(list move) _light-gate] + ^- [(list move) _http-server-gate] :: =/ task=task:able ?. ?=(%soft -.wrapped-task) @@ -1641,16 +1592,11 @@ :~ [[~ /~/login] duct [%authentication ~]] [[~ /~/channel] duct [%channel ~]] == - [~ light-gate] + [~ http-server-gate] :: %born: new unix process ?: ?=(%born -.task) :: ~& [%todo-handle-born p.task] - :: TODO: reset the next-id for client state here. - :: - :: send requests on the duct passed in with born. - :: - =. outbound-duct.client-state.ax duct :: close previously open connections :: :: When we have a new unix process, every outstanding open connection is @@ -1672,7 +1618,7 @@ :: $(closed-connections (weld moves closed-connections), connections t.connections) :: - :_ light-gate + :_ http-server-gate ;: weld :: hand back default configuration for now :: @@ -1692,60 +1638,36 @@ :: ~& [%todo-live task] :: - [~ light-gate] + [~ http-server-gate] :: %request =^ moves server-state.ax (request:server +.task) - [moves light-gate] + [moves http-server-gate] :: %cancel-request =^ moves server-state.ax cancel-request:server - [moves light-gate] + [moves http-server-gate] :: %connect =^ moves server-state.ax %+ add-binding:server binding.task [%app app.task] - [moves light-gate] + [moves http-server-gate] :: %serve =^ moves server-state.ax %+ add-binding:server binding.task [%gen generator.task] - [moves light-gate] + [moves http-server-gate] :: %disconnect =. server-state.ax (remove-binding:server binding.task) - [~ light-gate] + [~ http-server-gate] == - :: :: - :: :: - :: :: - :: %http-client - :: :: TODO: Move me. - :: :: - :: =/ event-args [[our eny duct now scry-gate] client-state.ax] - :: [~ light-gate] - :: =/ client (per-client-event event-args) - :: ?- -.client-task.task - :: :: - :: %request - :: =^ moves client-state.ax (request:client +.client-task.task) - :: [moves light-gate] - :: :: - :: %cancel-request - :: ~& %todo-cancel-request - :: [~ light-gate] - :: :: - :: %receive - :: =^ moves client-state.ax (receive:client +.client-task.task) - :: [moves light-gate] - :: == - ::== :: ++ take |= [=wire =duct wrapped-sign=(hypo sign)] - ^- [(list move) _light-gate] + ^- [(list move) _http-server-gate] :: unwrap :sign, ignoring unneeded +type in :p.wrapped-sign :: =/ =sign q.wrapped-sign @@ -1753,7 +1675,7 @@ :: ?> ?=([@ *] wire) :: - |^ ^- [(list move) _light-gate] + |^ ^- [(list move) _http-server-gate] :: ?+ i.wire ~|([%bad-take-wire wire] !!) @@ -1769,12 +1691,12 @@ :: entirely normal to get things other than http-response calls, but we :: don't care. :: - [~ light-gate] + [~ http-server-gate] :: =/ event-args [[our eny duct now scry-gate] server-state.ax] =/ handle-response handle-response:(per-server-event event-args) =^ moves server-state.ax (handle-response http-event.p.sign) - [moves light-gate] + [moves http-server-gate] :: ++ run-build :: @@ -1783,7 +1705,7 @@ =/ event-args [[our eny duct now scry-gate] server-state.ax] =/ handle-ford-response handle-ford-response:(per-server-event event-args) =^ moves server-state.ax (handle-ford-response result.sign) - [moves light-gate] + [moves http-server-gate] :: ++ channel :: @@ -1800,10 +1722,10 @@ on-channel-timeout:by-channel:(per-server-event event-args) =^ moves server-state.ax (on-channel-timeout i.t.t.wire) - [moves light-gate] - :: + [moves http-server-gate] :: %wake - :: [~ move + :: + :: TODO: wake me up inside :: ?(%poke %subscription) ?> ?=([%g %unto *] sign) @@ -1813,11 +1735,11 @@ :: ~& [%gall-response sign] =^ moves server-state.ax (on-gall-response i.t.t.wire `@ud`(slav %ud i.t.t.t.wire) p.sign) - [moves light-gate] + [moves http-server-gate] == -- :: -++ light-gate ..$ +++ http-server-gate ..$ :: +load: migrate old state to new state (called on vane reload) :: ++ load diff --git a/sys/vane/jael.hoon b/sys/vane/jael.hoon index 98edfd9d0..0c91cd1e2 100644 --- a/sys/vane/jael.hoon +++ b/sys/vane/jael.hoon @@ -728,7 +728,7 @@ ^- (list move) :~ [hen %pass /(scot %p our)/init %b %wait +(now)] [hen %give %init our] - [hen %slip %l %init our] + [hen %slip %http-server %init our] [hen %slip %d %init our] [hen %slip %g %init our] [hen %slip %c %init our] @@ -777,7 +777,7 @@ %+ weld moz ^- (list move) :~ [hen %give %init our] - [hen %slip %l %init our] + [hen %slip %http-server %init our] [hen %slip %d %init our] [hen %slip %g %init our] [hen %slip %c %init our] diff --git a/sys/zuse.hoon b/sys/zuse.hoon index ceb7dd491..e665e5f78 100644 --- a/sys/zuse.hoon +++ b/sys/zuse.hoon @@ -2173,7 +2173,7 @@ :: :::: :: -++ light ^? +++ http-server ^? |% ++ able |% @@ -7383,7 +7383,7 @@ {$f task:able:ford} {$g task:able:gall} {$j task:able:jael} - {$l task:able:light} + [%http-server task:able:http-server] {@tas $meta vase} == ++ sign-arvo :: in result $<- @@ -7395,7 +7395,7 @@ {$f gift:able:ford} {$g gift:able:gall} {$j gift:able:jael} - {%l gift:able:light} + [%http-server gift:able:http-server] == :: ++ unix-task :: input from unix diff --git a/tests/sys/vane/light.hoon b/tests/sys/vane/http-server.hoon similarity index 76% rename from tests/sys/vane/light.hoon rename to tests/sys/vane/http-server.hoon index 5eb828465..95528c05d 100644 --- a/tests/sys/vane/light.hoon +++ b/tests/sys/vane/http-server.hoon @@ -1,17 +1,17 @@ /+ *test, *test-ford :: -/= light-raw /: /===/sys/vane/light /!noun/ +/= http-server-raw /: /===/sys/vane/http-server /!noun/ :: !: :: =/ test-pit=vase !>(..zuse) -=/ light-gate (light-raw test-pit) +=/ http-server-gate (http-server-raw test-pit) :: |% ++ test-init - =^ results1 light-gate - %- light-call :* - light-gate + =^ results1 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.1 scry=*sley call-args=[duct=~[/init] ~ [%init ~nul]] @@ -22,9 +22,9 @@ :: ++ test-duplicate-bindings :: - =^ results1 light-gate - %- light-call :* - light-gate + =^ results1 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.1 scry=*sley call-args=[duct=~[/init] ~ [%init ~nul]] @@ -32,9 +32,9 @@ == :: app1 binds successfully :: - =^ results2 light-gate - %- light-call :* - light-gate + =^ results2 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.2 scry=*sley call-args=[duct=~[/app1] ~ [%connect [~ /] %app1]] @@ -42,9 +42,9 @@ == :: app2 tries to bind to the same path and fails :: - =^ results3 light-gate - %- light-call :* - light-gate + =^ results3 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.3 scry=*sley call-args=[duct=~[/app2] ~ [%connect [~ /] %app2]] @@ -59,9 +59,9 @@ :: ++ test-remove-binding :: - =^ results1 light-gate - %- light-call :* - light-gate + =^ results1 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.1 scry=*sley call-args=[duct=~[/init] ~ [%init ~nul]] @@ -69,9 +69,9 @@ == :: app1 binds successfully :: - =^ results2 light-gate - %- light-call :* - light-gate + =^ results2 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.2 scry=*sley call-args=[duct=~[/app1] ~ [%connect [~ /] %app1]] @@ -79,9 +79,9 @@ == :: app1 unbinds :: - =^ results3 light-gate - %- light-call :* - light-gate + =^ results3 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.3 scry=*sley call-args=[duct=~[/app1] ~ [%disconnect [~ /]]] @@ -89,9 +89,9 @@ == :: app2 binds successfully :: - =^ results4 light-gate - %- light-call :* - light-gate + =^ results4 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.4 scry=*sley call-args=[duct=~[/app2] ~ [%connect [~ /] %app2]] @@ -107,9 +107,9 @@ :: ++ test-cant-remove-other-ducts-binding :: - =^ results1 light-gate - %- light-call :* - light-gate + =^ results1 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.1 scry=*sley call-args=[duct=~[/init] ~ [%init ~nul]] @@ -117,9 +117,9 @@ == :: app1 binds successfully :: - =^ results2 light-gate - %- light-call :* - light-gate + =^ results2 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.2 scry=*sley call-args=[duct=~[/app1] ~ [%connect [~ /] %app1]] @@ -127,9 +127,9 @@ == :: app2 tries to steal the binding by disconnecting the path :: - =^ results3 light-gate - %- light-call :* - light-gate + =^ results3 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.3 scry=*sley call-args=[duct=~[/app2] ~ [%disconnect [~ /]]] @@ -137,9 +137,9 @@ == :: app2 doesn't bind successfully because it couldn't remove app1's binding :: - =^ results4 light-gate - %- light-call :* - light-gate + =^ results4 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.4 scry=*sley call-args=[duct=~[/app2] ~ [%connect [~ /] %app2]] @@ -156,9 +156,9 @@ :: ++ test-builtin-four-oh-four :: - =^ results1 light-gate - %- light-call :* - light-gate + =^ results1 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.1 scry=*sley call-args=[duct=~[/init] ~ [%init ~nul]] @@ -166,9 +166,9 @@ == :: when there's no configuration and nothing matches, expect 404 :: - =^ results2 light-gate - %- light-call :* - light-gate + =^ results2 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.1 scry=*sley ^= call-args @@ -179,7 +179,7 @@ [%'GET' '/' ~ ~] == ^= expectec-moves - ^- (list move:light-gate) + ^- (list move:http-server-gate) :~ :* duct=~[/http-blah] %give %response @@ -188,7 +188,7 @@ :~ ['content-type' 'text/html'] ['content-length' '153'] == - [~ (file-not-found-page:light-gate '/')] + [~ (file-not-found-page:http-server-gate '/')] complete=%.y == == == @@ -200,9 +200,9 @@ :: ++ test-basic-app-request :: - =^ results1 light-gate - %- light-call :* - light-gate + =^ results1 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.1 scry=*sley call-args=[duct=~[/init] ~ [%init ~nul]] @@ -210,9 +210,9 @@ == :: app1 binds successfully :: - =^ results2 light-gate - %- light-call :* - light-gate + =^ results2 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.2 scry=*sley call-args=[duct=~[/app1] ~ [%connect [~ /] %app1]] @@ -220,9 +220,9 @@ == :: outside requests a path that app1 has bound to :: - =^ results3 light-gate - %- light-call-with-comparator :* - light-gate + =^ results3 http-server-gate + %- http-server-call-with-comparator :* + http-server-gate now=~1111.1.3 scry=*sley ^= call-args @@ -233,16 +233,16 @@ [%'GET' '/' ~ ~] == ^= comparator - |= moves=(list move:light-gate) + |= moves=(list move:http-server-gate) ^- tang :: ?. ?=([* ~] moves) [%leaf "wrong number of moves: {<(lent moves)>}"]~ :: :: - =/ move=move:light-gate i.moves + =/ move=move:http-server-gate i.moves =/ =duct duct.move - =/ card=(wind note:light-gate gift:able:light-gate) card.move + =/ card=(wind note:http-server-gate gift:able:http-server-gate) card.move :: %+ weld (expect-eq !>(~[/http-blah]) !>(duct)) @@ -257,14 +257,14 @@ == :: theoretical outside response :: - =^ results4 light-gate - %- light-take :* - light-gate + =^ results4 http-server-gate + %- http-server-take :* + http-server-gate now=~1111.1.4 scry=*sley ^= take-args :* wire=/run-app/app1 duct=~[/http-blah] - ^- (hypo sign:light-gate) + ^- (hypo sign:http-server-gate) :- *type :* %g %unto %http-response %start @@ -287,9 +287,9 @@ :: ++ test-multipart-app-request :: - =^ results1 light-gate - %- light-call :* - light-gate + =^ results1 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.1 scry=*sley call-args=[duct=~[/init] ~ [%init ~nul]] @@ -297,9 +297,9 @@ == :: app1 binds successfully :: - =^ results2 light-gate - %- light-call :* - light-gate + =^ results2 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.2 scry=*sley call-args=[duct=~[/app1] ~ [%connect [~ /] %app1]] @@ -307,9 +307,9 @@ == :: outside requests a path that app1 has bound to :: - =^ results3 light-gate - %- light-call-with-comparator :* - light-gate + =^ results3 http-server-gate + %- http-server-call-with-comparator :* + http-server-gate now=~1111.1.3 scry=*sley ^= call-args @@ -320,16 +320,16 @@ [%'GET' '/' ~ ~] == ^= comparator - |= moves=(list move:light-gate) + |= moves=(list move:http-server-gate) ^- tang :: ?. ?=([* ~] moves) [%leaf "wrong number of moves: {<(lent moves)>}"]~ :: :: - =/ move=move:light-gate i.moves + =/ move=move:http-server-gate i.moves =/ =duct duct.move - =/ card=(wind note:light-gate gift:able:light-gate) card.move + =/ card=(wind note:http-server-gate gift:able:http-server-gate) card.move :: %+ weld (expect-eq !>(~[/http-blah]) !>(duct)) @@ -344,14 +344,14 @@ == :: theoretical outside response :: - =^ results4 light-gate - %- light-take :* - light-gate + =^ results4 http-server-gate + %- http-server-take :* + http-server-gate now=~1111.1.4 scry=*sley ^= take-args :* wire=/run-app/app1 duct=~[/http-blah] - ^- (hypo sign:light-gate) :- *type + ^- (hypo sign:http-server-gate) :- *type :* %g %unto %http-response %start [200 ['content-type' 'text/html']~] @@ -365,14 +365,14 @@ == == == :: theoretical outside response :: - =^ results5 light-gate - %- light-take :* - light-gate + =^ results5 http-server-gate + %- http-server-take :* + http-server-gate now=~1111.1.4 scry=*sley ^= take-args :* wire=/run-app/app1 duct=~[/http-blah] - ^- (hypo sign:light-gate) :- *type + ^- (hypo sign:http-server-gate) :- *type :* %g %unto %http-response [%continue [~ (as-octs:mimes:html 'ya!')] %.y] == @@ -394,9 +394,9 @@ :: ++ test-login-handler-full-path :: - =^ results1 light-gate - %- light-call :* - light-gate + =^ results1 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.1 scry=*sley call-args=[duct=~[/init] ~ [%init ~nul]] @@ -404,9 +404,9 @@ == :: app1 binds successfully :: - =^ results2 light-gate - %- light-call :* - light-gate + =^ results2 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.2 scry=*sley call-args=[duct=~[/app1] ~ [%connect [~ /'~landscape'] %app1]] @@ -414,9 +414,9 @@ == :: outside requests a path that app1 has bound to :: - =^ results3 light-gate - %- light-call-with-comparator :* - light-gate + =^ results3 http-server-gate + %- http-server-call-with-comparator :* + http-server-gate now=~1111.1.3 scry=*sley ^= call-args @@ -427,16 +427,16 @@ [%'GET' '/~landscape/inner-path' ~ ~] == ^= comparator - |= moves=(list move:light-gate) + |= moves=(list move:http-server-gate) ^- tang :: ?. ?=([* ~] moves) [%leaf "wrong number of moves: {<(lent moves)>}"]~ :: :: - =/ move=move:light-gate i.moves + =/ move=move:http-server-gate i.moves =/ =duct duct.move - =/ card=(wind note:light-gate gift:able:light-gate) card.move + =/ card=(wind note:http-server-gate gift:able:http-server-gate) card.move :: %+ weld (expect-eq !>(~[/http-blah]) !>(duct)) @@ -451,14 +451,14 @@ == :: app then gives a redirect to Eyre :: - =^ results4 light-gate - %- light-take :* - light-gate + =^ results4 http-server-gate + %- http-server-take :* + http-server-gate now=~1111.1.4 scry=*sley ^= take-args :* wire=/run-app/app1 duct=~[/http-blah] - ^- (hypo sign:light-gate) :- *type + ^- (hypo sign:http-server-gate) :- *type :* %g %unto %http-response [%start [307 ['location' '/~/login?redirect=/~landscape/inner-path']~] ~ %.y] == @@ -469,21 +469,21 @@ == == == :: the browser then fetches the login page :: - =^ results5 light-gate + =^ results5 http-server-gate %- perform-authentication :* - light-gate + http-server-gate now=~1111.1.5 scry=*sley == :: going back to the original url will acknowledge the authentication cookie :: - =^ results6 light-gate - %- light-call-with-comparator :* - light-gate + =^ results6 http-server-gate + %- http-server-call-with-comparator :* + http-server-gate now=~1111.1.5..1.0.0 scry=*sley ^= call-args - ^- [=duct type=* wrapped-task=(hobo task:able:light-gate)] + ^- [=duct type=* wrapped-task=(hobo task:able:http-server-gate)] :* duct=~[/http-blah] ~ %request %.n @@ -494,16 +494,16 @@ ~ == ^= comparator - |= moves=(list move:light-gate) + |= moves=(list move:http-server-gate) ^- tang :: ?. ?=([* ~] moves) [%leaf "wrong number of moves: {<(lent moves)>}"]~ :: :: - =/ move=move:light-gate i.moves + =/ move=move:http-server-gate i.moves =/ =duct duct.move - =/ card=(wind note:light-gate gift:able:light-gate) card.move + =/ card=(wind note:http-server-gate gift:able:http-server-gate) card.move :: %+ weld (expect-eq !>(~[/http-blah]) !>(duct)) @@ -537,9 +537,9 @@ :: ++ test-generator :: - =^ results1 light-gate - %- light-call :* - light-gate + =^ results1 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.1 scry=*sley call-args=[duct=~[/init] ~ [%init ~nul]] @@ -547,9 +547,9 @@ == :: gen1 binds successfully :: - =^ results2 light-gate - %- light-call :* - light-gate + =^ results2 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.2 scry=*sley call-args=[duct=~[/gen1] ~ [%serve [~ /] [%home /gen/handler/hoon ~]]] @@ -557,9 +557,9 @@ == :: outside requests a path that app1 has bound to :: - =^ results3 light-gate - %- light-call-with-comparator :* - light-gate + =^ results3 http-server-gate + %- http-server-call-with-comparator :* + http-server-gate now=~1111.1.3 scry=*sley ^= call-args @@ -570,16 +570,16 @@ [%'GET' '/' ~ ~] == ^= comparator - |= moves=(list move:light-gate) + |= moves=(list move:http-server-gate) ^- tang :: ?. ?=([* ~] moves) [%leaf "wrong number of moves: {<(lent moves)>}"]~ :: :: - =/ move=move:light-gate i.moves + =/ move=move:http-server-gate i.moves =/ =duct duct.move - =/ card=(wind note:light-gate gift:able:light-gate) card.move + =/ card=(wind note:http-server-gate gift:able:http-server-gate) card.move :: ?. ?=(%pass -.card) [%leaf "not a %pass"]~ @@ -603,14 +603,14 @@ == :: ford response (time assumes nothing blocked) :: - =^ results4 light-gate - %- light-take :* - light-gate + =^ results4 http-server-gate + %- http-server-take :* + http-server-gate now=~1111.1.3 scry=*sley ^= take-args :* wire=/run-build duct=~[/http-blah] - ^- (hypo sign:light-gate) + ^- (hypo sign:http-server-gate) :- *type :^ %f %made ~1111.1.3 ^- made-result:ford @@ -641,23 +641,23 @@ ;: weld %+ expect-eq !> `[[%site 'localhost'] [~ 8.000]] - !> (rush 'localhost:8000' simplified-url-parser:light-gate) + !> (rush 'localhost:8000' simplified-url-parser:http-server-gate) :: %+ expect-eq !> `[[%ip .192.168.1.1] ~] - !> (rush '192.168.1.1' simplified-url-parser:light-gate) + !> (rush '192.168.1.1' simplified-url-parser:http-server-gate) == :: ++ test-parse-channel-request ;: weld %+ expect-eq !> `[%ack 5]~ - !> %- parse-channel-request:light-gate + !> %- parse-channel-request:http-server-gate (need (de-json:html '[{"action": "ack", "event-id": 5}]')) :: %+ expect-eq !> `[%poke 0 ~nec %app1 %app-type [%n '5']]~ - !> %- parse-channel-request:light-gate + !> %- parse-channel-request:http-server-gate %- need %- de-json:html ''' [{"action": "poke", @@ -670,7 +670,7 @@ :: %+ expect-eq !> `[%subscribe 1 ~sampyl-sipnym %hall /this/path]~ - !> %- parse-channel-request:light-gate + !> %- parse-channel-request:http-server-gate %- need %- de-json:html ''' [{"action": "subscribe", @@ -682,7 +682,7 @@ :: %+ expect-eq !> `[%unsubscribe 2 ~marlyt %thing /other]~ - !> %- parse-channel-request:light-gate + !> %- parse-channel-request:http-server-gate %- need %- de-json:html ''' [{"action": "unsubscribe", @@ -694,19 +694,19 @@ :: %+ expect-eq !> ~ - !> %- parse-channel-request:light-gate + !> %- parse-channel-request:http-server-gate %- need %- de-json:html '[{"noaction": "noaction"}]' :: %+ expect-eq !> ~ - !> %- parse-channel-request:light-gate + !> %- parse-channel-request:http-server-gate %- need %- de-json:html '[{"action": "bad-action"}]' :: %+ expect-eq !> ~ - !> %- parse-channel-request:light-gate + !> %- parse-channel-request:http-server-gate %- need %- de-json:html '[{"action": "ack", "event-id": 5}, {"action": "bad-action"}]' :: @@ -715,7 +715,7 @@ :~ [%ack 9] [%poke 3 ~bud %wut %wut-type [%a [%n '2'] [%n '1'] ~]] == - !> %- parse-channel-request:light-gate + !> %- parse-channel-request:http-server-gate %- need %- de-json:html ''' [{"action": "ack", "event-id": 9}, @@ -730,18 +730,18 @@ :: ++ test-channel-reject-unauthenticated :: - =^ results1 light-gate - %- light-call :* - light-gate + =^ results1 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.1 scry=*sley call-args=[duct=~[/init] ~ [%init ~nul]] expected-moves=~ == :: - =^ results2 light-gate - %- light-call :* - light-gate + =^ results2 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.2 scry=*sley ^= call-args @@ -752,7 +752,7 @@ [%'PUT' '/~/channel/1234567890abcdef' ~ ~] == ^= expected-moves - ^- (list move:light-gate) + ^- (list move:http-server-gate) :~ :* duct=~[/http-blah] %give %response @@ -763,7 +763,7 @@ == :: :- ~ - %^ internal-server-error:light-gate %.n + %^ internal-server-error:http-server-gate %.n '/~/channel/1234567890abcdef' ~ :: complete=%.y @@ -776,22 +776,22 @@ == :: ++ test-channel-open-never-used-expire - =^ results1 light-gate (perform-init-start-channel light-gate *sley) + =^ results1 http-server-gate (perform-init-start-channel http-server-gate *sley) :: the behn timer wakes us up; we cancel our subscription :: - =^ results2 light-gate - %- light-take-with-comparator :* - light-gate + =^ results2 http-server-gate + %- http-server-take-with-comparator :* + http-server-gate now=(add ~1111.1.2 ~h12) scry=*sley ^= take-args :* wire=/channel/timeout/'0123456789abcdef' duct=~[/http-blah] - ^- (hypo sign:light-gate) + ^- (hypo sign:http-server-gate) :- *type [%b %wake ~] == ^= comparator - |= moves=(list move:light-gate) + |= moves=(list move:http-server-gate) ^- tang :: ?. ?=([^ ~] moves) @@ -812,17 +812,17 @@ ++ test-channel-results-before-open :: common initialization :: - =^ results1 light-gate (perform-init-start-channel light-gate *sley) + =^ results1 http-server-gate (perform-init-start-channel http-server-gate *sley) :: poke gets a success message :: - =^ results2 light-gate - %- light-take :* - light-gate + =^ results2 http-server-gate + %- http-server-take :* + http-server-gate now=(add ~1111.1.2 ~m1) scry=*sley ^= take-args :* wire=/channel/poke/'0123456789abcdef'/'0' duct=~[/http-put-request] - ^- (hypo sign:light-gate) + ^- (hypo sign:http-server-gate) :- *type [%g %unto %coup ~] == @@ -830,14 +830,14 @@ == :: subscription gets a success message :: - =^ results3 light-gate - %- light-take :* - light-gate + =^ results3 http-server-gate + %- http-server-take :* + http-server-gate now=(add ~1111.1.2 ~m1) scry=*sley ^= take-args :* wire=/channel/subscription/'0123456789abcdef'/'1' duct=~[/http-put-request] - ^- (hypo sign:light-gate) + ^- (hypo sign:http-server-gate) :- *type [%g %unto %reap ~] == @@ -845,14 +845,14 @@ == :: subscription gets a result :: - =^ results4 light-gate - %- light-take :* - light-gate + =^ results4 http-server-gate + %- http-server-take :* + http-server-gate now=(add ~1111.1.2 ~m2) scry=*sley ^= take-args :* wire=/channel/subscription/'0123456789abcdef'/'1' duct=~[/http-put-request] - ^- (hypo sign:light-gate) + ^- (hypo sign:http-server-gate) :- *type [%g %unto %diff %json !>(`json`[%a [%n '1'] [%n '2'] ~])] == @@ -862,9 +862,9 @@ :: :: send the channel a poke and a subscription request :: - =^ results5 light-gate - %- light-call :* - light-gate + =^ results5 http-server-gate + %- http-server-call :* + http-server-gate now=(add ~1111.1.2 ~m3) scry=*sley ^= call-args @@ -878,7 +878,7 @@ ~ == ^= expected-moves - ^- (list move:light-gate) + ^- (list move:http-server-gate) :~ :* duct=~[/http-get-open] %give %response @@ -914,14 +914,14 @@ == == == :: we get a cancel when we notice the client has disconnected :: - =^ results6 light-gate - %- light-call :* - light-gate + =^ results6 http-server-gate + %- http-server-call :* + http-server-gate now=(add ~1111.1.2 ~m4) scry=*sley call-args=[duct=~[/http-get-open] ~ %cancel-request ~] ^= expected-moves - ^- (list move:light-gate) + ^- (list move:http-server-gate) :: closing the channel restarts the timeout timer :: :~ :* duct=~[/http-get-open] %pass @@ -943,16 +943,16 @@ ++ test-channel-second-get-updates-timer :: common initialization :: - =^ results1 light-gate (perform-init-start-channel light-gate *sley) + =^ results1 http-server-gate (perform-init-start-channel http-server-gate *sley) :: perform another poke to a different app :: :: Since we haven't connected with a GET, the old timer should be canceled :: and a new one should be set. :: send the channel a poke and a subscription request :: - =^ results2 light-gate - %- light-call-with-comparator :* - light-gate + =^ results2 http-server-gate + %- http-server-call-with-comparator :* + http-server-gate now=(add ~1111.1.2 ~m1) scry=*sley ^= call-args @@ -976,7 +976,7 @@ ''' == ^= comparator - |= moves=(list move:light-gate) + |= moves=(list move:http-server-gate) ^- tang :: ?. ?=([^ ^ ^ ^ ~] moves) @@ -1022,24 +1022,24 @@ =. q (~(put to q) [3 ~]) =. q (~(put to q) [4 ~]) :: - =. q (prune-events:light-gate q 3) + =. q (prune-events:http-server-gate q 3) :: (expect-eq !>([~ [4 ~]]) !>(~(top to q))) :: ++ test-channel-sends-unacknowledged-events-on-reconnection :: common initialization :: - =^ results1 light-gate (perform-init-start-channel light-gate *sley) + =^ results1 http-server-gate (perform-init-start-channel http-server-gate *sley) :: poke gets a success message :: - =^ results2 light-gate - %- light-take :* - light-gate + =^ results2 http-server-gate + %- http-server-take :* + http-server-gate now=(add ~1111.1.2 ~m1) scry=*sley ^= take-args :* wire=/channel/poke/'0123456789abcdef'/'0' duct=~[/http-put-request] - ^- (hypo sign:light-gate) + ^- (hypo sign:http-server-gate) :- *type [%g %unto %coup ~] == @@ -1047,14 +1047,14 @@ == :: subscription gets a success message :: - =^ results3 light-gate - %- light-take :* - light-gate + =^ results3 http-server-gate + %- http-server-take :* + http-server-gate now=(add ~1111.1.2 ~m2) scry=*sley ^= take-args :* wire=/channel/subscription/'0123456789abcdef'/'1' duct=~[/http-put-request] - ^- (hypo sign:light-gate) + ^- (hypo sign:http-server-gate) :- *type [%g %unto %reap ~] == @@ -1062,9 +1062,9 @@ == :: opens the http channel :: - =^ results4 light-gate - %- light-call :* - light-gate + =^ results4 http-server-gate + %- http-server-call :* + http-server-gate now=(add ~1111.1.2 ~m3) scry=*sley ^= call-args @@ -1078,7 +1078,7 @@ ~ == ^= expected-moves - ^- (list move:light-gate) + ^- (list move:http-server-gate) :~ :* duct=~[/http-get-open] %give %response @@ -1111,19 +1111,19 @@ == == == :: first subscription result gets sent to the user :: - =^ results5 light-gate - %- light-take :* - light-gate + =^ results5 http-server-gate + %- http-server-take :* + http-server-gate now=(add ~1111.1.2 ~m4) scry=*sley ^= take-args :* wire=/channel/subscription/'0123456789abcdef'/'1' duct=~[/http-put-request] - ^- (hypo sign:light-gate) + ^- (hypo sign:http-server-gate) :- *type [%g %unto %diff %json !>(`json`[%a [%n '1'] ~])] == ^= moves - ^- (list move:light-gate) + ^- (list move:http-server-gate) :~ :* duct=~[/http-get-open] %give %response @@ -1142,9 +1142,9 @@ :: :: send the channel a poke and a subscription request :: - =^ results6 light-gate - %- light-call-with-comparator :* - light-gate + =^ results6 http-server-gate + %- http-server-call-with-comparator :* + http-server-gate now=(add ~1111.1.2 ~m5) scry=*sley ^= call-args @@ -1165,7 +1165,7 @@ ''' == ^= comparator - |= moves=(list move:light-gate) + |= moves=(list move:http-server-gate) ^- tang :: ?. ?=([^ ~] moves) @@ -1177,14 +1177,14 @@ == :: the client connection is detected to be broken :: - =^ results7 light-gate - %- light-call :* - light-gate + =^ results7 http-server-gate + %- http-server-call :* + http-server-gate now=(add ~1111.1.2 ~m6) scry=*sley call-args=[duct=~[/http-get-open] ~ %cancel-request ~] ^= expected-moves - ^- (list move:light-gate) + ^- (list move:http-server-gate) :: closing the channel restarts the timeout timer :: :~ :* duct=~[/http-get-open] %pass @@ -1194,14 +1194,14 @@ == :: another subscription result while the user is disconnected :: - =^ results8 light-gate - %- light-take :* - light-gate + =^ results8 http-server-gate + %- http-server-take :* + http-server-gate now=(add ~1111.1.2 ~m7) scry=*sley ^= take-args :* wire=/channel/subscription/'0123456789abcdef'/'1' duct=~[/http-put-request] - ^- (hypo sign:light-gate) + ^- (hypo sign:http-server-gate) :- *type [%g %unto %diff %json !>(`json`[%a [%n '2'] ~])] == @@ -1212,9 +1212,9 @@ :: Because the client has acknowledged up to event 1, we should start the connection by :: resending events 2 and 3. :: - =^ results9 light-gate - %- light-call :* - light-gate + =^ results9 http-server-gate + %- http-server-call :* + http-server-gate now=(add ~1111.1.2 ~m8) scry=*sley ^= call-args @@ -1228,7 +1228,7 @@ ~ == ^= expected-moves - ^- (list move:light-gate) + ^- (list move:http-server-gate) :~ :* duct=~[/http-get-open] %give %response @@ -1274,83 +1274,83 @@ results9 == :: -++ light-call - |= $: light-gate=_light-gate +++ http-server-call + |= $: http-server-gate=_http-server-gate now=@da scry=sley - call-args=[=duct type=* wrapped-task=(hobo task:able:light-gate)] - expected-moves=(list move:light-gate) + call-args=[=duct type=* wrapped-task=(hobo task:able:http-server-gate)] + expected-moves=(list move:http-server-gate) == - ^- [tang _light-gate] + ^- [tang _http-server-gate] :: - =/ light-core (light-gate our=~nul now=now eny=`@uvJ`0xdead.beef scry=scry) + =/ http-server-core (http-server-gate our=~nul now=now eny=`@uvJ`0xdead.beef scry=scry) :: - =^ moves light-gate (call:light-core call-args) + =^ moves http-server-gate (call:http-server-core call-args) :: =/ output=tang %+ expect-eq !> expected-moves !> moves :: - [output light-gate] + [output http-server-gate] :: -++ light-call-with-comparator - |= $: light-gate=_light-gate +++ http-server-call-with-comparator + |= $: http-server-gate=_http-server-gate now=@da scry=sley - call-args=[=duct type=* wrapped-task=(hobo task:able:light-gate)] - move-comparator=$-((list move:light-gate) tang) + call-args=[=duct type=* wrapped-task=(hobo task:able:http-server-gate)] + move-comparator=$-((list move:http-server-gate) tang) == - ^- [tang _light-gate] + ^- [tang _http-server-gate] :: - =/ light-core (light-gate our=~nul now=now eny=`@uvJ`0xdead.beef scry=scry) + =/ http-server-core (http-server-gate our=~nul now=now eny=`@uvJ`0xdead.beef scry=scry) :: - =^ moves light-gate (call:light-core call-args) + =^ moves http-server-gate (call:http-server-core call-args) :: =/ output=tang (move-comparator moves) :: - [output light-gate] + [output http-server-gate] :: -++ light-take - |= $: light-gate=_light-gate +++ http-server-take + |= $: http-server-gate=_http-server-gate now=@da scry=sley - take-args=[=wire =duct wrapped-task=(hypo sign:light-gate)] - expected-moves=(list move:light-gate) + take-args=[=wire =duct wrapped-task=(hypo sign:http-server-gate)] + expected-moves=(list move:http-server-gate) == - ^- [tang _light-gate] + ^- [tang _http-server-gate] :: - =/ light-core (light-gate our=~nul now=now eny=`@uvJ`0xdead.beef scry=scry) + =/ http-server-core (http-server-gate our=~nul now=now eny=`@uvJ`0xdead.beef scry=scry) :: - =^ moves light-gate (take:light-core take-args) + =^ moves http-server-gate (take:http-server-core take-args) :: =/ output=tang %+ expect-eq !> expected-moves !> moves :: - [output light-gate] + [output http-server-gate] :: -++ light-take-with-comparator - |= $: light-gate=_light-gate +++ http-server-take-with-comparator + |= $: http-server-gate=_http-server-gate now=@da scry=sley - take-args=[=wire =duct wrapped-task=(hypo sign:light-gate)] - move-comparator=$-((list move:light-gate) tang) + take-args=[=wire =duct wrapped-task=(hypo sign:http-server-gate)] + move-comparator=$-((list move:http-server-gate) tang) == - ^- [tang _light-gate] + ^- [tang _http-server-gate] :: - =/ light-core (light-gate our=~nul now=now eny=`@uvJ`0xdead.beef scry=scry) + =/ http-server-core (http-server-gate our=~nul now=now eny=`@uvJ`0xdead.beef scry=scry) :: - =^ moves light-gate (take:light-core take-args) + =^ moves http-server-gate (take:http-server-core take-args) :: =/ output=tang (move-comparator moves) :: - [output light-gate] + [output http-server-gate] :: ++ expect-gall-deal |= $: expected=[wire=path id=sock data=cush:gall] - actual=(wind note:light-gate gift:able:light-gate) + actual=(wind note:http-server-gate gift:able:http-server-gate) == ^- tang :: @@ -1360,7 +1360,7 @@ %+ weld (expect-eq !>(wire.expected) !>(p.actual)) :: - =/ note=note:light-gate q.actual + =/ note=note:http-server-gate q.actual ?. ?=([%g %deal *] note) [%leaf "bad move, not a %deal: {}"]~ :: @@ -1417,16 +1417,16 @@ :: +perform-authentication: goes through the authentication flow :: ++ perform-authentication - |= $: light-gate=_light-gate + |= $: http-server-gate=_http-server-gate start-now=@da scry=sley == - ^- [tang _light-gate] + ^- [tang _http-server-gate] :: the browser then fetches the login page :: - =^ results1 light-gate - %- light-call :* - light-gate + =^ results1 http-server-gate + %- http-server-call :* + http-server-gate now=start-now scry=*sley ^= call-args @@ -1437,7 +1437,7 @@ [%'GET' '/~/login?redirect=/~landscape/inner-path' ~ ~] == ^= expected-moves - ^- (list move:light-gate) + ^- (list move:http-server-gate) :~ :* duct=~[/http-blah] %give %response @@ -1446,15 +1446,15 @@ :~ ['content-type' 'text/html'] ['content-length' '348'] == - [~ (login-page:light-gate `'/~landscape/inner-path')] + [~ (login-page:http-server-gate `'/~landscape/inner-path')] complete=%.y == == == :: a response post redirects back to the application, setting cookie :: - =^ results2 light-gate - %- light-call :* - light-gate + =^ results2 http-server-gate + %- http-server-call :* + http-server-gate now=(add start-now ~m1) scry=*sley ^= call-args @@ -1470,7 +1470,7 @@ 'password=lidlut-tabwed-pillex-ridrup&redirect=/~landscape' == ^= expected-moves - ^- (list move:light-gate) + ^- (list move:http-server-gate) :~ :* duct=~[/http-blah] %give %response @@ -1485,19 +1485,19 @@ == == == :: - :_ light-gate + :_ http-server-gate (weld results1 results2) :: performs all initialization and an initial PUT. :: ++ perform-init-start-channel - |= $: light-gate=_light-gate + |= $: http-server-gate=_http-server-gate scry=sley == - ^- [tang _light-gate] + ^- [tang _http-server-gate] :: - =^ results1 light-gate - %- light-call :* - light-gate + =^ results1 http-server-gate + %- http-server-call :* + http-server-gate now=~1111.1.1 scry=*sley call-args=[duct=~[/init] ~ [%init ~nul]] @@ -1505,17 +1505,17 @@ == :: ensure there's an authenticated session :: - =^ results2 light-gate + =^ results2 http-server-gate %- perform-authentication :* - light-gate + http-server-gate now=~1111.1.2 scry=*sley == :: send the channel a poke and a subscription request :: - =^ results3 light-gate - %- light-call-with-comparator :* - light-gate + =^ results3 http-server-gate + %- http-server-call-with-comparator :* + http-server-gate now=~1111.1.2 scry=*sley ^= call-args @@ -1545,7 +1545,7 @@ ''' == ^= comparator - |= moves=(list move:light-gate) + |= moves=(list move:http-server-gate) ^- tang :: ?. ?=([^ ^ ^ ^ ~] moves) @@ -1578,6 +1578,6 @@ !> i.t.t.t.moves == == :: - :_ light-gate + :_ http-server-gate :(weld results1 results2 results3) -- diff --git a/tests/sys/vane/jael.hoon b/tests/sys/vane/jael.hoon index f7d2da55c..def6f04dc 100644 --- a/tests/sys/vane/jael.hoon +++ b/tests/sys/vane/jael.hoon @@ -30,7 +30,7 @@ [hen %slip %c %init ~nul] [hen %slip %g %init ~nul] [hen %slip %d %init ~nul] - [hen %slip %l %init ~nul] + [hen %slip %http-server %init ~nul] [hen %give %init ~nul] [hen %pass /~nul/init %b %wait +(~1234.5.6)] == ==