Skip to content

Commit 1fef757

Browse files
committed
changelog
1 parent 329d4da commit 1fef757

File tree

2 files changed

+4
-11
lines changed
  • changelog.d/2-features
  • services/brig/src/Brig/Provider

2 files changed

+4
-11
lines changed

changelog.d/2-features/pr-2207

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The bot API will be blocked if the 2nd factor authentication team feature is enabled.

services/brig/src/Brig/Provider/API.hs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,6 @@ botGetSelfH bot = do
954954

955955
botGetSelf :: BotId -> (Handler r) Public.UserProfile
956956
botGetSelf bot = do
957-
checkAllowed (Just (botUserId bot))
958957
p <- lift $ wrapClient $ User.lookupUser NoPendingInvitations (botUserId bot)
959958
maybe (throwErrorDescriptionType @UserNotFound) (return . (`Public.publicProfile` UserLegalHoldNoConsent)) p
960959

@@ -1043,16 +1042,9 @@ botDeleteSelf bid cid = do
10431042
-- Utilities
10441043

10451044
checkAllowed :: Maybe UserId -> (Handler r) ()
1046-
checkAllowed = \case
1047-
Just userId ->
1048-
whenM (isPasswordChallengeEnabled (Just userId)) $ throwStd accessDenied
1049-
Nothing ->
1050-
whenM (isPasswordChallengeEnabled Nothing) $ throwStd accessDenied
1051-
1052-
isPasswordChallengeEnabled :: Maybe UserId -> (Handler r) Bool
1053-
isPasswordChallengeEnabled mbUserId = do
1054-
status <- lift $ RPC.getTeamFeatureStatusSndFactorPasswordChallenge mbUserId
1055-
pure $ Feature.tfwoStatus status == Feature.TeamFeatureEnabled
1045+
checkAllowed mbUserId = do
1046+
enabled <- lift $ (==) Feature.TeamFeatureEnabled . Feature.tfwoStatus <$> RPC.getTeamFeatureStatusSndFactorPasswordChallenge mbUserId
1047+
when enabled $ throwStd accessDenied
10561048

10571049
minRsaKeySize :: Int
10581050
minRsaKeySize = 256 -- Bytes (= 2048 bits)

0 commit comments

Comments
 (0)