-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Add /users
tests for user management backend
#2790
Merged
ivov
merged 71 commits into
user-management-backend
from
n8n-2741-tests-for-users-namespace
Feb 15, 2022
Merged
Changes from all commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
5ae6b3f
:zap: Refactor users namespace
ivov eadbec0
:zap: Adjust fillout endpoint
ivov ba9a7ad
:zap: Refactor initTestServer arg
ivov 4d17eb8
:pencil2: Specify agent type
ivov b251fe0
:pencil2: Specify role type
ivov a7b74db
:zap: Tighten `/users/:id` check
ivov ccea112
:sparkles: Add initial tests
ivov 381f111
:truck: Reposition init server map
ivov 27d2393
:zap: Set constants in `validatePassword()`
ivov 4d613e7
:zap: Tighten `/users/:id` check
ivov 9b55b2e
:zap: Improve checks in `/users/:id`
ivov 3e65857
:sparkles: Add tests for `/users/:id`
ivov 03cba0e
:package: Update package-lock.json
ivov 9d6a47e
:zap: Simplify expectation
ivov 1e0b94f
:zap: Reuse util for authless agent
ivov 218f085
:truck: Make role names consistent
ivov ce93c66
:blue_book: Tighten namespaces map type
ivov 0894f6e
:fire: Remove unneeded default arg
ivov 2279efd
:sparkles: Add tests for `POST /users`
ivov d99c05a
:blue_book: Create test SMTP account type
ivov b857097
:pencil2: Improve wording
ivov 673ee5d
:art: Formatting
ivov 858ae42
:fire: Remove temp fix
ivov 0adc929
:zap: Replace helper with config call
ivov 9fbc5bb
:zap: Fix failing tests
ivov 5667a34
:twisted_rightwards_arrows: Merge parent branch
ivov e021618
:fire: Remove outdated test
ivov 0c904eb
:fire: Remove unused helper
ivov 1ae3ebe
:zap: Increase readability of domain fetcher
ivov 5c657e1
:zap: Refactor payload validation
ivov 3639cda
:fire: Remove repetition
ivov 14000a4
:rewind: Restore logging
ivov 84d1ee0
:zap: Initialize logger in tests
ivov 93c3e02
:fire: Remove redundancy from check
ivov b116981
:truck: Move `globalOwnerRole` fetching to global scope
ivov bc1c428
:fire: Remove unused imports
ivov 8c96a51
:truck: Move random utils to own module
ivov ba2de0e
:truck: Move test types to own module
ivov af20438
:pencil2: Add dividers to utils
ivov 403f198
:pencil2: Reorder `initTestServer` param docstring
ivov 6169636
:pencil2: Add TODO comment
ivov 273a36b
:zap: Dry up member creation
ivov 771464b
:zap: Tighten search criteria
ivov fff3504
:test_tube: Add expectation to `GET /users`
ivov d21d63d
:zap: Create role fetcher utils
ivov ca46df3
:zap: Create one more role fetch util
ivov 657a4aa
:fire: Remove unneeded DB query
ivov 4e58847
:test_tube: Add expectation to `POST /users`
ivov 3519c0f
:test_tube: Add expectation to `DELETE /users/:id`
ivov 7c55e03
:test_tube: Add another expectation to `DELETE /users/:id`
ivov 371e9ae
:test_tube: Add expectations to `DELETE /users/:id`
ivov 856a96c
:test_tube: Adjust expectations in `POST /users/:id`
ivov e5fc785
:test_tube: Add expectations to `DELETE /users/:id`
ivov ed075ec
:twisted_rightwards_arrows: Merge parent branch
ivov cb460f7
:shirt: Fix build
ivov f4820af
:zap: Update method
ivov 7273280
:twisted_rightwards_arrows: Merge parent branch
ivov df7b4ca
:blue_book: Fix `userToDelete` type
ivov c32423f
:zap: Refactor `createAgent()`
ivov 2dc4838
:zap: Make role fetching global
ivov 2c4579b
:zap: Optimize roles fetching
ivov 9e69323
:zap: Centralize member creation
ivov ded6663
:zap: Refactor truncation helper
ivov 9136d67
:test_tube: Add teardown to `DELETE /users/:id`
ivov b17e9d1
:test_tube: Add DB expectations to users tests
ivov aab2cd9
:fire: Remove pass validation due to hash
ivov 45bfd12
:pencil2: Improve pass validation error message
ivov 44e0fdc
:zap: Improve owner pass validation
ivov ab7753f
:zap: Create logger initialization helper
ivov c60226e
:zap: Optimize helpers
ivov 89cabd5
:zap: Restructure `getAllRoles` helper
ivov 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 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 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 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be a bigger task? out of scope of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hashing changes length so pass cannot be validated at model level unless we hash there as well - probably worth discussing. Since the helper is used by multiple namespaces, I decided to leave it untouched.