File tree Expand file tree Collapse file tree 8 files changed +10
-9
lines changed
test-integration/Test/Spar Expand file tree Collapse file tree 8 files changed +10
-9
lines changed Original file line number Diff line number Diff line change
1
+ Rename Spar.Sem.ScimTokenStore.GetByTeam to LookupByTeam
Original file line number Diff line number Diff line change @@ -473,7 +473,7 @@ idpDelete zusr idpid (fromMaybe False -> purge) = withDebugLog "idpDelete" (cons
473
473
-- Delete tokens associated with given IdP (we rely on the fact that
474
474
-- each IdP has exactly one team so we can look up all tokens
475
475
-- associated with the team and then filter them)
476
- tokens <- ScimTokenStore. getByTeam team
476
+ tokens <- ScimTokenStore. lookupByTeam team
477
477
for_ tokens $ \ ScimTokenInfo {.. } ->
478
478
when (stiIdP == Just idpid) $ ScimTokenStore. delete team stiId
479
479
-- Delete IdP config
@@ -565,7 +565,7 @@ assertNoScimOrNoIdP ::
565
565
TeamId ->
566
566
Sem r ()
567
567
assertNoScimOrNoIdP teamid = do
568
- numTokens <- length <$> ScimTokenStore. getByTeam teamid
568
+ numTokens <- length <$> ScimTokenStore. lookupByTeam teamid
569
569
numIdps <- length <$> IdPEffect. getConfigsByTeam teamid
570
570
when (numTokens > 0 && numIdps > 0 ) $ do
571
571
throwSparSem $
Original file line number Diff line number Diff line change @@ -294,7 +294,7 @@ autoprovisionSamlUserWithId mbteam buid suid = do
294
294
guardScimTokens :: IdP -> Sem r ()
295
295
guardScimTokens idp = do
296
296
let teamid = idp ^. idpExtraInfo . wiTeam
297
- scimtoks <- ScimTokenStore. getByTeam teamid
297
+ scimtoks <- ScimTokenStore. lookupByTeam teamid
298
298
unless (null scimtoks) $ do
299
299
throwSparSem SparSamlCredentialsNotFound
300
300
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ createScimToken zusr CreateScimToken {..} = do
128
128
let descr = createScimTokenDescr
129
129
teamid <- Intra.Brig. authorizeScimTokenManagement zusr
130
130
BrigAccess. ensureReAuthorised zusr createScimTokenPassword
131
- tokenNumber <- fmap length $ ScimTokenStore. getByTeam teamid
131
+ tokenNumber <- fmap length $ ScimTokenStore. lookupByTeam teamid
132
132
maxTokens <- inputs maxScimTokens
133
133
unless (tokenNumber < maxTokens) $
134
134
throwSparSem E. SparProvisioningTokenLimitReached
@@ -190,4 +190,4 @@ listScimTokens ::
190
190
Sem r ScimTokenList
191
191
listScimTokens zusr = do
192
192
teamid <- Intra.Brig. authorizeScimTokenManagement zusr
193
- ScimTokenList <$> ScimTokenStore. getByTeam teamid
193
+ ScimTokenList <$> ScimTokenStore. lookupByTeam teamid
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import Wire.API.User.Scim
25
25
data ScimTokenStore m a where
26
26
Insert :: ScimToken -> ScimTokenInfo -> ScimTokenStore m ()
27
27
Lookup :: ScimToken -> ScimTokenStore m (Maybe ScimTokenInfo )
28
- GetByTeam :: TeamId -> ScimTokenStore m [ScimTokenInfo ]
28
+ LookupByTeam :: TeamId -> ScimTokenStore m [ScimTokenInfo ]
29
29
Delete :: TeamId -> ScimTokenId -> ScimTokenStore m ()
30
30
DeleteByTeam :: TeamId -> ScimTokenStore m ()
31
31
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ scimTokenStoreToCassandra =
45
45
embed @ m . \ case
46
46
Insert st sti -> insertScimToken st sti
47
47
Lookup st -> lookupScimToken st
48
- GetByTeam tid -> getScimTokens tid
48
+ LookupByTeam tid -> getScimTokens tid
49
49
Delete tid ur -> deleteScimToken tid ur
50
50
DeleteByTeam tid -> deleteTeamScimTokens tid
51
51
Original file line number Diff line number Diff line change @@ -33,6 +33,6 @@ scimTokenStoreToMem = (runState mempty .) $
33
33
reinterpret $ \ case
34
34
Insert st sti -> modify $ M. insert st sti
35
35
Lookup st -> gets $ M. lookup st
36
- GetByTeam tid -> gets $ filter ((== tid) . stiTeam) . M. elems
36
+ LookupByTeam tid -> gets $ filter ((== tid) . stiTeam) . M. elems
37
37
Delete tid stid -> modify $ M. filter $ \ sti -> not $ stiTeam sti == tid && stiId sti == stid
38
38
DeleteByTeam tid -> modify $ M. filter (not . (== tid) . stiTeam)
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ testDeleteTeam = it "cleans up all the right tables after deletion" $ do
285
285
liftIO $ tokenInfo `shouldBe` Nothing
286
286
-- The team from 'team_provisioning_by_team':
287
287
do
288
- tokens <- runSpar $ ScimTokenStore. getByTeam tid
288
+ tokens <- runSpar $ ScimTokenStore. lookupByTeam tid
289
289
liftIO $ tokens `shouldBe` []
290
290
-- The users from 'user':
291
291
do
You can’t perform that action at this time.
0 commit comments