-
Notifications
You must be signed in to change notification settings - Fork 332
WPB-1906 - Unverified users can no longer create assets #3604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e59d409
WPB-1906: Check if a user is verified when uploading assets
lepsa 6f694f1
Merge remote-tracking branch 'origin/develop' into WPB-1906
lepsa b3450d9
Merge remote-tracking branch 'origin/develop' into WPB-1906
lepsa 88d793d
Merge remote-tracking branch 'origin/develop' into WPB-1906
lepsa ced9d7a
WPB-1906: Trying to fix test errors, some of which may be from develop
lepsa dd43650
Merge remote-tracking branch 'origin/develop' into WPB-1906
lepsa 89879d2
Merge remote-tracking branch 'origin/develop' into WPB-1906
lepsa 0533ea9
Adding the changelog
lepsa 20ccc85
WPB-1906: Removing changes to a test since upstream has fixed it.
lepsa 2fbf174
WPB-1906: Adding a test for upload failure
lepsa 8f1f895
WPB-1906: Updating more cargohold test config
lepsa 370bf53
Merge remote-tracking branch 'origin/develop' into WPB-1906
lepsa ed50166
Update libs/wire-api/src/Wire/API/Error/Cargohold.hs
lepsa 3f6b87a
WPB-1906: PR feedback
lepsa ed0f05f
Merge remote-tracking branch 'lepsa/WPB-1906' into WPB-1906
lepsa b45e22a
Merge remote-tracking branch 'origin/develop' into WPB-1906
lepsa 1803dc5
WPB-1906: Adding an additional test for unknown users
lepsa 998cf50
WPB-1906: Updates from PR comments
lepsa 6b28938
Merge remote-tracking branch 'origin/develop' into WPB-1906
lepsa 5ad4072
WPB-1906: Updating based on jira updates
lepsa 9a03264
Merge remote-tracking branch 'origin/develop' into WPB-1906
akshaymankar bd92409
Add futurework
akshaymankar 3a80b87
Better var names
akshaymankar 5ff5838
wire-api: Expose servant based brig-internal client
akshaymankar ecfb3a0
carghold: Use brig internal client from wire-api
akshaymankar b7ca2ca
WPB-1906: Fixing small compile errors around imports
lepsa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Un-verified users can no longer upload assets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| module Test.AssetUpload where | ||
|
|
||
| import API.BrigInternal | ||
| import API.Cargohold | ||
| import SetupHelpers | ||
| import Testlib.Prelude | ||
|
|
||
| testAssetUploadUnverifiedUser :: HasCallStack => App () | ||
| testAssetUploadUnverifiedUser = do | ||
| user <- randomUser OwnDomain $ def {activate = False} | ||
| bindResponse (uploadAsset user) $ \resp -> do | ||
| resp.status `shouldMatchInt` 403 | ||
|
|
||
| testAssetUploadVerifiedUser :: HasCallStack => App () | ||
| testAssetUploadVerifiedUser = do | ||
| user <- randomUser OwnDomain def | ||
| bindResponse (uploadAsset user) $ \resp -> do | ||
| resp.status `shouldMatchInt` 201 | ||
|
|
||
| testAssetUploadUnknownUser :: HasCallStack => App () | ||
| testAssetUploadUnknownUser = do | ||
| uid <- randomId | ||
| domain <- make OwnDomain | ||
| let user = | ||
| object | ||
| [ "id" .= uid, | ||
| "qualified_id" | ||
| .= object | ||
| [ "domain" .= domain, | ||
| "id" .= uid | ||
| ] | ||
| ] | ||
| bindResponse (uploadAsset user) $ \resp -> do | ||
| resp.status `shouldMatchInt` 403 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -273,6 +273,7 @@ library | |
| , hscim | ||
| , HsOpenSSL | ||
| , http-api-data | ||
| , http-client | ||
| , http-media | ||
| , http-types | ||
| , imports | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.