2016-04-06 23:43:02 +03:00
|
|
|
:: Basic authentication
|
|
|
|
::
|
|
|
|
:::: /hoon/basic-auth/lib
|
|
|
|
::
|
2016-12-07 06:13:33 +03:00
|
|
|
=, eyre
|
2016-04-06 23:43:02 +03:00
|
|
|
|%
|
|
|
|
++ keys @t
|
|
|
|
--
|
|
|
|
::
|
|
|
|
::::
|
|
|
|
::
|
2018-03-19 07:18:20 +03:00
|
|
|
|_ {bal/(bale keys) ~}
|
2016-04-07 20:37:28 +03:00
|
|
|
++ auth
|
|
|
|
|%
|
|
|
|
++ header
|
|
|
|
^- cord
|
|
|
|
?~ key.bal
|
|
|
|
~_ leaf+"Run |init-auth-basic {<`path`dom.bal>}"
|
|
|
|
~|(%basic-auth-no-key !!)
|
|
|
|
(cat 3 'Basic ' key.bal)
|
|
|
|
--
|
|
|
|
::
|
|
|
|
++ add-auth-header
|
|
|
|
|= a/hiss ^- hiss
|
2017-10-20 23:13:10 +03:00
|
|
|
~& auth+(en-purl:html p.a)
|
2016-04-07 20:37:28 +03:00
|
|
|
%_(a q.q (~(add ja q.q.a) %authorization header:auth))
|
2016-04-06 23:43:02 +03:00
|
|
|
::
|
|
|
|
++ standard
|
|
|
|
|%
|
|
|
|
++ out-adding-header
|
|
|
|
|= a/hiss ^- sec-move
|
2016-04-07 20:37:28 +03:00
|
|
|
[%send (add-auth-header a)]
|
2016-04-06 23:43:02 +03:00
|
|
|
--
|
|
|
|
--
|