urbit/arvo/jael.hoon

87 lines
3.0 KiB
Plaintext
Raw Normal View History

2014-09-23 21:11:59 +04:00
:: %jael, secret storage
::
:::: /hoon/jael
::
!? 164
::::
2014-11-02 01:13:18 +03:00
:: %jael is logically homogeneous, but please follow these conventions:
::
:: /cap :: foreign app keys
:: /service :: service name, eg %face
:: /appid :: your ship's app-id
:: /@uvH :: by hash
:: /@ud :: by number
:: /@tas :: by name
::
:: /key :: foreign user secrets
:: /service :: service name, eg %face
:: /userid :: user identity
2014-11-04 02:07:46 +03:00
::
:: /urb :: urbit secrets
:: /tok/hash
2014-11-02 01:13:18 +03:00
2014-09-23 21:11:59 +04:00
|= pit=vase
=> =~
:: structures
|%
++ axle :: %jael state
$: %0 ::
2014-11-02 01:13:18 +03:00
ent=@uwH :: entropy
2014-09-23 21:11:59 +04:00
all=(map ship ,[p=@ q=safe]) :: entropy, secrets
== ::
2014-11-02 01:13:18 +03:00
++ mast $: ent=@
2014-09-23 21:11:59 +04:00
++ mort ,[p=@da q=duct r=@] :: a mortal secret
++ gift :: out result <-$
$% [%done p=path q=@] :: key expired
== ::
++ kiss :: in request ->$
2014-11-02 01:13:18 +03:00
$% [%kill p=
[%drop p=@p q=path r=@] :: discard key
2014-09-23 21:11:59 +04:00
[%junk p=@] :: add entropy
[%show p=@p q=path] :: read subtree
[%tell p=@ q=path r=@da s=@] :: save key
== ::
++ safe ,[p=(unit ,@) q=(map ,@ta safe)] :: secret tree
++ move ,[p=duct q=[%give p=gift]] :: local move
-- ::
. ==
=| axle
=* lex -
|= [now=@da eny=@ ski=sled] :: activate
^? :: opaque core
|% ::
++ call :: request
|= [hen=duct hic=(hypo (hobo kiss))]
^- [p=(list move) q=_..^$]
=> .(q.hic ?.(?=(%soft -.q.hic) q.hic ((hard kiss) p.q.hic)))
!!
::
++ doze
|= [now=@da hen=duct]
^- (unit ,@da)
~
::
++ load :: highly forgiving
|= old=*
=+ lox=((soft axle) old)
^+ ..^$
?~ lox
~& %jael-reset
..^$
..^$(+>- u.lox)
::
++ scry
|= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path]
^- (unit (unit (pair mark ,*)))
:: actually scry
~
::
++ stay :: save w/o cache
`axle`+>-.$(pol (~(run by pol) |=(a=baby [tad.a dym.a ~])))
::
++ take :: response
|= [tea=wire hen=duct hin=(hypo noun)]
!!
--