Skip to content

Commit

Permalink
Fix: /i/user/meta-info (stern) (#3281)
Browse files Browse the repository at this point in the history
  • Loading branch information
battermann committed May 10, 2023
1 parent 2ad4204 commit a89af51
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/3-bug-fixes/pr-3281
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed `/i/user/meta-info` in backoffice/stern
2 changes: 1 addition & 1 deletion tools/stern/src/Stern/Intra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ getUserProperties uid = do
b
( method GET
. header "Z-User" (toByteString' uid)
. versionedPaths ["/properties", toByteString' x]
. versionedPaths ["properties", toByteString' x]
. expect2xx
)
info $ msg ("Response" ++ show r)
Expand Down
10 changes: 9 additions & 1 deletion tools/stern/test/integration/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import Bilge.Assert
import Brig.Types.Intra
import Control.Applicative
import Control.Lens hiding ((.=))
import Data.Aeson (ToJSON)
import Data.Aeson (ToJSON, Value)
import Data.ByteString.Conversion
import Data.Handle
import Data.Id
Expand All @@ -42,6 +42,7 @@ import Test.Tasty
import Test.Tasty.HUnit
import TestSetup
import Util
import Wire.API.Properties (PropertyKey)
import Wire.API.Routes.Internal.Brig.Connection
import qualified Wire.API.Routes.Internal.Brig.EJPD as EJPD
import Wire.API.Routes.Internal.Galley.TeamsIntra (tdStatus)
Expand Down Expand Up @@ -116,6 +117,8 @@ testSearchVisibility = do
testGetUserMetaInfo :: TestM ()
testGetUserMetaInfo = do
uid <- randomUser
let k = fromMaybe (error "invalid property key") $ fromByteString "WIRE_RECEIPT_MODE"
putUserProperty uid k "bar"
-- Just make sure this returns a 200
void $ getUserMetaInfo uid

Expand Down Expand Up @@ -615,3 +618,8 @@ unlockFeature ::
unlockFeature tid = do
g <- view tsGalley
void $ put (g . paths ["i", "teams", toByteString' tid, "features", Public.featureNameBS @cfg, "unlocked"] . expect2xx)

putUserProperty :: UserId -> PropertyKey -> Value -> TestM ()
putUserProperty uid k v = do
b <- view tsBrig
void $ put (b . paths ["properties", toByteString' k] . json v . zUser uid . zConn "123" . expect2xx)

0 comments on commit a89af51

Please sign in to comment.