From 1fa17f5c2325ee42f96db933dd18b0a6c373d906 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Mon, 10 Dec 2018 15:53:21 -0800 Subject: [PATCH] Remove all security drivers but Google, which is used. --- sec/com/asana.hoon | 39 ------------------------------------ sec/com/digitalocean.hoon | 38 ----------------------------------- sec/com/dropboxapi.hoon | 41 -------------------------------------- sec/com/facebook.hoon | 42 --------------------------------------- sec/com/github.hoon | 10 ---------- sec/com/instagram.hoon | 41 -------------------------------------- sec/com/slack.hoon | 21 -------------------- 7 files changed, 232 deletions(-) delete mode 100644 sec/com/asana.hoon delete mode 100644 sec/com/digitalocean.hoon delete mode 100644 sec/com/dropboxapi.hoon delete mode 100644 sec/com/facebook.hoon delete mode 100644 sec/com/github.hoon delete mode 100644 sec/com/instagram.hoon delete mode 100644 sec/com/slack.hoon diff --git a/sec/com/asana.hoon b/sec/com/asana.hoon deleted file mode 100644 index b90135900f..0000000000 --- a/sec/com/asana.hoon +++ /dev/null @@ -1,39 +0,0 @@ -:: Test url +https://app.asana.com/api/1.0/users/me -:: -:::: /hoon/asana/com/sec - :: -/+ oauth2 -:: -:::: - :: -|% -++ dialog-url 'https://app.asana.com/-/oauth_authorize?response_type=code' -++ exchange-url 'https://app.asana.com/-/oauth_token' --- -:: -:::: - :: -|_ {bal/(bale:eyre keys:oauth2) tok/token:oauth2} -:: ++aut is a "standard oauth2" core, which implements the -:: 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))) -++ filter-request (out-add-header:aut scope=~ dialog-url) -:: -++ 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" - -:: Be sure to be on https://localhost:8443 and to have registered -:: 'http://localhost:8443/~/ac/asana.com/~./in' as the redirect URI. -:: (If unable to change port number of ship, change the redirect URI port in %eyre) - -:: |init-oauth2 /com/asana - -:: Enter this sample command to get your user information: -:: +https://app.asana.com/api/1.0/users/me - -:: Before you receive the response, you'll have to clink on the link. -:: If you successfully auth, you should receive the response in the dojo. diff --git a/sec/com/digitalocean.hoon b/sec/com/digitalocean.hoon deleted file mode 100644 index b50e333444..0000000000 --- a/sec/com/digitalocean.hoon +++ /dev/null @@ -1,38 +0,0 @@ -:: Test url +https://api.digitalocean.com/v2/account -:: -:::: /hoon/digitalocean/com/sec - :: -/+ oauth2 -:: -:::: - :: -|% -++ dialog-url 'https://cloud.digitalocean.com/v1/oauth/authorize?response_type=code' -++ exchange-url 'https://cloud.digitalocean.com/v1/oauth/token' --- -:: -:::: - :: -|_ {bal/(bale:eyre keys:oauth2) tok/token:oauth2} -:: ++aut is a "standard oauth2" core, which implements the -:: 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))) -++ filter-request (out-add-header:aut scope=~[%read %write] dialog-url) -:: -++ 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 - -:: Be sure to be on https://localhost:8443 and to have registered -:: 'http://localhost:8443/~/ac/digitalocean.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/digitalocean - -:: Enter home this sample command to get your user information: -:: +https://api.digitalocean.com/v2/account -:: Before you receive the response, you'll have to clink on the link. -:: If you successfully auth, you should receive the response in the dojo. diff --git a/sec/com/dropboxapi.hoon b/sec/com/dropboxapi.hoon deleted file mode 100644 index 06132407b0..0000000000 --- a/sec/com/dropboxapi.hoon +++ /dev/null @@ -1,41 +0,0 @@ -:: Test url +https://api.dropboxapi.com/2/users/get_current_account &json ~ -:: -:::: /hoon/dropboxapi/com/sec - :: -/+ oauth2 -:: -:::: - :: -|% -++ dialog-url 'https://www.dropbox.com/1/oauth2/authorize?response_type=code' -++ exchange-url 'https://api.dropboxapi.com/1/oauth2/token' --- -:: -:::: - :: -|_ {bal/(bale:eyre keys:oauth2) tok/token:oauth2} -:: ++aut is a "standard oauth2" core, which implements the -:: 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))) -++ filter-request (out-add-header:aut scope=~ dialog-url) -:: -++ 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. - -:: Be sure to be on https://localhost:8443 and to have registered -:: '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/dropbox - -:: Enter this sample command to show your user info: -:: +https://api.dropboxapi.com/2/users/get_current_account &json ~ - -:: Before you receive the response, you'll have to click on the link in the -:: dojo to authenticate yourself. - -:: You should receive a response listing the contents of that directory. diff --git a/sec/com/facebook.hoon b/sec/com/facebook.hoon deleted file mode 100644 index 885b36fd77..0000000000 --- a/sec/com/facebook.hoon +++ /dev/null @@ -1,42 +0,0 @@ -:: Test url +https://graph.facebook.com/v2.5/me -:: -:::: /hoon/facebook/com/sec - :: -/+ oauth2 -:: -:::: - :: -|% -++ dialog-url 'https://www.facebook.com/dialog/oauth?response_type=code' -++ exchange-url 'https://graph.facebook.com/v2.3/oauth/access_token' --- -:: -:::: - :: -|_ {bal/(bale:eyre keys:oauth2) access-token/token:oauth2} -:: ++aut is a "standard oauth2" core, which implements the -:: most common handling of oauth2 semantics. see lib/oauth2 for more details, -:: and examples at the bottom of the file. -++ aut - %+ ~(standard oauth2 bal access-token) . - |=(access-token/token:oauth2 +>(access-token access-token)) -:: -++ filter-request - %^ out-add-query-param:aut 'access_token' - scope=~['user_about_me' 'user_posts'] - dialog-url -:: -++ receive-auth-query-string (in-code-to-token:aut exchange-url) -:: -++ receive-auth-response - |= a/httr:eyre ^- core-move:aut - ?: (bad-response:aut p.a) - [%give a] :: [%redo ~] :: handle 4xx? - =+ `{access-token/@t expires-in/@u}`(grab-expiring-token:aut a) - ?. (lth expires-in ^~((div ~d7 ~s1))) :: short-lived token - [[%redo ~] +>.$(access-token access-token)] - :- %send - %^ request-token:aut exchange-url - grant-type='fb_exchange_token' - [key='fb_exchange_token' value=access-token]~ --- diff --git a/sec/com/github.hoon b/sec/com/github.hoon deleted file mode 100644 index bcda96405c..0000000000 --- a/sec/com/github.hoon +++ /dev/null @@ -1,10 +0,0 @@ -:: Test url +https://api.github.com/user -:: -:::: /hoon/github/com/sec - :: -/+ basic-auth -:: -|_ {bal/(bale:eyre keys:basic-auth) ~} -++ aut ~(standard basic-auth bal ~) -++ filter-request out-adding-header:aut --- diff --git a/sec/com/instagram.hoon b/sec/com/instagram.hoon deleted file mode 100644 index 2ce1fd2295..0000000000 --- a/sec/com/instagram.hoon +++ /dev/null @@ -1,41 +0,0 @@ -:: Test url +https://api.instagram.com/v1/users/self -:: -:::: /hoon/instagram/com/sec - :: -/+ oauth2 -:: -:::: - :: -|% -++ dialog-url 'https://api.instagram.com/oauth/authorize?response_type=code' -++ exchange-url 'https://api.instagram.com/oauth/access_token' --- -:: -:::: - :: -|_ {bal/(bale:eyre keys:oauth2) tok/token:oauth2} -:: ++aut is a "standard oauth2" core, which implements the -:: 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))) -++ filter-request - %^ out-add-query-param:aut 'access_token' - scope=~[%basic] - dialog-url -:: -++ 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 - -:: Be sure to be on https://localhost:8443, and to have registered -:: http://localhost:8443/~/ac/instagram.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 - -:: Enter this sample command to get your user information: -:: +https://api.instagram.com/v1/users/self - -:: Before you receive the response, you'll have to clink on the link to -:: authenicate yourself. You should then receive the response. diff --git a/sec/com/slack.hoon b/sec/com/slack.hoon deleted file mode 100644 index 45facdf012..0000000000 --- a/sec/com/slack.hoon +++ /dev/null @@ -1,21 +0,0 @@ -:: Test url +https://slack.com/api/auth.test -:: -:::: /hoon/slack/com/sec - :: -/+ oauth2 -:: -:::: - :: -|_ {bal/(bale:eyre keys:oauth2) tok/token:oauth2} -:: ++aut is a "standard oauth2" core, which implements the -:: 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))) -++ filter-request - %^ out-add-query-param:aut 'token' - scope=~[%client %admin] - oauth-dialog='https://slack.com/oauth/authorize' -:: -++ receive-auth-query-string (in-code-to-token:aut url='https://slack.com/api/oauth.access') -++ receive-auth-response bak-save-token:aut ---