mirror of
https://github.com/urbit/shrub.git
synced 2025-01-05 11:09:30 +03:00
Merge pull request #992 from urbit/acme-retouch
adds exponential backoff and :hall notifications to :acme
This commit is contained in:
commit
563a1610f8
852
app/acme.hoon
852
app/acme.hoon
File diff suppressed because it is too large
Load Diff
@ -661,7 +661,7 @@
|
||||
:: kill active outgoing requests
|
||||
::
|
||||
=. +>.$
|
||||
=/ fok=(list duct) ~(tap in ~(key by kes))
|
||||
=/ fok=(list duct) (turn ~(val by q.ask) head)
|
||||
|- ^+ +>.^$
|
||||
?~ fok +>.^$
|
||||
%= $
|
||||
@ -756,11 +756,24 @@
|
||||
::
|
||||
$them :: outbound request
|
||||
?~ p.kyz
|
||||
=+ sud=(need (~(get by kes) hen))
|
||||
?~ sud=(~(get by kes) hen)
|
||||
:: delete an element from q.ask by traversing to prevent leakage
|
||||
::
|
||||
=. q.ask
|
||||
=/ qas ~(tap by q.ask)
|
||||
|- ^+ q.ask
|
||||
?~ qas
|
||||
q.ask
|
||||
?: =(hen p.q.i.qas)
|
||||
(~(del by q.ask) p.i.qas)
|
||||
$(qas t.qas)
|
||||
::
|
||||
+>.$
|
||||
::
|
||||
=. +>.$
|
||||
%_ +>.$
|
||||
mow :_(mow [ged [%give %thus sud ~]])
|
||||
q.ask (~(del by q.ask) sud)
|
||||
mow :_(mow [ged [%give %thus u.sud ~]])
|
||||
q.ask (~(del by q.ask) u.sud)
|
||||
kes (~(del by kes) hen)
|
||||
==
|
||||
::
|
||||
|
@ -16,17 +16,19 @@
|
||||
++ test-first-order
|
||||
=/ dom=(set turf) (sy /org/urbit/zod ~)
|
||||
=^ moves app (~(poke-acme-order app *bowl:gall *acme:app) dom)
|
||||
=/ msg "requesting an https certificate for zod.urbit.org"
|
||||
=/ msg 'requesting an https certificate for zod.urbit.org'
|
||||
;: weld
|
||||
%+ expect-eq
|
||||
!> :~ [ost.bow.app %wait /acme/directory +(now.bow.app)]
|
||||
[ost.bow.app %flog / %text msg]
|
||||
!> :~ =- [ost.bow.app [%poke / -]]
|
||||
=- [[~zod %hall] %hall-action %phrase (sy [~zod %inbox] ~) -]
|
||||
~[[%app %$ [%lin & msg]]]
|
||||
[ost.bow.app %wait /acme/try/1/directory +(now.bow.app)]
|
||||
==
|
||||
!> moves
|
||||
::
|
||||
%+ expect-eq
|
||||
!> [~ dom]
|
||||
!> pen.app
|
||||
!> (some ~(key by (fall next-order.app ~)))
|
||||
::
|
||||
%+ expect-eq
|
||||
!> &
|
||||
@ -39,11 +41,11 @@
|
||||
:: tests that acme requests service directory on %wake
|
||||
::
|
||||
++ test-first-order-wake
|
||||
=^ moves app (~(wake app *bowl:gall *acme:app) /acme/directory ~)
|
||||
=^ moves app (~(wake app *bowl:gall *acme:app) /acme/try/1/directory ~)
|
||||
=/ url
|
||||
=- (need (de-purl:html -))
|
||||
'https://acme-staging-v02.api.letsencrypt.org/directory'
|
||||
%+ expect-eq
|
||||
!> ~[[ost.bow.app [%hiss /acme/directory/~zod ~ %httr %hiss url %get ~ ~]]]
|
||||
!> ~[[ost.bow.app [%hiss /acme/try/2/directory ~ %httr %hiss url %get ~ ~]]]
|
||||
!> moves
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user