mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-29 12:15:43 +03:00
restructure lib/oauth1 to expose ++add-auth internals
This commit is contained in:
parent
3aa1ceb8b4
commit
a8a092074a
@ -205,24 +205,24 @@
|
||||
::
|
||||
::
|
||||
++ add-auth
|
||||
|= $: auq/quay :: extra oauth parameters
|
||||
=< |= $: auq/quay :: extra oauth parameters
|
||||
hiz/{purl meth hed/math (unit octs)}
|
||||
==
|
||||
^- hiss
|
||||
~& add-auth+(earn -.hiz)
|
||||
=< %_ hiz
|
||||
hed (~(add ja hed.hiz) %authorization authorization)
|
||||
==
|
||||
^- hiss
|
||||
~& add-auth+(earn -.hiz)
|
||||
%_ hiz
|
||||
hed (~(add ja hed.hiz) %authorization (authorization auq hiz))
|
||||
==
|
||||
|%
|
||||
++ authorization
|
||||
=+ [url med ~ bod]=hiz
|
||||
|= {auq/quay url/purl med/meth math bod/(unit octs)}
|
||||
=^ quy url [r.url url(r ~)] :: query string handled separately
|
||||
=. auq (fass (weld auq auth-quay))
|
||||
=+ ^- qen/quay-enc :: semi-encoded for sorting
|
||||
%+ weld (parse-pairs bod)
|
||||
(encode-pairs (weld auq quy))
|
||||
=+ hds=(base-string med url qen)
|
||||
=+ sig=(sign hds)
|
||||
=+ bay=(base-string med url qen)
|
||||
=+ sig=(sign signing-key bay)
|
||||
=. auq ['oauth_signature'^(crip (urle sig)) auq]
|
||||
(crip "OAuth {(to-header auq)}")
|
||||
::
|
||||
|
Loading…
Reference in New Issue
Block a user