packages feed

happstack-authenticate 0.9.2 → 0.9.3

raw patch · 4 files changed

+24/−10 lines, 4 filesdep ~http-typesPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: http-types

API changes (from Hackage documentation)

Files

Happstack/Auth/Core/Auth.hs view
@@ -89,9 +89,23 @@     deriving (Eq, Ord, Read, Show, Data, Typeable) $(deriveSafeCopy 1 'base ''HashedPass) +-- | NOTE: The Eq and Ord instances are 'case-insensitive'. They apply 'toCaseFold' before comparing. newtype UserName = UserName { unUserName :: Text }-    deriving (Eq, Ord, Read, Show, Data, Typeable)+    deriving (Read, Show, Data, Typeable) $(deriveSafeCopy 1 'base ''UserName)++instance Eq UserName where+    (UserName x) == (UserName y) = (Text.toCaseFold x) == (Text.toCaseFold y)+    (UserName x) /= (UserName y) = (Text.toCaseFold x) /= (Text.toCaseFold y)++instance Ord UserName where+    compare (UserName x) (UserName y) = compare (Text.toCaseFold x) (Text.toCaseFold y)+    (UserName x) <  (UserName y)      = (Text.toCaseFold x) <  (Text.toCaseFold y)+    (UserName x) >= (UserName y)      = (Text.toCaseFold x) >= (Text.toCaseFold y)+    (UserName x) >  (UserName y)      = (Text.toCaseFold x) >  (Text.toCaseFold y)+    (UserName x) <= (UserName y)      = (Text.toCaseFold x) <= (Text.toCaseFold y)+    max (UserName x) (UserName y)     = UserName $ max (Text.toCaseFold x) (Text.toCaseFold y)+    min (UserName x) (UserName y)     = UserName $ min (Text.toCaseFold x) (Text.toCaseFold y)  newtype UserPassId = UserPassId { unUserPassId :: Integer }       deriving (Eq, Ord, Read, Show, Data, Typeable)
Happstack/Auth/Core/AuthParts.hs view
@@ -19,7 +19,7 @@ import Happstack.Auth.Core.Auth import Happstack.Auth.Core.AuthURL import Network.HTTP.Conduit       (withManager)-import Web.Authenticate.OpenId    (Identifier, authenticate, getForwardUrl)+import Web.Authenticate.OpenId    (Identifier, OpenIdResponse(..), authenticateClaimed, getForwardUrl) -- import Web.Authenticate.Facebook  (Facebook(..), getAccessToken, getGraphData) -- import qualified Web.Authenticate.Facebook as Facebook import Web.Routes@@ -50,8 +50,8 @@ getIdentifier =     do pairs'      <- lookPairsBS        let pairs = mapMaybe (\(k, ev) -> case ev of (Left _) -> Nothing ; (Right v) -> Just (T.pack k, TL.toStrict $ TL.decodeUtf8 v)) pairs'-       (identifier, _) <- liftIO $ withManager $ authenticate pairs-       return identifier+       oir <- liftIO $ withManager $ authenticateClaimed pairs+       return (oirOpLocal oir)  -- calling this will log you in as 1 or more AuthIds -- problem.. if the Identifier is not associated with any Auths, then we are in trouble, because the identifier will be 'lost'.
Happstack/Auth/Core/AuthURL.hs view
@@ -38,7 +38,7 @@ instance Arbitrary OpenIdProvider where     arbitrary = oneof $ map return [ minBound .. maxBound ] -data AuthMode +data AuthMode     = LoginMode     | AddIdentifierMode       deriving (Eq, Ord, Read, Show, Data, Typeable)@@ -52,8 +52,8 @@              , do segment "add_identifier"                   return AddIdentifierMode              ]-    -      ++ instance Arbitrary AuthMode where     arbitrary = oneof [ return LoginMode                       , return AddIdentifierMode@@ -116,7 +116,7 @@     toPathSegments A_ChangePassword = ["change_password"]     toPathSegments A_AddAuth        = ["add_auth"]     toPathSegments (A_OpenId o)     = "openid" : toPathSegments o-    toPathSegments (A_OpenIdProvider authMode provider) = "provider" : toPathSegments authMode ++ toPathSegments provider +    toPathSegments (A_OpenIdProvider authMode provider) = "provider" : toPathSegments authMode ++ toPathSegments provider     toPathSegments (A_Facebook authMode)         = "facebook"          : toPathSegments authMode     toPathSegments (A_FacebookRedirect authMode) = "facebook-redirect" : toPathSegments authMode 
happstack-authenticate.cabal view
@@ -1,5 +1,5 @@ Name:                happstack-authenticate-Version:             0.9.2+Version:             0.9.3 Synopsis:            Happstack Authentication Library Description:         A themeable authentication library with support for username+password and OpenId. Homepage:            http://src.seereason.com/happstack-authenticate@@ -34,7 +34,7 @@                        ixset                        >= 1.0 && < 1.1,                        happstack-server             >= 6.0 && < 7.1,                        http-conduit                 == 1.4.*,-                       http-types                   == 0.6.*,+                       http-types                   >= 0.6 && < 0.8,                        fb                           == 0.9.*,                        safecopy                     == 0.6.*,                        mtl                          >= 2.0,