Merge branch 'sec-names' into porcelain

This commit is contained in:
Philip C Monk 2016-04-14 13:57:33 -04:00
commit 4d65df4eb6
11 changed files with 56 additions and 51 deletions

View File

@ -67,10 +67,10 @@
++ whir-of {p/knot:ship q/term r/?($mess $lens) s/wire} :: path in dock
++ whir-se ?($core vi-arm) :: build/call
++ vi-arm
$? $out :: ++out mod request
$res :: ++res use result
$bak :: ++bak auth response
$in :: ++in handle code
$? $filter-request :: ++out mod request
$filter-response :: ++res use result
$receive-auth-response :: ++bak auth response
$receive-auth-query-string :: ++in handle code
== ::
-- ::
|% :: models
@ -1712,9 +1712,9 @@
[[%& 12]~ %$ bale+!>(*(bale @))] :: XX specify on type?
?~ cor ~
?~ u.cor ~
?: (has-arm %wyp) ~
?: (has-arm %upd)
[[%& 13]~ ride+[limb+%upd prep-cor]]~
?: (has-arm %discard-state) ~
?: (has-arm %update)
[[%& 13]~ ride+[limb+%update prep-cor]]~
[[%& 13]~ %$ noun+(slot 13 u.cor)]~
::
++ call
@ -1746,8 +1746,8 @@
?~ ole abet
:: process hiss
=. hen p.u.ole
?~ u.cor (eyre-them %out r.u.ole) :: don't process
(call %out hiss+r.u.ole)
?~ u.cor (eyre-them %filter-request r.u.ole) :: don't process
(call %filter-request hiss+r.u.ole)
::
++ fin-httr
|= vax/vase:httr
@ -1759,26 +1759,31 @@
:: Interfaces
::
++ get-news _build
++ get-quay |=(quy/quay (call %in quay+!>(quy)))
++ get-quay |=(quy/quay (call %receive-auth-query-string quay+!>(quy)))
++ get-req |=(a/{mark vase:hiss} pump(req (~(put to req) hen a)))
++ get-thou
|= {wir/whir-se hit/httr}
?+ wir !!
$in (call %bak httr+!>(hit))
$out
?. (has-arm %res) (fin-httr !>(hit))
(call %res httr+!>(hit))
$receive-auth-query-string (call %receive-auth-response httr+!>(hit))
$filter-request
?. (has-arm %filter-response) (fin-httr !>(hit))
(call %filter-response httr+!>(hit))
==
::
++ get-made
|= {wir/whir-se dep/@uvH res/(each cage tang)} ^+ abet
?: ?=($core wir) (update dep res)
%. res
?-(wir $out res-out, $res res-res, $bak res-bak, $in res-in)
?- wir
$filter-request res-out
$filter-response res-res
$receive-auth-response res-bak
$receive-auth-query-string res-in
==
::
++ update
|= {dep/@uvH gag/(each cage tang)}
:: ~& got-upd/dep
:: ~& got-update/dep
=. ..vi (pass-note %core [%f [%wasp our dep &]])
?~ -.gag pump(cor `q.p.gag)
?: &(=(~ cor) =(%$ usr))
@ -1846,13 +1851,13 @@
::
++ res-in
%+ on-error dead-this |.
(handle-moves send+(do-send %in) ~)
(handle-moves send+(do-send %receive-auth-query-string) ~)
::
++ res-res
%+ on-error dead-hiss |.
%- handle-moves :~
give+do-give
send+(do-send %out)
send+(do-send %filter-request)
redo+_pump
==
::
@ -1860,7 +1865,7 @@
%+ on-error dead-this |.
%- handle-moves :~
give+do-give
send+(do-send %in)
send+(do-send %receive-auth-query-string)
redo+_pump(..vi (give-html 200 ~ exit:xml))
==
::
@ -1869,7 +1874,7 @@
%+ on-error warn |.
%- handle-moves :~
give+do-give
send+(do-send %out)
send+(do-send %filter-request)
show+do-show
==
-- --

View File

@ -210,7 +210,7 @@
|= a/tape ^- tape
?~ a ~
?: ?| [?=(^ q)]:(alp 1^1 a)
(~(has in (silt "!*'();:@&=+$,/?/%.~_")) i.a) :: XX reparse
(~(has in (silt "#!*'();:@&=+$,/?/%.~_")) i.a) :: XX reparse
==
[i.a $(a t.a)]
(weld (urle (trip i.a)) $(a t.a))

View File

@ -18,10 +18,10 @@
:: most common handling of oauth2 semantics. see lib/oauth2 for more details,
:: and examples at the bottom of the file.
++ aut (~(standard oauth2 bal tok) . |=(tok/token:oauth2 +>(tok tok)))
++ out (out-add-header:aut scope=~ dialog-url)
++ filter-request (out-add-header:aut scope=~ dialog-url)
::
++ in (in-code-to-token:aut exchange-url)
++ bak bak-save-token:aut
++ receive-auth-query-string (in-code-to-token:aut exchange-url)
++ receive-auth-response bak-save-token:aut
--
:: create a developer app by logging into https://app.asana.com/, and clicking
:: "My Profile Settings" > Apps > "Manage my developer apps"

View File

@ -18,10 +18,10 @@
:: most common handling of oauth2 semantics. see lib/oauth2 for more details,
:: and examples at the bottom of the file.
++ aut (~(standard oauth2 bal tok) . |=(tok/token:oauth2 +>(tok tok)))
++ out (out-add-header:aut scope=~[%read %write] dialog-url)
++ filter-request (out-add-header:aut scope=~[%read %write] dialog-url)
::
++ in (in-code-to-token:aut exchange-url)
++ bak bak-save-token:aut
++ receive-auth-query-string (in-code-to-token:aut exchange-url)
++ receive-auth-response bak-save-token:aut
--
:: create a developer app on https://cloud.digitalocean.com/settings/api/applications/new
:: to get a client id and secret

View File

@ -18,10 +18,10 @@
:: most common handling of oauth2 semantics. see lib/oauth2 for more details,
:: and examples at the bottom of the file.
++ aut (~(standard oauth2 bal tok) . |=(tok/token:oauth2 +>(tok tok)))
++ out (out-add-header:aut scope=~ dialog-url)
++ filter-request (out-add-header:aut scope=~ dialog-url)
::
++ in (in-code-to-token:aut exchange-url)
++ bak bak-save-token:aut
++ receive-auth-query-string (in-code-to-token:aut exchange-url)
++ receive-auth-response bak-save-token:aut
--
:: create a developer app on https://www.dropbox.com/developers-v1/apps to get a
:: client id and secret.
@ -30,7 +30,7 @@
:: 'http://localhost:8443/~/ac/dropboxapi.com/~./in' as the redirect URI.
:: (If unable to change port number of ship, change the redirect URI port in %eyre)
:: |init-oauth2 |init-oauth2 /com/instagram
:: |init-oauth2 |init-oauth2 /com/dropbox
:: Enter this sample command to show your user info:
:: +https://api.dropboxapi.com/2/users/get_current_account &json ~

View File

@ -21,14 +21,14 @@
%+ ~(standard oauth2 bal access-token) .
|=(access-token/token:oauth2 +>(access-token access-token))
::
++ out
++ filter-request
%^ out-add-query-param:aut 'access_token'
scope=~['user_about_me' 'user_posts']
dialog-url
::
++ in (in-code-to-token:aut exchange-url)
++ receive-auth-query-string (in-code-to-token:aut exchange-url)
::
++ bak
++ receive-auth-response
|= a/httr ^- core-move:aut
?: (bad-response:aut p.a)
[%give a] :: [%redo ~] :: handle 4xx?

View File

@ -6,5 +6,5 @@
!:
|_ {bal/(bale keys:basic-auth) $~}
++ aut ~(standard basic-auth bal ~)
++ out out-adding-header:aut
++ filter-request out-adding-header:aut
--

View File

@ -44,12 +44,12 @@
=+ a=~(standard-refreshing oauth2 bal ber.own)
(a(state-usr &) ..auth ref.own |=(a/user-state ..auth(own a)))
::
++ out (out-refresh-or-add-header:auth exchange-url scopes dialog-url)
++ filter-request (out-refresh-or-add-header:auth exchange-url scopes dialog-url)
++ dialog-url (auth-usr usr.bal)
::
++ res res-save-after-refresh:auth
++ filter-response res-save-after-refresh:auth
::
++ in (in-code-to-token:auth exchange-url)
++ bak bak-save-both-tokens:auth
:: ++ upd *user-state
++ receive-auth-query-string (in-code-to-token:auth exchange-url)
++ receive-auth-response bak-save-both-tokens:auth
:: ++ update *user-state
--

View File

@ -18,13 +18,13 @@
:: most common handling of oauth2 semantics. see lib/oauth2 for more details,
:: and examples at the bottom of the file.
++ aut (~(standard oauth2 bal tok) . |=(tok/token:oauth2 +>(tok tok)))
++ out
++ filter-request
%^ out-add-query-param:aut 'access_token'
scope=~[%basic]
dialog-url
::
++ in (in-code-to-token:aut exchange-url)
++ bak bak-save-token:aut
++ receive-auth-query-string (in-code-to-token:aut exchange-url)
++ receive-auth-response bak-save-token:aut
--
:: create a developer app on https://www.instagram.com/developer/ to get a
:: client id and secret

View File

@ -11,11 +11,11 @@
:: most common handling of oauth2 semantics. see lib/oauth2 for more details,
:: and examples at the bottom of the file.
++ aut (~(standard oauth2 bal tok) . |=(tok/token:oauth2 +>(tok tok)))
++ out
++ filter-request
%^ out-add-query-param:aut 'token'
scope=~[%client %admin]
oauth-dialog='https://slack.com/oauth/authorize'
::
++ in (in-code-to-token:aut url='https://slack.com/api/oauth.access')
++ bak bak-save-token:aut
++ receive-auth-query-string (in-code-to-token:aut url='https://slack.com/api/oauth.access')
++ receive-auth-response bak-save-token:aut
--

View File

@ -11,17 +11,17 @@
:: most common handling of oauth1 semantics. see lib/oauth1 for more details,
:: and examples at the bottom of the file.
++ aut (~(standard oauth1 bal tok) . |=(tok/token:oauth1 +>(tok tok)))
++ out
++ filter-request
%+ out-add-header:aut
token-request='https://api.twitter.com/oauth/request_token'
oauth-dialog='https://api.twitter.com/oauth/authorize'
::
++ res res-handle-request-token:aut
++ filter-response res-handle-request-token:aut
::
++ in
++ receive-auth-query-string
%- in-exchange-token:aut
exchange-url='https://api.twitter.com/oauth/access_token'
::
++ bak bak-save-token:aut
:: ++ wyp ~
++ receive-auth-response bak-save-token:aut
:: ++ discard-state ~
--