Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
This module contains several categories of SCIM-related types:
- Extensions for
hscim
types (likeScimUserExtra
). - Our wrappers over
hscim
types (likeValidScimUser
). - Servant-based API types.
- Request and response types for SCIM-related endpoints.
Synopsis
- userSchemas :: [Schema]
- newtype ScimToken = ScimToken {}
- newtype ScimTokenHash = ScimTokenHash {}
- data ScimTokenLookupKey
- hashScimToken :: ScimToken -> ScimTokenHash
- data ScimTokenInfo = ScimTokenInfo {}
- data SparTag
- newtype WrappedScimStoredUser tag = WrappedScimStoredUser {}
- newtype WrappedScimUser tag = WrappedScimUser {
- fromWrappedScimUser :: User tag
- data ScimUserExtra = ScimUserExtra {}
- sueRichInfo :: Iso' ScimUserExtra RichInfo
- data ValidScimUser = ValidScimUser {}
- data ValidScimId = ValidScimId {}
- newtype ValidScimIdNoNameIDQualifiers = ValidScimIdNoNameIDQualifiers ValidScimId
- arbitraryValidScimIdNoNameIDQualifiers :: Gen ValidScimId
- veidUref :: ValidScimId -> Maybe UserRef
- data CreateScimToken = CreateScimToken {}
- data CreateScimTokenResponse = CreateScimTokenResponse {}
- data ScimTokenList = ScimTokenList {}
Documentation
userSchemas :: [Schema] Source #
docs/reference/provisioning/scim-token.md {#RefScimToken}
A bearer token that authorizes a provisioning tool to perform actions with a team. Each token corresponds to one team.
For SCIM authentication and token handling logic, see Spar.Scim.Auth.
Instances
FromJSON ScimToken Source # | |
ToJSON ScimToken Source # | |
Show ScimToken Source # | |
FromByteString ScimToken Source # | |
Defined in Wire.API.User.Scim | |
ToByteString ScimToken Source # | |
Eq ScimToken Source # | |
Ord ScimToken Source # | |
Defined in Wire.API.User.Scim | |
FromHttpApiData ScimToken Source # | |
Defined in Wire.API.User.Scim | |
ToHttpApiData ScimToken Source # | |
Defined in Wire.API.User.Scim toUrlPiece :: ScimToken -> Text Source # toEncodedUrlPiece :: ScimToken -> Builder Source # toHeader :: ScimToken -> ByteString Source # toQueryParam :: ScimToken -> Text Source # | |
ToParamSchema ScimToken Source # | |
Defined in Wire.API.User.Scim | |
ToSchema ScimToken Source # | |
Defined in Wire.API.User.Scim |
newtype ScimTokenHash Source #
Instances
Show ScimTokenHash Source # | |
Defined in Wire.API.User.Scim showsPrec :: Int -> ScimTokenHash -> ShowS # show :: ScimTokenHash -> String # showList :: [ScimTokenHash] -> ShowS # | |
FromByteString ScimTokenHash Source # | |
Defined in Wire.API.User.Scim parser :: Parser ScimTokenHash Source # | |
ToByteString ScimTokenHash Source # | |
Defined in Wire.API.User.Scim builder :: ScimTokenHash -> Builder Source # | |
Eq ScimTokenHash Source # | |
Defined in Wire.API.User.Scim (==) :: ScimTokenHash -> ScimTokenHash -> Bool # (/=) :: ScimTokenHash -> ScimTokenHash -> Bool # |
data ScimTokenLookupKey Source #
Instances
Show ScimTokenLookupKey Source # | |
Defined in Wire.API.User.Scim showsPrec :: Int -> ScimTokenLookupKey -> ShowS # show :: ScimTokenLookupKey -> String # showList :: [ScimTokenLookupKey] -> ShowS # | |
Eq ScimTokenLookupKey Source # | |
Defined in Wire.API.User.Scim (==) :: ScimTokenLookupKey -> ScimTokenLookupKey -> Bool # (/=) :: ScimTokenLookupKey -> ScimTokenLookupKey -> Bool # |
data ScimTokenInfo Source #
Metadata that we store about each token.
ScimTokenInfo | |
|
Instances
FromJSON ScimTokenInfo Source # | |
Defined in Wire.API.User.Scim parseJSON :: Value -> Parser ScimTokenInfo Source # parseJSONList :: Value -> Parser [ScimTokenInfo] Source # | |
ToJSON ScimTokenInfo Source # | |
Defined in Wire.API.User.Scim toJSON :: ScimTokenInfo -> Value Source # toEncoding :: ScimTokenInfo -> Encoding Source # toJSONList :: [ScimTokenInfo] -> Value Source # toEncodingList :: [ScimTokenInfo] -> Encoding Source # | |
Show ScimTokenInfo Source # | |
Defined in Wire.API.User.Scim showsPrec :: Int -> ScimTokenInfo -> ShowS # show :: ScimTokenInfo -> String # showList :: [ScimTokenInfo] -> ShowS # | |
Eq ScimTokenInfo Source # | |
Defined in Wire.API.User.Scim (==) :: ScimTokenInfo -> ScimTokenInfo -> Bool # (/=) :: ScimTokenInfo -> ScimTokenInfo -> Bool # | |
ToSchema ScimTokenInfo Source # | |
Defined in Wire.API.User.Scim |
Instances
AuthTypes SparTag Source # | |
GroupTypes SparTag Source # | |
Defined in Wire.API.User.Scim | |
UserTypes SparTag Source # | |
Arbitrary (User SparTag) Source # | |
type AuthData SparTag Source # | |
Defined in Wire.API.User.Scim | |
type AuthInfo SparTag Source # | |
Defined in Wire.API.User.Scim | |
type GroupId SparTag Source # | |
Defined in Wire.API.User.Scim | |
type UserExtra SparTag Source # | |
Defined in Wire.API.User.Scim | |
type UserId SparTag Source # | |
Defined in Wire.API.User.Scim |
newtype WrappedScimStoredUser tag Source #
Wrapper to work around complications with type synonym family application in instances.
Background: SparTag
is used to instantiate the open type families in the classes
Scim.UserTypes
, Scim.GroupTypes
, Scim.AuthTypes
. Those type families are not
injective, and in general they shouldn't be: it should be possible to map two tags to
different user ids, but the same extra user info. This makes the type of the Cql
instance for
undecidable: if the type checker encounters a
constraint that gives it the user id and extra info, it can't compute the tag from that to
look up the instance.StoredUser
tag
Possible solutions:
- what we're doing here: wrap the type synonyms we can't instantiate into newtypes in the code using hscim.
- do not instantiate the type synonym, but its value (in this case
Web.Scim.Schema.Meta.WithMeta (Web.Scim.Schema.Common.WithId (Id U) (Scim.User tag))
- Use newtypes instead type in hscim. This will carry around the tag as a data type rather
than applying it, which in turn will enable ghc to type-check instances like
Cql (Scim.StoredUser tag)
. - make the type classes parametric in not only the tag, but also all the values of the type
families, and add functional dependencies, like this:
class UserInfo tag uid extrainfo | (uid, extrainfo) -> tag, tag -> (uid, extrainfo)
. this will make writing the instances only a little more awkward, but the rest of the code should change very little, as long as we just apply the type families rather than explicitly imposing the class constraints. - given a lot of time: extend ghc with something vaguely similar to
AllowAmbigiousTypes
, where the instance typechecks, and non-injectivity errors are raised when checking the constraint that "calls" the instance. :)
newtype WrappedScimUser tag Source #
data ScimUserExtra Source #
Extra Wire-specific data contained in a SCIM user profile.
Instances
data ValidScimUser Source #
SCIM user with all the data spar is actively processing. Constructed by
validateScimUser
, or manually from data obtained from brig to pass them on to scim peers.
The idea is that the type we get back from hscim is too general, and
we need a second round of parsing (aka validation), of which ValidScimUser
is the result.
Data contained in _vsuHandle
and _vsuName
is guaranteed to a) correspond to the data in
the User
and b) be valid in regard to our own user schema requirements (only
certain characters allowed in handles, etc).
Note that it's ok for us to ignore parts of the content sent to us, as explained here: "Since the server is free to alter and/or ignore POSTed content, returning the full representation can be useful to the client, enabling it to correlate the client's and server's views of the new resource."
Instances
Show ValidScimUser Source # | |
Defined in Wire.API.User.Scim showsPrec :: Int -> ValidScimUser -> ShowS # show :: ValidScimUser -> String # showList :: [ValidScimUser] -> ShowS # | |
Eq ValidScimUser Source # | |
Defined in Wire.API.User.Scim (==) :: ValidScimUser -> ValidScimUser -> Bool # (/=) :: ValidScimUser -> ValidScimUser -> Bool # |
data ValidScimId Source #
This type carries externalId, plus email address (validated if present, unvalidated if not) and saml credentials, because those are sometimes derived from the externalId field.
Instances
newtype ValidScimIdNoNameIDQualifiers Source #
Instances
data CreateScimToken Source #
Type used for request parameters to APIScimTokenCreate
.
CreateScimToken | |
|
Instances
data CreateScimTokenResponse Source #
Type used for the response of APIScimTokenCreate
.
Instances
FromJSON CreateScimTokenResponse Source # | |
Defined in Wire.API.User.Scim | |
ToJSON CreateScimTokenResponse Source # | |
Defined in Wire.API.User.Scim | |
Show CreateScimTokenResponse Source # | |
Defined in Wire.API.User.Scim showsPrec :: Int -> CreateScimTokenResponse -> ShowS # show :: CreateScimTokenResponse -> String # showList :: [CreateScimTokenResponse] -> ShowS # | |
Eq CreateScimTokenResponse Source # | |
Defined in Wire.API.User.Scim | |
ToSchema CreateScimTokenResponse Source # | |
Defined in Wire.API.User.Scim |
data ScimTokenList Source #
Type used for responses of endpoints that return a list of SCIM tokens. Wrapped into an object to allow extensibility later on.
We don't show tokens once they have been created – only their metadata.
Instances
FromJSON ScimTokenList Source # | |
Defined in Wire.API.User.Scim parseJSON :: Value -> Parser ScimTokenList Source # parseJSONList :: Value -> Parser [ScimTokenList] Source # | |
ToJSON ScimTokenList Source # | |
Defined in Wire.API.User.Scim toJSON :: ScimTokenList -> Value Source # toEncoding :: ScimTokenList -> Encoding Source # toJSONList :: [ScimTokenList] -> Value Source # toEncodingList :: [ScimTokenList] -> Encoding Source # | |
Show ScimTokenList Source # | |
Defined in Wire.API.User.Scim showsPrec :: Int -> ScimTokenList -> ShowS # show :: ScimTokenList -> String # showList :: [ScimTokenList] -> ShowS # | |
Eq ScimTokenList Source # | |
Defined in Wire.API.User.Scim (==) :: ScimTokenList -> ScimTokenList -> Bool # (/=) :: ScimTokenList -> ScimTokenList -> Bool # | |
ToSchema ScimTokenList Source # | |
Defined in Wire.API.User.Scim |