Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Keycloak a = ReaderT KCConfig (ExceptT KCError IO) a
- data KCError
- data KCConfig = KCConfig {}
- defaultKCConfig :: KCConfig
- runKeycloak :: Keycloak a -> KCConfig -> IO (Either KCError a)
- type Path = Text
- newtype Token = Token {}
- extractBearerAuth :: ByteString -> Maybe ByteString
- data TokenDec = TokenDec {
- jti :: Text
- exp :: Int
- nbf :: Int
- iat :: Int
- iss :: Text
- aud :: Text
- sub :: Text
- typ :: Text
- azp :: Text
- authTime :: Int
- sessionState :: Text
- acr :: Text
- allowedOrigins :: Value
- realmAccess :: Value
- ressourceAccess :: Value
- scope :: Text
- name :: Text
- preferredUsername :: Text
- givenName :: Text
- familyName :: Text
- email :: Text
- parseTokenDec :: Parse e TokenDec
- type ScopeName = Text
- newtype ScopeId = ScopeId {}
- data Scope = Scope {}
- data Permission = Permission {
- rsname :: ResourceName
- rsid :: ResourceId
- scopes :: [ScopeName]
- type Username = Text
- type Password = Text
- type First = Int
- type Max = Int
- newtype UserId = UserId {}
- data User = User {}
- unCapitalize :: String -> String
- data Owner = Owner {}
- type ResourceName = Text
- newtype ResourceId = ResourceId {}
- data Resource = Resource {
- resId :: Maybe ResourceId
- resName :: ResourceName
- resType :: Maybe Text
- resUris :: [Text]
- resScopes :: [Scope]
- resOwner :: Owner
- resOwnerManagedAccess :: Bool
- resAttributes :: [Attribute]
- data Attribute = Attribute {}
- realm :: Lens' KCConfig Text
- clientSecret :: Lens' KCConfig Text
- clientId :: Lens' KCConfig Text
- baseUrl :: Lens' KCConfig Text
Keycloak Monad
type Keycloak a = ReaderT KCConfig (ExceptT KCError IO) a Source #
Keycloak Monad stack: a simple Reader monad containing the config, and an ExceptT to handle HTTPErrors and parse errors.
Contains HTTP errors and parse errors.
HTTPError HttpException | Keycloak returned an HTTP error. |
ParseError Text | Failed when parsing the response |
EmptyError | Empty error to serve as a zero element for Monoid. |
Configuration of Keycloak.
defaultKCConfig :: KCConfig Source #
Default configuration
runKeycloak :: Keycloak a -> KCConfig -> IO (Either KCError a) Source #
Run a Keycloak monad within IO.
Token
Wrapper for tokens.
Instances
Eq Token Source # | |
Show Token Source # | |
Generic Token Source # | |
FromJSON Token Source # | |
ToHttpApiData Token Source # | |
Defined in Keycloak.Types toUrlPiece :: Token -> Text # toEncodedUrlPiece :: Token -> Builder # toHeader :: Token -> ByteString # toQueryParam :: Token -> Text # | |
FromHttpApiData Token Source # | |
Defined in Keycloak.Types parseUrlPiece :: Text -> Either Text Token # parseHeader :: ByteString -> Either Text Token # | |
type Rep Token Source # | |
Defined in Keycloak.Types type Rep Token = D1 (MetaData "Token" "Keycloak.Types" "keycloak-hs-0.0.0.1-F9imreLY4PkGwETHwAs8YS" True) (C1 (MetaCons "Token" PrefixI True) (S1 (MetaSel (Just "unToken") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString))) |
Token description returned by Keycloak
TokenDec | |
|
Instances
parseTokenDec :: Parse e TokenDec Source #
Permission
Scope Id
Keycloak scope
Instances
Eq Scope Source # | |
Show Scope Source # | |
Generic Scope Source # | |
ToJSON Scope Source # | |
Defined in Keycloak.Types | |
FromJSON Scope Source # | |
type Rep Scope Source # | |
Defined in Keycloak.Types type Rep Scope = D1 (MetaData "Scope" "Keycloak.Types" "keycloak-hs-0.0.0.1-F9imreLY4PkGwETHwAs8YS" False) (C1 (MetaCons "Scope" PrefixI True) (S1 (MetaSel (Just "scopeId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe ScopeId)) :*: S1 (MetaSel (Just "scopeName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ScopeName))) |
data Permission Source #
Keycloak permission on a resource
Permission | |
|
Instances
User
Id of a user
User
User | |
|
Instances
Eq User Source # | |
Show User Source # | |
Generic User Source # | |
ToJSON User Source # | |
Defined in Keycloak.Types | |
FromJSON User Source # | |
type Rep User Source # | |
Defined in Keycloak.Types type Rep User = D1 (MetaData "User" "Keycloak.Types" "keycloak-hs-0.0.0.1-F9imreLY4PkGwETHwAs8YS" False) (C1 (MetaCons "User" PrefixI True) ((S1 (MetaSel (Just "userId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe UserId)) :*: S1 (MetaSel (Just "userUsername") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Username)) :*: (S1 (MetaSel (Just "userFirstName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 (MetaSel (Just "userLastName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "userEmail") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)))))) |
unCapitalize :: String -> String Source #
Owner
A resource owner
Instances
Show Owner Source # | |
Generic Owner Source # | |
ToJSON Owner Source # | |
Defined in Keycloak.Types | |
FromJSON Owner Source # | |
type Rep Owner Source # | |
Defined in Keycloak.Types type Rep Owner = D1 (MetaData "Owner" "Keycloak.Types" "keycloak-hs-0.0.0.1-F9imreLY4PkGwETHwAs8YS" False) (C1 (MetaCons "Owner" PrefixI True) (S1 (MetaSel (Just "ownId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "ownName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Username))) |
Resource
type ResourceName = Text Source #
newtype ResourceId Source #
A resource Id
Instances
A complete resource
Resource | |
|
Instances
A resource attribute
Instances
Show Attribute Source # | |
Generic Attribute Source # | |
ToJSON Attribute Source # | |
Defined in Keycloak.Types | |
FromJSON Attribute Source # | |
type Rep Attribute Source # | |
Defined in Keycloak.Types type Rep Attribute = D1 (MetaData "Attribute" "Keycloak.Types" "keycloak-hs-0.0.0.1-F9imreLY4PkGwETHwAs8YS" False) (C1 (MetaCons "Attribute" PrefixI True) (S1 (MetaSel (Just "attName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "attValues") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Text]))) |