Safe Haskell | None |
---|---|
Language | Haskell2010 |
LdapScimBridge
Contents
Synopsis
- data LdapConf = LdapConf {}
- data LdapFilterAttr = LdapFilterAttr {}
- data LdapSearch = LdapSearch {}
- data Codec
- data ScimConf = ScimConf {}
- data BridgeConf = BridgeConf {
- ldapSource :: LdapConf
- scimTarget :: ScimConf
- mapping :: Mapping
- logLevel :: Level
- data MappingError
- data FieldMapping = FieldMapping {
- fieldMappingLabel :: Text
- fieldMappingFun :: [Text] -> Either MappingError (User ScimTag -> User ScimTag)
- data ScimTag
- newtype Mapping = Mapping {
- fromMapping :: Map Text [FieldMapping]
- type LdapResult a = IO (Either LdapError a)
- ldapObjectClassFilter :: Text -> Filter
- listLdapUsers :: LdapConf -> LdapSearch -> LdapResult [SearchEntry]
- type User = User ScimTag
- type StoredUser = StoredUser ScimTag
- emptyScimUser :: User
- scimSchemas :: [Schema]
- ldapToScim :: forall m. m ~ Either [(SearchEntry, MappingError)] => BridgeConf -> SearchEntry -> m (SearchEntry, User)
- connectScim :: ScimConf -> IO ClientEnv
- isDeletee :: LdapConf -> SearchEntry -> Bool
- updateScimPeer :: Logger -> BridgeConf -> IO ()
- lookupScimByExternalId :: ClientEnv -> Maybe Text -> User tag -> IO (Maybe StoredUser)
- updateScimPeerPostPut :: Logger -> ClientEnv -> Maybe (AuthData ScimTag) -> [User] -> IO ()
- updateScimPeerPostPutStep :: Logger -> ClientEnv -> Maybe Text -> User ScimTag -> Text -> IO ()
- updateScimPeerDelete :: Logger -> ClientEnv -> Maybe (AuthData ScimTag) -> [User] -> IO ()
- parseCli :: IO BridgeConf
- type Logger = Level -> Text -> IO ()
- mkLogger :: Level -> IO Logger
- main :: IO ()
Documentation
Constructors
LdapConf | |
Fields
|
data LdapFilterAttr Source #
Constructors
LdapFilterAttr | |
Instances
data LdapSearch Source #
Constructors
LdapSearch | |
Fields
|
Instances
Eq LdapSearch Source # | |
Defined in LdapScimBridge | |
Show LdapSearch Source # | |
Defined in LdapScimBridge Methods showsPrec :: Int -> LdapSearch -> ShowS # show :: LdapSearch -> String # showList :: [LdapSearch] -> ShowS # | |
FromJSON LdapSearch Source # | |
Defined in LdapScimBridge |
Constructors
ScimConf | |
Instances
Eq ScimConf Source # | |
Show ScimConf Source # | |
Generic ScimConf Source # | |
FromJSON ScimConf Source # | |
type Rep ScimConf Source # | |
Defined in LdapScimBridge type Rep ScimConf = D1 ('MetaData "ScimConf" "LdapScimBridge" "ldap-scim-bridge-0.2-GV14XU05MY9FCriiy4lrB" 'False) (C1 ('MetaCons "ScimConf" 'PrefixI 'True) ((S1 ('MetaSel ('Just "scimTls") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "scimHost") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :*: (S1 ('MetaSel ('Just "scimPort") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: (S1 ('MetaSel ('Just "scimPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "scimToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))) |
data BridgeConf Source #
Constructors
BridgeConf | |
Fields
|
Instances
Generic BridgeConf Source # | |
Defined in LdapScimBridge Associated Types type Rep BridgeConf :: Type -> Type # | |
FromJSON BridgeConf Source # | |
Defined in LdapScimBridge | |
type Rep BridgeConf Source # | |
Defined in LdapScimBridge type Rep BridgeConf = D1 ('MetaData "BridgeConf" "LdapScimBridge" "ldap-scim-bridge-0.2-GV14XU05MY9FCriiy4lrB" 'False) (C1 ('MetaCons "BridgeConf" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ldapSource") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LdapConf) :*: S1 ('MetaSel ('Just "scimTarget") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ScimConf)) :*: (S1 ('MetaSel ('Just "mapping") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Mapping) :*: S1 ('MetaSel ('Just "logLevel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Level)))) |
data MappingError Source #
Constructors
MissingAttr Text | |
WrongNumberOfAttrValues Text String Int | |
CouldNotParseEmail Text String |
Instances
Eq MappingError Source # | |
Defined in LdapScimBridge | |
Show MappingError Source # | |
Defined in LdapScimBridge Methods showsPrec :: Int -> MappingError -> ShowS # show :: MappingError -> String # showList :: [MappingError] -> ShowS # |
data FieldMapping Source #
Constructors
FieldMapping | |
Fields
|
Instances
Show FieldMapping Source # | |
Defined in LdapScimBridge Methods showsPrec :: Int -> FieldMapping -> ShowS # show :: FieldMapping -> String # showList :: [FieldMapping] -> ShowS # |
Instances
UserTypes ScimTag Source # | |
Defined in LdapScimBridge Methods supportedSchemas :: [Schema] # | |
GroupTypes ScimTag Source # | |
Defined in LdapScimBridge | |
AuthTypes ScimTag Source # | |
type UserExtra ScimTag Source # | |
Defined in LdapScimBridge | |
type UserId ScimTag Source # | |
Defined in LdapScimBridge | |
type GroupId ScimTag Source # | |
Defined in LdapScimBridge | |
type AuthInfo ScimTag Source # | |
Defined in LdapScimBridge | |
type AuthData ScimTag Source # | |
Defined in LdapScimBridge |
Map attribute keys to functions from attribute values to changes to scim records. We'll start off with an empty scim record, and change it based on attributes we find that are listed in the mapping. Mappigns can fail, eg. if there is more than one attribute value for the attribute mapping to externalId.
Constructors
Mapping | |
Fields
|
Instances
ldapObjectClassFilter :: Text -> Filter Source #
listLdapUsers :: LdapConf -> LdapSearch -> LdapResult [SearchEntry] Source #
type StoredUser = StoredUser ScimTag Source #
emptyScimUser :: User Source #
the undefined
is ok, the mapping is guaranteed to contain a filler for this, or the
mapping parser would have failed.
scimSchemas :: [Schema] Source #
ldapToScim :: forall m. m ~ Either [(SearchEntry, MappingError)] => BridgeConf -> SearchEntry -> m (SearchEntry, User) Source #
updateScimPeer :: Logger -> BridgeConf -> IO () Source #
lookupScimByExternalId :: ClientEnv -> Maybe Text -> User tag -> IO (Maybe StoredUser) Source #
updateScimPeerPostPut :: Logger -> ClientEnv -> Maybe (AuthData ScimTag) -> [User] -> IO () Source #
updateScimPeerPostPutStep :: Logger -> ClientEnv -> Maybe Text -> User ScimTag -> Text -> IO () Source #
parseCli :: IO BridgeConf Source #