[WPB-21432] app refresh cookie requires password#5129
Conversation
battermann
left a comment
There was a problem hiding this comment.
The swagger docs should to be changed, otherwise good to go.
Approved proforma.
| refreshAppCookie u tid appId mbBody = do | ||
| req <- baseRequest u Brig Versioned $ joinHttpPath ["teams", tid, "apps", appId, "cookies"] | ||
| submit "POST" req | ||
| submit "POST" $ req & maybe id addJSON mbBody |
There was a problem hiding this comment.
This is a super nitpick, but I don't think we need to test the case without the body. That is why we use servant, right?
Ideally I would pass a Maybe String and then put it in the body, if it is Just, otherwise "password": null or empty JSON object.
There was a problem hiding this comment.
i'm confused now, so i'm going to ignore it :)
Co-authored-by: Leif Battermann <leif.battermann@wire.com>
| refreshAppCookie :: (MakesValue u) => u -> String -> String -> Maybe Value -> App Response | ||
| refreshAppCookie u tid appId mbBody = do | ||
| req <- baseRequest u Brig Versioned $ joinHttpPath ["teams", tid, "apps", appId, "cookies"] | ||
| submit "POST" req | ||
| submit "POST" $ req & maybe id addJSON mbBody |
There was a problem hiding this comment.
I meant something along these lines:
| refreshAppCookie :: (MakesValue u) => u -> String -> String -> Maybe Value -> App Response | |
| refreshAppCookie u tid appId mbBody = do | |
| req <- baseRequest u Brig Versioned $ joinHttpPath ["teams", tid, "apps", appId, "cookies"] | |
| submit "POST" req | |
| submit "POST" $ req & maybe id addJSON mbBody | |
| refreshAppCookie :: (MakesValue u) => u -> String -> String -> Maybe String -> App Response | |
| refreshAppCookie u tid appId mPassword = do | |
| req <- baseRequest u Brig Versioned $ joinHttpPath ["teams", tid, "apps", appId, "cookies"] | |
| submit "POST" $ req & addJSONObject ["password" .= maybe Aeson.Null Aeson.encode mPassword ] |
There was a problem hiding this comment.
hum, maybe i'm not confused but opposed? i had it this way before, but wanted to be more flexible in what we send, to test more corner cases.
thanks, but still ignoring you :)
Checklist
changelog.d