urbit/lib/basic-auth.hoon

28 lines
462 B
Plaintext
Raw Normal View History

2016-04-06 23:43:02 +03:00
:: Basic authentication
::
:::: /hoon/basic-auth/lib
::
|%
++ keys @t
--
::
::::
::
|_ bal/(bale keys)
++ auth-header
^- {term cord}
?~ key.bal
~_ leaf+"Run |init-auth-basic {<`path`dom.bal>}"
~|(%basic-auth-no-key !!)
[%authorization (cat 3 'Basic ' key.bal)]
::
++ standard
|%
++ out-adding-header
|= a/hiss ^- sec-move
=+ aut=auth-header
~& aut=aut
[%send %_(a q.q (~(add ja q.q.a) -.aut +.aut))]
--
--