Register and Update OAuth client via Stern/Backoffice#3305
Register and Update OAuth client via Stern/Backoffice#3305battermann merged 3 commits intodevelopfrom
Conversation
integration/test/API/BrigInternal.hs
Outdated
| req <- baseRequest user Brig Unversioned $ "i/oauth/clients/" <> clientId | ||
| applicationName <- asString name | ||
| redirectUrl <- asString url | ||
| submit "POST" (req & addJSONObject ["application_name" .= applicationName, "redirect_url" .= redirectUrl]) |
There was a problem hiding this comment.
Yes, I guess you are right. :)
tools/stern/src/Stern/Intra.hs
Outdated
| case statusCode r of | ||
| 200 -> parseResponse (mkError status502 "bad-upstream") r | ||
| 404 -> throwE (mkError status404 "bad-upstream" "not-found") | ||
| _ -> throwE (mkError status502 "bad-upstream" "") |
There was a problem hiding this comment.
| _ -> throwE (mkError status502 "bad-upstream" "") | |
| _ -> throwE (mkError status502 "bad-upstream" (show r)) |
(not tested; not that important, but might save some time if it breaks.)
| test s "GET i/user/meta-info?id=..." testGetUserMetaInfo, | ||
| test s "/teams/:tid/search-visibility" testSearchVisibility | ||
| test s "/teams/:tid/search-visibility" testSearchVisibility, | ||
| test s "i/oauth/clients" testCrudOAuthClient |
There was a problem hiding this comment.
why the /i? stern doesn't have any public-facing api, so the distinction doesn't really work here i think.
There was a problem hiding this comment.
I've seen it on other stern endpoints, too, so I adapted it. I guess, it just serves as a marker to make it obvious that this is calling an internal endpoint. Should I remove it?
There was a problem hiding this comment.
when i complained about this i thought this was the only end-point in stern with an /i, and that stern is only calling internal end-points. both assumptions may be wrong. use your own judgement, if it's consistent with what stern does everywhere, keep it.
There was a problem hiding this comment.
ah, i see i'm a bit late. :) either way it's not a big deal.
| ] | ||
|
|
||
| testCrudOAuthClient :: TestM () | ||
| testCrudOAuthClient = do |
There was a problem hiding this comment.
i won't insist, but maybe add new stern tests to /integration as well in the future? it's also good to save time, though...
There was a problem hiding this comment.
Yes, good point. Now the work is done. Let's keep it for now.
Checklist
changelog.d