gogol-0.3.0: Comprehensive Google Services SDK.

Copyright(c) 2015 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.Google.Auth.Scope

Description

Helpers for specifying and using Scopes with Network.Google.

Synopsis

Documentation

allow :: proxy s -> k s -> k s Source #

Annotate credentials with the specified scopes. This exists to allow users to choose between using newEnv with a Proxy constructed by !, or explicitly specifying scopes via a type annotation.

See: !, envScopes, and the scopes available for each service.

forbid :: k '[] -> k '[] Source #

Annotate credentials with no scope authorization.

(!) :: proxy xs -> proxy ys -> Proxy (Nub (xs ++ ys)) Source #

Append two sets of scopes.

See: allow.

type family HasScope (s :: [Symbol]) a :: Constraint where ... Source #

Determine if _any_ of the scopes a request requires is listed in the scopes the credentials supports.

For error message/presentation purposes, this wraps the result of the HasScope membership check to show both lists of scopes before reduction.

Equations

HasScope s a = (s `HasScope'` Scopes a) ~ True 

type family HasScope' s a where ... Source #

Check if any of actual supplied scopes s exist in the required set a. If the required set a is empty, then succeed.

Equations

HasScope' s '[] = True 
HasScope' (x ': xs) a = (x a) || HasScope' xs a 

type family a b where ... Source #

Membership predicate.

Equations

x '[] = False 
x (y ': xs) = (x == y) || (x xs) 

type family xs ++ ys where ... Source #

Append two lists.

Equations

xs ++ '[] = xs 
'[] ++ ys = ys 
(x ': xs) ++ ys = x ': (xs ++ ys) 

type family Nub xs where ... Source #

Remove duplicates from a list.

Equations

Nub '[] = '[] 
Nub (x ': xs) = x ': Nub (Delete x xs) 

type family Delete x xs where ... Source #

Remove a specific element from a list.

Equations

Delete x '[] = '[] 
Delete x (x ': ys) = Delete x ys 
Delete x (y ': ys) = y ': Delete x ys 

class AllowScopes a where Source #

Minimal complete definition

allowScopes

Methods

allowScopes :: proxy a -> [OAuthScope] Source #

Obtain a list of supported OAuthScope values from a proxy.

Instances
AllowScopes ([] :: [k]) Source # 
Instance details

Defined in Network.Google.Auth.Scope

Methods

allowScopes :: proxy [] -> [OAuthScope] Source #

AllowScopes s => AllowScopes (Credentials s :: *) Source # 
Instance details

Defined in Network.Google.Auth.Scope

Methods

allowScopes :: proxy (Credentials s) -> [OAuthScope] Source #

(KnownSymbol x, AllowScopes xs) => AllowScopes (x ': xs :: [Symbol]) Source # 
Instance details

Defined in Network.Google.Auth.Scope

Methods

allowScopes :: proxy (x ': xs) -> [OAuthScope] Source #

concatScopes :: [OAuthScope] -> Text Source #

Concatenate a list of scopes using spaces.

queryEncodeScopes :: [OAuthScope] -> ByteString Source #

Encode a list of scopes suitable for embedding in a query string.