module GI.Soup.Objects.Auth
(
Auth(..) ,
IsAuth ,
toAuth ,
noAuth ,
AuthAuthenticateMethodInfo ,
authAuthenticate ,
AuthCanAuthenticateMethodInfo ,
authCanAuthenticate ,
AuthGetAuthorizationMethodInfo ,
authGetAuthorization ,
AuthGetHostMethodInfo ,
authGetHost ,
AuthGetInfoMethodInfo ,
authGetInfo ,
AuthGetProtectionSpaceMethodInfo ,
authGetProtectionSpace ,
AuthGetRealmMethodInfo ,
authGetRealm ,
AuthGetSavedPasswordMethodInfo ,
authGetSavedPassword ,
AuthGetSavedUsersMethodInfo ,
authGetSavedUsers ,
AuthGetSchemeNameMethodInfo ,
authGetSchemeName ,
AuthHasSavedPasswordMethodInfo ,
authHasSavedPassword ,
AuthIsAuthenticatedMethodInfo ,
authIsAuthenticated ,
AuthIsForProxyMethodInfo ,
authIsForProxy ,
AuthIsReadyMethodInfo ,
authIsReady ,
authNew ,
AuthSavePasswordMethodInfo ,
authSavePassword ,
AuthUpdateMethodInfo ,
authUpdate ,
AuthHostPropertyInfo ,
authHost ,
clearAuthHost ,
constructAuthHost ,
getAuthHost ,
setAuthHost ,
AuthIsAuthenticatedPropertyInfo ,
getAuthIsAuthenticated ,
AuthIsForProxyPropertyInfo ,
constructAuthIsForProxy ,
getAuthIsForProxy ,
setAuthIsForProxy ,
AuthRealmPropertyInfo ,
authRealm ,
clearAuthRealm ,
constructAuthRealm ,
getAuthRealm ,
setAuthRealm ,
AuthSchemeNamePropertyInfo ,
authSchemeName ,
getAuthSchemeName ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Soup.Objects.Message as Soup.Message
import qualified GI.Soup.Structs.URI as Soup.URI
newtype Auth = Auth (ManagedPtr Auth)
foreign import ccall "soup_auth_get_type"
c_soup_auth_get_type :: IO GType
instance GObject Auth where
gobjectType _ = c_soup_auth_get_type
class GObject o => IsAuth o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError Auth a) =>
IsAuth a
#endif
instance IsAuth Auth
instance GObject.Object.IsObject Auth
toAuth :: IsAuth o => o -> IO Auth
toAuth = unsafeCastTo Auth
noAuth :: Maybe Auth
noAuth = Nothing
type family ResolveAuthMethod (t :: Symbol) (o :: *) :: * where
ResolveAuthMethod "authenticate" o = AuthAuthenticateMethodInfo
ResolveAuthMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAuthMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAuthMethod "canAuthenticate" o = AuthCanAuthenticateMethodInfo
ResolveAuthMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAuthMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAuthMethod "hasSavedPassword" o = AuthHasSavedPasswordMethodInfo
ResolveAuthMethod "isAuthenticated" o = AuthIsAuthenticatedMethodInfo
ResolveAuthMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAuthMethod "isForProxy" o = AuthIsForProxyMethodInfo
ResolveAuthMethod "isReady" o = AuthIsReadyMethodInfo
ResolveAuthMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAuthMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAuthMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAuthMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAuthMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveAuthMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveAuthMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAuthMethod "savePassword" o = AuthSavePasswordMethodInfo
ResolveAuthMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAuthMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAuthMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAuthMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAuthMethod "update" o = AuthUpdateMethodInfo
ResolveAuthMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAuthMethod "getAuthorization" o = AuthGetAuthorizationMethodInfo
ResolveAuthMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAuthMethod "getHost" o = AuthGetHostMethodInfo
ResolveAuthMethod "getInfo" o = AuthGetInfoMethodInfo
ResolveAuthMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAuthMethod "getProtectionSpace" o = AuthGetProtectionSpaceMethodInfo
ResolveAuthMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAuthMethod "getRealm" o = AuthGetRealmMethodInfo
ResolveAuthMethod "getSavedPassword" o = AuthGetSavedPasswordMethodInfo
ResolveAuthMethod "getSavedUsers" o = AuthGetSavedUsersMethodInfo
ResolveAuthMethod "getSchemeName" o = AuthGetSchemeNameMethodInfo
ResolveAuthMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAuthMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAuthMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAuthMethod t Auth, O.MethodInfo info Auth p) => O.IsLabelProxy t (Auth -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveAuthMethod t Auth, O.MethodInfo info Auth p) => O.IsLabel t (Auth -> p) where
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
getAuthHost :: (MonadIO m, IsAuth o) => o -> m T.Text
getAuthHost obj = liftIO $ checkUnexpectedNothing "getAuthHost" $ getObjectPropertyString obj "host"
setAuthHost :: (MonadIO m, IsAuth o) => o -> T.Text -> m ()
setAuthHost obj val = liftIO $ setObjectPropertyString obj "host" (Just val)
constructAuthHost :: (IsAuth o) => T.Text -> IO (GValueConstruct o)
constructAuthHost val = constructObjectPropertyString "host" (Just val)
clearAuthHost :: (MonadIO m, IsAuth o) => o -> m ()
clearAuthHost obj = liftIO $ setObjectPropertyString obj "host" (Nothing :: Maybe T.Text)
data AuthHostPropertyInfo
instance AttrInfo AuthHostPropertyInfo where
type AttrAllowedOps AuthHostPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint AuthHostPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint AuthHostPropertyInfo = IsAuth
type AttrGetType AuthHostPropertyInfo = T.Text
type AttrLabel AuthHostPropertyInfo = "host"
type AttrOrigin AuthHostPropertyInfo = Auth
attrGet _ = getAuthHost
attrSet _ = setAuthHost
attrConstruct _ = constructAuthHost
attrClear _ = clearAuthHost
getAuthIsAuthenticated :: (MonadIO m, IsAuth o) => o -> m Bool
getAuthIsAuthenticated obj = liftIO $ getObjectPropertyBool obj "is-authenticated"
data AuthIsAuthenticatedPropertyInfo
instance AttrInfo AuthIsAuthenticatedPropertyInfo where
type AttrAllowedOps AuthIsAuthenticatedPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint AuthIsAuthenticatedPropertyInfo = (~) ()
type AttrBaseTypeConstraint AuthIsAuthenticatedPropertyInfo = IsAuth
type AttrGetType AuthIsAuthenticatedPropertyInfo = Bool
type AttrLabel AuthIsAuthenticatedPropertyInfo = "is-authenticated"
type AttrOrigin AuthIsAuthenticatedPropertyInfo = Auth
attrGet _ = getAuthIsAuthenticated
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
getAuthIsForProxy :: (MonadIO m, IsAuth o) => o -> m Bool
getAuthIsForProxy obj = liftIO $ getObjectPropertyBool obj "is-for-proxy"
setAuthIsForProxy :: (MonadIO m, IsAuth o) => o -> Bool -> m ()
setAuthIsForProxy obj val = liftIO $ setObjectPropertyBool obj "is-for-proxy" val
constructAuthIsForProxy :: (IsAuth o) => Bool -> IO (GValueConstruct o)
constructAuthIsForProxy val = constructObjectPropertyBool "is-for-proxy" val
data AuthIsForProxyPropertyInfo
instance AttrInfo AuthIsForProxyPropertyInfo where
type AttrAllowedOps AuthIsForProxyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint AuthIsForProxyPropertyInfo = (~) Bool
type AttrBaseTypeConstraint AuthIsForProxyPropertyInfo = IsAuth
type AttrGetType AuthIsForProxyPropertyInfo = Bool
type AttrLabel AuthIsForProxyPropertyInfo = "is-for-proxy"
type AttrOrigin AuthIsForProxyPropertyInfo = Auth
attrGet _ = getAuthIsForProxy
attrSet _ = setAuthIsForProxy
attrConstruct _ = constructAuthIsForProxy
attrClear _ = undefined
getAuthRealm :: (MonadIO m, IsAuth o) => o -> m T.Text
getAuthRealm obj = liftIO $ checkUnexpectedNothing "getAuthRealm" $ getObjectPropertyString obj "realm"
setAuthRealm :: (MonadIO m, IsAuth o) => o -> T.Text -> m ()
setAuthRealm obj val = liftIO $ setObjectPropertyString obj "realm" (Just val)
constructAuthRealm :: (IsAuth o) => T.Text -> IO (GValueConstruct o)
constructAuthRealm val = constructObjectPropertyString "realm" (Just val)
clearAuthRealm :: (MonadIO m, IsAuth o) => o -> m ()
clearAuthRealm obj = liftIO $ setObjectPropertyString obj "realm" (Nothing :: Maybe T.Text)
data AuthRealmPropertyInfo
instance AttrInfo AuthRealmPropertyInfo where
type AttrAllowedOps AuthRealmPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint AuthRealmPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint AuthRealmPropertyInfo = IsAuth
type AttrGetType AuthRealmPropertyInfo = T.Text
type AttrLabel AuthRealmPropertyInfo = "realm"
type AttrOrigin AuthRealmPropertyInfo = Auth
attrGet _ = getAuthRealm
attrSet _ = setAuthRealm
attrConstruct _ = constructAuthRealm
attrClear _ = clearAuthRealm
getAuthSchemeName :: (MonadIO m, IsAuth o) => o -> m T.Text
getAuthSchemeName obj = liftIO $ checkUnexpectedNothing "getAuthSchemeName" $ getObjectPropertyString obj "scheme-name"
data AuthSchemeNamePropertyInfo
instance AttrInfo AuthSchemeNamePropertyInfo where
type AttrAllowedOps AuthSchemeNamePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint AuthSchemeNamePropertyInfo = (~) ()
type AttrBaseTypeConstraint AuthSchemeNamePropertyInfo = IsAuth
type AttrGetType AuthSchemeNamePropertyInfo = T.Text
type AttrLabel AuthSchemeNamePropertyInfo = "scheme-name"
type AttrOrigin AuthSchemeNamePropertyInfo = Auth
attrGet _ = getAuthSchemeName
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
instance O.HasAttributeList Auth
type instance O.AttributeList Auth = AuthAttributeList
type AuthAttributeList = ('[ '("host", AuthHostPropertyInfo), '("isAuthenticated", AuthIsAuthenticatedPropertyInfo), '("isForProxy", AuthIsForProxyPropertyInfo), '("realm", AuthRealmPropertyInfo), '("schemeName", AuthSchemeNamePropertyInfo)] :: [(Symbol, *)])
authHost :: AttrLabelProxy "host"
authHost = AttrLabelProxy
authRealm :: AttrLabelProxy "realm"
authRealm = AttrLabelProxy
authSchemeName :: AttrLabelProxy "schemeName"
authSchemeName = AttrLabelProxy
type instance O.SignalList Auth = AuthSignalList
type AuthSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "soup_auth_new" soup_auth_new ::
CGType ->
Ptr Soup.Message.Message ->
CString ->
IO (Ptr Auth)
authNew ::
(B.CallStack.HasCallStack, MonadIO m, Soup.Message.IsMessage a) =>
GType
-> a
-> T.Text
-> m (Maybe Auth)
authNew type_ msg authHeader = liftIO $ do
let type_' = gtypeToCGType type_
msg' <- unsafeManagedPtrCastPtr msg
authHeader' <- textToCString authHeader
result <- soup_auth_new type_' msg' authHeader'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapObject Auth) result'
return result''
touchManagedPtr msg
freeMem authHeader'
return maybeResult
foreign import ccall "soup_auth_authenticate" soup_auth_authenticate ::
Ptr Auth ->
CString ->
CString ->
IO ()
authAuthenticate ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> T.Text
-> T.Text
-> m ()
authAuthenticate auth username password = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
username' <- textToCString username
password' <- textToCString password
soup_auth_authenticate auth' username' password'
touchManagedPtr auth
freeMem username'
freeMem password'
return ()
data AuthAuthenticateMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsAuth a) => O.MethodInfo AuthAuthenticateMethodInfo a signature where
overloadedMethod _ = authAuthenticate
foreign import ccall "soup_auth_can_authenticate" soup_auth_can_authenticate ::
Ptr Auth ->
IO CInt
authCanAuthenticate ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> m Bool
authCanAuthenticate auth = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
result <- soup_auth_can_authenticate auth'
let result' = (/= 0) result
touchManagedPtr auth
return result'
data AuthCanAuthenticateMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAuth a) => O.MethodInfo AuthCanAuthenticateMethodInfo a signature where
overloadedMethod _ = authCanAuthenticate
foreign import ccall "soup_auth_get_authorization" soup_auth_get_authorization ::
Ptr Auth ->
Ptr Soup.Message.Message ->
IO CString
authGetAuthorization ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a, Soup.Message.IsMessage b) =>
a
-> b
-> m T.Text
authGetAuthorization auth msg = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
msg' <- unsafeManagedPtrCastPtr msg
result <- soup_auth_get_authorization auth' msg'
checkUnexpectedReturnNULL "authGetAuthorization" result
result' <- cstringToText result
freeMem result
touchManagedPtr auth
touchManagedPtr msg
return result'
data AuthGetAuthorizationMethodInfo
instance (signature ~ (b -> m T.Text), MonadIO m, IsAuth a, Soup.Message.IsMessage b) => O.MethodInfo AuthGetAuthorizationMethodInfo a signature where
overloadedMethod _ = authGetAuthorization
foreign import ccall "soup_auth_get_host" soup_auth_get_host ::
Ptr Auth ->
IO CString
authGetHost ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> m T.Text
authGetHost auth = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
result <- soup_auth_get_host auth'
checkUnexpectedReturnNULL "authGetHost" result
result' <- cstringToText result
touchManagedPtr auth
return result'
data AuthGetHostMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAuth a) => O.MethodInfo AuthGetHostMethodInfo a signature where
overloadedMethod _ = authGetHost
foreign import ccall "soup_auth_get_info" soup_auth_get_info ::
Ptr Auth ->
IO CString
authGetInfo ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> m T.Text
authGetInfo auth = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
result <- soup_auth_get_info auth'
checkUnexpectedReturnNULL "authGetInfo" result
result' <- cstringToText result
freeMem result
touchManagedPtr auth
return result'
data AuthGetInfoMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAuth a) => O.MethodInfo AuthGetInfoMethodInfo a signature where
overloadedMethod _ = authGetInfo
foreign import ccall "soup_auth_get_protection_space" soup_auth_get_protection_space ::
Ptr Auth ->
Ptr Soup.URI.URI ->
IO (Ptr (GSList CString))
authGetProtectionSpace ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> Soup.URI.URI
-> m [T.Text]
authGetProtectionSpace auth sourceUri = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
sourceUri' <- unsafeManagedPtrGetPtr sourceUri
result <- soup_auth_get_protection_space auth' sourceUri'
result' <- unpackGSList result
result'' <- mapM cstringToText result'
mapGSList freeMem result
g_slist_free result
touchManagedPtr auth
touchManagedPtr sourceUri
return result''
data AuthGetProtectionSpaceMethodInfo
instance (signature ~ (Soup.URI.URI -> m [T.Text]), MonadIO m, IsAuth a) => O.MethodInfo AuthGetProtectionSpaceMethodInfo a signature where
overloadedMethod _ = authGetProtectionSpace
foreign import ccall "soup_auth_get_realm" soup_auth_get_realm ::
Ptr Auth ->
IO CString
authGetRealm ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> m T.Text
authGetRealm auth = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
result <- soup_auth_get_realm auth'
checkUnexpectedReturnNULL "authGetRealm" result
result' <- cstringToText result
touchManagedPtr auth
return result'
data AuthGetRealmMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAuth a) => O.MethodInfo AuthGetRealmMethodInfo a signature where
overloadedMethod _ = authGetRealm
foreign import ccall "soup_auth_get_saved_password" soup_auth_get_saved_password ::
Ptr Auth ->
CString ->
IO CString
authGetSavedPassword ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> T.Text
-> m T.Text
authGetSavedPassword auth user = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
user' <- textToCString user
result <- soup_auth_get_saved_password auth' user'
checkUnexpectedReturnNULL "authGetSavedPassword" result
result' <- cstringToText result
touchManagedPtr auth
freeMem user'
return result'
data AuthGetSavedPasswordMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsAuth a) => O.MethodInfo AuthGetSavedPasswordMethodInfo a signature where
overloadedMethod _ = authGetSavedPassword
foreign import ccall "soup_auth_get_saved_users" soup_auth_get_saved_users ::
Ptr Auth ->
IO (Ptr (GSList CString))
authGetSavedUsers ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> m [T.Text]
authGetSavedUsers auth = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
result <- soup_auth_get_saved_users auth'
result' <- unpackGSList result
result'' <- mapM cstringToText result'
mapGSList freeMem result
g_slist_free result
touchManagedPtr auth
return result''
data AuthGetSavedUsersMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsAuth a) => O.MethodInfo AuthGetSavedUsersMethodInfo a signature where
overloadedMethod _ = authGetSavedUsers
foreign import ccall "soup_auth_get_scheme_name" soup_auth_get_scheme_name ::
Ptr Auth ->
IO CString
authGetSchemeName ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> m T.Text
authGetSchemeName auth = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
result <- soup_auth_get_scheme_name auth'
checkUnexpectedReturnNULL "authGetSchemeName" result
result' <- cstringToText result
touchManagedPtr auth
return result'
data AuthGetSchemeNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAuth a) => O.MethodInfo AuthGetSchemeNameMethodInfo a signature where
overloadedMethod _ = authGetSchemeName
foreign import ccall "soup_auth_has_saved_password" soup_auth_has_saved_password ::
Ptr Auth ->
CString ->
CString ->
IO ()
authHasSavedPassword ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> T.Text
-> T.Text
-> m ()
authHasSavedPassword auth username password = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
username' <- textToCString username
password' <- textToCString password
soup_auth_has_saved_password auth' username' password'
touchManagedPtr auth
freeMem username'
freeMem password'
return ()
data AuthHasSavedPasswordMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsAuth a) => O.MethodInfo AuthHasSavedPasswordMethodInfo a signature where
overloadedMethod _ = authHasSavedPassword
foreign import ccall "soup_auth_is_authenticated" soup_auth_is_authenticated ::
Ptr Auth ->
IO CInt
authIsAuthenticated ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> m Bool
authIsAuthenticated auth = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
result <- soup_auth_is_authenticated auth'
let result' = (/= 0) result
touchManagedPtr auth
return result'
data AuthIsAuthenticatedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAuth a) => O.MethodInfo AuthIsAuthenticatedMethodInfo a signature where
overloadedMethod _ = authIsAuthenticated
foreign import ccall "soup_auth_is_for_proxy" soup_auth_is_for_proxy ::
Ptr Auth ->
IO CInt
authIsForProxy ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> m Bool
authIsForProxy auth = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
result <- soup_auth_is_for_proxy auth'
let result' = (/= 0) result
touchManagedPtr auth
return result'
data AuthIsForProxyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAuth a) => O.MethodInfo AuthIsForProxyMethodInfo a signature where
overloadedMethod _ = authIsForProxy
foreign import ccall "soup_auth_is_ready" soup_auth_is_ready ::
Ptr Auth ->
Ptr Soup.Message.Message ->
IO CInt
authIsReady ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a, Soup.Message.IsMessage b) =>
a
-> b
-> m Bool
authIsReady auth msg = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
msg' <- unsafeManagedPtrCastPtr msg
result <- soup_auth_is_ready auth' msg'
let result' = (/= 0) result
touchManagedPtr auth
touchManagedPtr msg
return result'
data AuthIsReadyMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsAuth a, Soup.Message.IsMessage b) => O.MethodInfo AuthIsReadyMethodInfo a signature where
overloadedMethod _ = authIsReady
foreign import ccall "soup_auth_save_password" soup_auth_save_password ::
Ptr Auth ->
CString ->
CString ->
IO ()
authSavePassword ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a) =>
a
-> T.Text
-> T.Text
-> m ()
authSavePassword auth username password = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
username' <- textToCString username
password' <- textToCString password
soup_auth_save_password auth' username' password'
touchManagedPtr auth
freeMem username'
freeMem password'
return ()
data AuthSavePasswordMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsAuth a) => O.MethodInfo AuthSavePasswordMethodInfo a signature where
overloadedMethod _ = authSavePassword
foreign import ccall "soup_auth_update" soup_auth_update ::
Ptr Auth ->
Ptr Soup.Message.Message ->
CString ->
IO CInt
authUpdate ::
(B.CallStack.HasCallStack, MonadIO m, IsAuth a, Soup.Message.IsMessage b) =>
a
-> b
-> T.Text
-> m Bool
authUpdate auth msg authHeader = liftIO $ do
auth' <- unsafeManagedPtrCastPtr auth
msg' <- unsafeManagedPtrCastPtr msg
authHeader' <- textToCString authHeader
result <- soup_auth_update auth' msg' authHeader'
let result' = (/= 0) result
touchManagedPtr auth
touchManagedPtr msg
freeMem authHeader'
return result'
data AuthUpdateMethodInfo
instance (signature ~ (b -> T.Text -> m Bool), MonadIO m, IsAuth a, Soup.Message.IsMessage b) => O.MethodInfo AuthUpdateMethodInfo a signature where
overloadedMethod _ = authUpdate