| Copyright | (c) 2015 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay <brendan.g.hay@gmail.com> |
| Stability | provisional |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | None |
| Language | Haskell2010 |
Network.Google.Auth.Scope
Description
Helpers for specifying and using Scopes with Network.Google.
- allow :: proxy s -> k s -> k s
- forbid :: k '[] -> k '[]
- (!) :: proxy xs -> proxy ys -> Proxy (Nub (xs ++ ys))
- type family HasScope (s :: [Symbol]) a :: Constraint where ...
- type family HasScope' s a where ...
- type family a ∈ b where ...
- type family xs ++ ys where ...
- type family Nub xs where ...
- type family Delete x xs where ...
- class AllowScopes a where
- concatScopes :: [OAuthScope] -> Text
- queryEncodeScopes :: [OAuthScope] -> ByteString
Documentation
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.
class AllowScopes a where Source #
Minimal complete definition
Methods
allowScopes :: proxy a -> [OAuthScope] Source #
Obtain a list of supported OAuthScope values from a proxy.
Instances
| AllowScopes [k] ([] k) Source # | |
| AllowScopes [Symbol] s => AllowScopes * (Credentials s) Source # | |
| (KnownSymbol x, AllowScopes [Symbol] xs) => AllowScopes [Symbol] ((:) Symbol x xs) 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.