From acdc3d52ecc929545e9f76435ec9bf0ca9acbc07 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 24 Jan 2012 04:47:58 +0200 Subject: [PATCH] Beginning of megarepo --- LICENSE => authenticate/LICENSE | 0 .../OpenId2}/Discovery.hs | 0 .../OpenId2}/Normalization.hs | 0 {OpenId2 => authenticate/OpenId2}/Types.hs | 0 {OpenId2 => authenticate/OpenId2}/XRDS.hs | 0 Setup.lhs => authenticate/Setup.lhs | 0 .../Web}/Authenticate/BrowserId.hs | 0 .../Web}/Authenticate/Internal.hs | 0 .../Web}/Authenticate/Kerberos.hs | 0 .../Web}/Authenticate/OAuth.hs | 0 .../Web}/Authenticate/OpenId.hs | 0 .../Web}/Authenticate/OpenId/Providers.hs | 0 .../Web}/Authenticate/Rpxnow.hs | 0 .../authenticate.cabal | 0 browserid.hs => authenticate/browserid.hs | 0 openid2.hs => authenticate/openid2.hs | 0 rpxnow.hs => authenticate/rpxnow.hs | 0 facebook.hs | 73 ------------------- 18 files changed, 73 deletions(-) rename LICENSE => authenticate/LICENSE (100%) rename {OpenId2 => authenticate/OpenId2}/Discovery.hs (100%) rename {OpenId2 => authenticate/OpenId2}/Normalization.hs (100%) rename {OpenId2 => authenticate/OpenId2}/Types.hs (100%) rename {OpenId2 => authenticate/OpenId2}/XRDS.hs (100%) rename Setup.lhs => authenticate/Setup.lhs (100%) rename {Web => authenticate/Web}/Authenticate/BrowserId.hs (100%) rename {Web => authenticate/Web}/Authenticate/Internal.hs (100%) rename {Web => authenticate/Web}/Authenticate/Kerberos.hs (100%) rename {Web => authenticate/Web}/Authenticate/OAuth.hs (100%) rename {Web => authenticate/Web}/Authenticate/OpenId.hs (100%) rename {Web => authenticate/Web}/Authenticate/OpenId/Providers.hs (100%) rename {Web => authenticate/Web}/Authenticate/Rpxnow.hs (100%) rename authenticate.cabal => authenticate/authenticate.cabal (100%) rename browserid.hs => authenticate/browserid.hs (100%) rename openid2.hs => authenticate/openid2.hs (100%) rename rpxnow.hs => authenticate/rpxnow.hs (100%) delete mode 100644 facebook.hs diff --git a/LICENSE b/authenticate/LICENSE similarity index 100% rename from LICENSE rename to authenticate/LICENSE diff --git a/OpenId2/Discovery.hs b/authenticate/OpenId2/Discovery.hs similarity index 100% rename from OpenId2/Discovery.hs rename to authenticate/OpenId2/Discovery.hs diff --git a/OpenId2/Normalization.hs b/authenticate/OpenId2/Normalization.hs similarity index 100% rename from OpenId2/Normalization.hs rename to authenticate/OpenId2/Normalization.hs diff --git a/OpenId2/Types.hs b/authenticate/OpenId2/Types.hs similarity index 100% rename from OpenId2/Types.hs rename to authenticate/OpenId2/Types.hs diff --git a/OpenId2/XRDS.hs b/authenticate/OpenId2/XRDS.hs similarity index 100% rename from OpenId2/XRDS.hs rename to authenticate/OpenId2/XRDS.hs diff --git a/Setup.lhs b/authenticate/Setup.lhs similarity index 100% rename from Setup.lhs rename to authenticate/Setup.lhs diff --git a/Web/Authenticate/BrowserId.hs b/authenticate/Web/Authenticate/BrowserId.hs similarity index 100% rename from Web/Authenticate/BrowserId.hs rename to authenticate/Web/Authenticate/BrowserId.hs diff --git a/Web/Authenticate/Internal.hs b/authenticate/Web/Authenticate/Internal.hs similarity index 100% rename from Web/Authenticate/Internal.hs rename to authenticate/Web/Authenticate/Internal.hs diff --git a/Web/Authenticate/Kerberos.hs b/authenticate/Web/Authenticate/Kerberos.hs similarity index 100% rename from Web/Authenticate/Kerberos.hs rename to authenticate/Web/Authenticate/Kerberos.hs diff --git a/Web/Authenticate/OAuth.hs b/authenticate/Web/Authenticate/OAuth.hs similarity index 100% rename from Web/Authenticate/OAuth.hs rename to authenticate/Web/Authenticate/OAuth.hs diff --git a/Web/Authenticate/OpenId.hs b/authenticate/Web/Authenticate/OpenId.hs similarity index 100% rename from Web/Authenticate/OpenId.hs rename to authenticate/Web/Authenticate/OpenId.hs diff --git a/Web/Authenticate/OpenId/Providers.hs b/authenticate/Web/Authenticate/OpenId/Providers.hs similarity index 100% rename from Web/Authenticate/OpenId/Providers.hs rename to authenticate/Web/Authenticate/OpenId/Providers.hs diff --git a/Web/Authenticate/Rpxnow.hs b/authenticate/Web/Authenticate/Rpxnow.hs similarity index 100% rename from Web/Authenticate/Rpxnow.hs rename to authenticate/Web/Authenticate/Rpxnow.hs diff --git a/authenticate.cabal b/authenticate/authenticate.cabal similarity index 100% rename from authenticate.cabal rename to authenticate/authenticate.cabal diff --git a/browserid.hs b/authenticate/browserid.hs similarity index 100% rename from browserid.hs rename to authenticate/browserid.hs diff --git a/openid2.hs b/authenticate/openid2.hs similarity index 100% rename from openid2.hs rename to authenticate/openid2.hs diff --git a/rpxnow.hs b/authenticate/rpxnow.hs similarity index 100% rename from rpxnow.hs rename to authenticate/rpxnow.hs diff --git a/facebook.hs b/facebook.hs deleted file mode 100644 index 686f37b3..00000000 --- a/facebook.hs +++ /dev/null @@ -1,73 +0,0 @@ -{-# LANGUAGE TypeFamilies, QuasiQuotes, TemplateHaskell, MultiParamTypeClasses, OverloadedStrings #-} -import Yesod -import Web.Authenticate.Facebook -import Data.Maybe (fromMaybe) -import qualified Data.Aeson as A -import qualified Data.Vector as V -import qualified Data.Map as M - -data FB = FB Facebook -type Handler = GHandler FB FB - -fb :: FB -fb = FB Facebook - { facebookClientId = "154414801293567" - , facebookClientSecret = "f901e124bee0d162c9188f92b939b370" - , facebookRedirectUri = "http://localhost:3000/facebook" - } - -mkYesod "FB" [parseRoutes| -/ RootR GET -/facebook FacebookR GET -|] - -instance Yesod FB where approot _ = "http://localhost:3000" - -getRootR :: Handler () -getRootR = do - FB f <- getYesod - let s = getForwardUrl f ["email"] - liftIO $ print ("Redirecting" :: String, s) - redirectText RedirectTemporary s - -getFacebookR :: Handler RepHtml -getFacebookR = do - FB f <- getYesod - code <- runFormGet' $ stringInput "code" - at <- liftIO $ getAccessToken f code - liftIO $ print at - mreq <- runFormGet' $ maybeStringInput "req" - let req = fromMaybe "me" mreq - Right so <- liftIO $ getGraphData at req - let so' = objToHamlet so - hamletToRepHtml [hamlet|\ -
- - \Request: - - \ - -
-\^{so'} -|] - -main :: IO () -main = warpDebug 3000 fb - -objToHamlet :: A.Value -> Hamlet url -objToHamlet (A.String s) = [hamlet|#{s}|] -objToHamlet (A.Array list) = [hamlet| -